MCPcopy Create free account
hub / github.com/nlweb-ai/NLWeb / fetch_non_streaming

Function fetch_non_streaming

AskAgent/python/testing/mock_appsdk_tool.py:81–94  ·  view source on GitHub ↗
(
    session: aiohttp.ClientSession,
    url: str,
    params: dict[str, Any],
    payload: dict[str, Any] | None,
)

Source from the content-addressed store, hash-verified

79
80
81async def fetch_non_streaming(
82 session: aiohttp.ClientSession,
83 url: str,
84 params: dict[str, Any],
85 payload: dict[str, Any] | None,
86) -> Any:
87 request_kwargs: dict[str, Any] = {"params": params}
88 if payload is not None:
89 request_kwargs["json"] = payload
90
91 http_method = session.get if payload is None else session.post
92 async with http_method(url, **request_kwargs) as response:
93 response.raise_for_status()
94 return await response.json()
95
96
97def extract_messages(payload: Any) -> list[dict[str, Any]]:

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected