MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / __call__

Method __call__

tests/test_prepare.py:72–79  ·  view source on GitHub ↗

The JSON that `body` is sent as, or `None` when the request went out without content.

(self, body: object, *, extra_body: Mapping[str, object] | None = None)

Source from the content-addressed store, hash-verified

70 return httpx2.Response(200, json={})
71
72 async def __call__(self, body: object, *, extra_body: Mapping[str, object] | None = None) -> Any:
73 """The JSON that `body` is sent as, or `None` when the request went out without content."""
74 options = make_request_options(extra_body=extra_body)
75 if isinstance(self._client, Anthropic):
76 self._client.post("/foo", body=body, options=options, cast_to=httpx2.Response)
77 else:
78 await self._client.post("/foo", body=body, options=options, cast_to=httpx2.Response)
79 return json.loads(self.request.content) if self.request.content else None
80
81 async def query(
82 self,

Callers

nothing calls this directly

Calls 2

make_request_optionsFunction · 0.90
postMethod · 0.45

Tested by

no test coverage detected