def __init__(
self,
api_key: str | None = None,
base_url: str | None = None,
timeout: float | None = None,
max_retries: int = 2,
default_headers: dict[str, str] | None = None,
http_client: httpx.AsyncClient | None = None,
create_options: CreateOptions | None = None,
prompt_caching: bool = True,
) -> None:
self._client = AsyncAnthropic(
api_key=api_key,
base_url=base_url,
timeout=timeout if timeout is not None else NOT_GIVEN,
max_retries=max_retries,
default_headers=default_headers,
http_client=http_client,
)
self._create_options = {k: v for k, v in (create_options or {}).items() if k != "stream"}
self._streaming = (create_options or {}).get("stream", False)
self._prompt_caching = prompt_caching