MCPcopy Index your code
hub / github.com/CommonstackAI/UncommonRoute / handler

Method handler

tests/test_proxy.py:923–936  ·  view source on GitHub ↗
(request: httpx.Request)

Source from the content-addressed store, hash-verified

921 )
922
923 def handler(request: httpx.Request) -> httpx.Response:
924 body = json.loads(request.content.decode("utf-8"))
925 calls.append(str(body.get("model")))
926 if len(calls) == 1:
927 raise httpx.RemoteProtocolError("server disconnected")
928 return httpx.Response(
929 200,
930 json={
931 "id": "chatcmpl-test",
932 "object": "chat.completion",
933 "model": body.get("model"),
934 "choices": [{"index": 0, "message": {"role": "assistant", "content": "ok"}}],
935 },
936 )
937
938 traces = TraceStore(storage=InMemoryTraceStorage())
939 async_client = httpx.AsyncClient(transport=httpx.MockTransport(handler))

Callers

nothing calls this directly

Calls 2

appendMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected