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

Method __init__

tests/test_prepare.py:60–66  ·  view source on GitHub ↗
(self, client: Anthropic | AsyncAnthropic)

Source from the content-addressed store, hash-verified

58 """the last request that went over the wire"""
59
60 def __init__(self, client: Anthropic | AsyncAnthropic) -> None:
61 transport = httpx2.MockTransport(self._record)
62 self._client: Anthropic | AsyncAnthropic
63 if isinstance(client, Anthropic):
64 self._client = client.with_options(http_client=httpx2.Client(transport=transport), max_retries=0)
65 else:
66 self._client = client.with_options(http_client=httpx2.AsyncClient(transport=transport), max_retries=0)
67
68 def _record(self, request: httpx2.Request) -> httpx2.Response:
69 self.request = request

Callers

nothing calls this directly

Calls 1

with_optionsMethod · 0.80

Tested by

no test coverage detected