MCPcopy Create free account

hub / github.com/anthropics/anthropic-sdk-python / functions

Functions12,274 in github.com/anthropics/anthropic-sdk-python

↓ 2,801 callersFunctionassert_matches_type
( type_: Any, value: object, *, path: list[str], allow_none: bool = False, )
tests/utils.py:62
↓ 1,957 callersMethodget
(self, key: str, default: object = None)
tests/lib/tools/toolsets/test_interface.py:163
↓ 1,551 callersMethodparse
(self, query: str)
src/anthropic/_qs.py:33
↓ 942 callersMethodlist
(self, _session_id: str, *, limit: int = 1000, extra_headers: Any = None)
tests/lib/tools/test_session_runner.py:1713
↓ 864 callersMethodpost
( self, path: str, *, cast_to: Type[ResponseT], body: Body | None = No
src/anthropic/_base_client.py:1628
↓ 797 callersFunctionmake_request_options
Create a dict of type RequestOptions without keys of NotGiven values.
src/anthropic/_base_client.py:2533
↓ 749 callersMethodcreate
(self, memory_store_id: str, **kwargs: Any)
tests/lib/tools/memory_sync/test_memory_sync.py:685
↓ 626 callersMethodretrieve
(self, version: str, *, skill_id: str)
tests/lib/tools/test_skills.py:422
↓ 514 callersFunctionpath_template
Interpolate {name} placeholders in `template` from keyword arguments. Args: template: The template string containing {name} placeholders.
src/anthropic/_utils/_path.py:78
↓ 470 callersFunctionis_given
(obj: _T | NotGiven | Omit)
src/anthropic/_utils/_utils.py:156
↓ 469 callersFunctionstrip_not_given
(obj: None)
src/anthropic/_utils/_utils.py:306
↓ 426 callersMethodupdate
(self, memory_id: str, *, memory_store_id: str, **kwargs: Any)
tests/lib/tools/memory_sync/test_memory_sync.py:688
↓ 390 callersMethodappend
Stage messages for the next turn, skipping the reply just recorded and deferring while a turn is in flight.
src/anthropic/lib/threads/_thread_state.py:107
↓ 301 callersMethoddelete
(self, memory_id: str, *, memory_store_id: str, **kwargs: Any)
tests/lib/tools/memory_sync/test_memory_sync.py:691
↓ 280 callersMethoduntil_done
Blocks until the stream has been consumed
src/anthropic/lib/streaming/_messages.py:125
↓ 268 callersFunctionqueue_responses
Answer the next `len(responses)` Messages API requests with `responses`, in order. An exception is raised in place of a response.
tests/lib/threads/helpers.py:287
↓ 236 callersFunctionmessage_response
( id: str, text: str = "Hi!", *, tool_use_id: str | None = None, tool_name: str = "get_wea
tests/lib/threads/helpers.py:293
↓ 205 callersFunctionrequest_bodies
(respx_mock: MockRouter)
tests/lib/threads/helpers.py:935
↓ 199 callersFunctionuser
(text: str)
tests/lib/threads/helpers.py:165
↓ 194 callersMethodstream
(self, _session_id: str, *, extra_headers: Any = None)
tests/lib/tools/test_session_runner.py:219
↓ 191 callersFunctionattributes
(span: ReadableSpan)
tests/test_open_telemetry.py:210
↓ 184 callersMethodarchive
Hide a `completed`, `failed`, or `canceled` dream from the default list of dreams. Archiving a `pending` or `running` dream
src/anthropic/resources/beta/dreams.py:325
↓ 180 callersMethodget
The file's bytes; `None` when absent.
src/anthropic/lib/tools/_file_store.py:151
↓ 180 callersMethodsend
(self, session_id: str, *, events: list[Any], extra_headers: Any = None)
tests/lib/tools/test_session_runner.py:244
↓ 166 callersMethodone
(self, name: str)
tests/test_open_telemetry.py:154
↓ 152 callersMethodtool_runner
( self, *, max_tokens: int, messages: Iterable[BetaMessageParam], mode
src/anthropic/resources/beta/messages/messages.py:1681
↓ 143 callersMethodwith_options
The copy that sends a thread's tool results is this client: the fake events record every send.
tests/lib/tools/test_session_runner.py:304
↓ 141 callersFunctionmake_thread
A thread on the sync client; `model` and `max_tokens` default to values no test depends on.
tests/lib/threads/helpers.py:75
↓ 134 callersFunctionmake_client
(spans: Spans, **options: Any)
tests/test_open_telemetry.py:179
↓ 131 callersMethodremove
Delete a file or subtree; absent — and the banned store root — do nothing.
src/anthropic/lib/tools/_file_store.py:232
↓ 117 callersMethodcall
(self, context: BetaToolsetCallContext, name: str, input: object)
tests/lib/tools/toolsets/test_runnable.py:90
↓ 115 callersFunctionasync_to_raw_response_wrapper
Higher order function that takes one of our bound API methods and wraps it to support returning the raw `APIResponse` object directly.
src/anthropic/_response.py:804
↓ 115 callersFunctionto_raw_response_wrapper
Higher order function that takes one of our bound API methods and wraps it to support returning the raw `APIResponse` object directly.
src/anthropic/_response.py:787
↓ 114 callersFunctionasync_to_streamed_response_wrapper
Higher order function that takes one of our bound API methods and wraps it to support streaming and returning the raw `APIResponse` object directl
src/anthropic/_response.py:716
↓ 114 callersFunctionto_streamed_response_wrapper
Higher order function that takes one of our bound API methods and wraps it to support streaming and returning the raw `APIResponse` object directl
src/anthropic/_response.py:697
↓ 113 callersMethodadd
Add two numbers.
tests/lib/tools/test_functions.py:470
↓ 111 callersMethodoption
(self, **options: Any)
tests/test_open_telemetry.py:159
↓ 90 callersFunctionstream_response
(events: Sequence[dict[str, Any]] | None = None)
tests/test_open_telemetry.py:605
↓ 87 callersFunctioncontinue_from
(previous_message_id: str)
tests/lib/threads/helpers.py:279
↓ 82 callersFunction_write_profile
Test helper: lay out `configs/<profile>.json` and optionally `credentials/<profile>.json` under `config_dir`. Accepts either the new nested `
tests/lib/test_credentials.py:143
↓ 81 callersMethodconstruct
( # pyright: ignore[reportIncompatibleMethodOverride] __cls: Type[ModelT], _fields_set: set[s
src/anthropic/_models.py:296
↓ 81 callersMethodget_final_message
Waits until the stream has been read to completion and returns the accumulated `Message` object.
src/anthropic/lib/streaming/_messages.py:96
↓ 80 callersFunctionbeta_tool
(func: FunctionT)
src/anthropic/lib/tools/_beta_functions.py:350
↓ 80 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding. A credential passed her
src/anthropic/_client.py:453
↓ 80 callersFunctionrun_sync
Drive one reconcile pass without clock bookkeeping. The public cadence path (`sync_if_due` plus the clock) is exercised by the worker tests;
tests/lib/tools/memory_sync/conftest.py:33
↓ 79 callersFunctioncreate
(client: Any, **kwargs: Any)
tests/test_open_telemetry.py:258
↓ 77 callersFunctionparse_datetime
(value: Union[datetime, StrBytesIntFloat])
src/anthropic/_utils/_compat.py:40
↓ 76 callersMethodcall
(self, input: dict[str, Any])
tests/lib/tools/test_session_runner.py:266
↓ 75 callersMethodset
Set a spend limit. Upsert keyed on (scope, period): setting a limit that already exists overwrites it in place. A Claude Ent
src/anthropic/resources/beta/organization/spend_limits/spend_limits.py:263
↓ 69 callersMethod_build_request
( self, options: FinalRequestOptions, *, retries_taken: int = 0, )
src/anthropic/_base_client.py:595
↓ 67 callersMethodnamed
(self, name: str)
tests/test_open_telemetry.py:151
↓ 63 callersMethodjson
(self)
src/anthropic/_request.py:58
↓ 63 callersMethodone
(self, name: str)
tests/lib/tools/test_open_telemetry.py:129
↓ 61 callersFunctionmake_async_thread
A thread on the async client; `model` and `max_tokens` default to values no test depends on.
tests/lib/threads/helpers.py:80
↓ 61 callersMethodset_messages_params
Update the parameters for the next API call. This invalidates any cached tool responses. With `run_tools_eagerly`, a tool call of the
src/anthropic/lib/tools/_beta_runner.py:284
↓ 60 callersMethodoption
(self, **options: Any)
tests/lib/tools/test_open_telemetry.py:134
↓ 58 callersFunctionattributes
(span: ReadableSpan)
tests/lib/tools/test_open_telemetry.py:143
↓ 58 callersFunctionbeta_async_tool
(func: AsyncFunctionT)
src/anthropic/lib/tools/_beta_functions.py:480
↓ 58 callersMethodclose
(self)
tests/lib/tools/toolsets/_stubs.py:62
↓ 58 callersFunctionget_response
Convert a fixture file into a stream of bytes for testing.
tests/lib/streaming/helpers.py:18
↓ 58 callersFunctionsse_response
(body: str)
tests/lib/test_refusal_fallback_streaming.py:97
↓ 56 callersFunction_tool_use
( id: str, name: str, input: dict[str, Any], *, evaluated_permission: str | None = None,
tests/lib/tools/test_session_runner.py:75
↓ 56 callersFunctionmessage_body
(*, model: str = "claude-opus-4-6")
tests/test_middleware.py:63
↓ 55 callersFunctionmake
The model holding `data`, made in each of the ways a model gets made.
tests/test_prepare.py:419
↓ 55 callersMethodrun
Run Deployment Now Args: deployment_id: Unique identifier of the deployment to run. betas: This endpoint is in
src/anthropic/resources/beta/deployments.py:586
↓ 54 callersFunctionsetup
(sync: bool, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter)
tests/lib/tools/test_runner_eager_tools.py:1159
↓ 53 callersFunctionassistant
(text: str = "Hi!")
tests/lib/threads/helpers.py:185
↓ 53 callersFunctionparse_date
(value: Union[date, StrBytesIntFloat])
src/anthropic/_utils/_compat.py:36
↓ 52 callersMethodget
(self, __key: str)
src/anthropic/_types.py:311
↓ 51 callersFunction_end_turn_response
()
tests/lib/tools/test_runners.py:993
↓ 51 callersFunctionreply
A reply that asks for tool results.
tests/lib/tools/test_runner_eager_tools.py:840
↓ 50 callersFunctionmake_async_client
(spans: Spans, **options: Any)
tests/test_open_telemetry.py:186
↓ 49 callersFunction_terminated
()
tests/lib/tools/test_session_runner.py:115
↓ 49 callersFunctionmessage
(model: str, **overrides: Any)
tests/lib/test_refusal_fallback.py:44
↓ 49 callersFunctionrequest_threads
The `thread` param of each request, or `None` for a request sent without one.
tests/lib/threads/helpers.py:939
↓ 48 callersMethoddecode
(self, line: str)
src/anthropic/_streaming.py:393
↓ 48 callersFunctionreplies_of
What the runner yields, whether it is the sync or the async one.
tests/lib/tools/test_runner_eager_tools.py:1163
↓ 48 callersFunctiontool_use_message
(city: str = "SF")
tests/lib/tools/test_open_telemetry.py:74
↓ 47 callersFunctionroles
(messages: Iterable[BetaMessageParam | dict[str, Any]])
tests/lib/threads/helpers.py:283
↓ 46 callersFunctioncall
The model calls `lookup(key=key)` with the id `toolu_<key>`. `json_input` is the input as sent, which may be cut off.
tests/lib/tools/test_runner_eager_tools.py:801
↓ 46 callersMethodto_dict
(self)
tests/lib/tools/test_session_runner.py:279
↓ 46 callersMethodwait
(self, context: BetaToolsetCallContext, input: BetaBrowserWaitInput)
tests/lib/tools/toolsets/_fakes.py:196
↓ 45 callersMethodcompact_before_next_turn
Compact the conversation before the model's next turn. This only schedules the compaction. Once the current turn has finished, including
src/anthropic/lib/tools/_beta_runner.py:360
↓ 45 callersMethodcount_tokens
Count the number of tokens in a Message. The Token Count API can be used to count the number of tokens in a Message, includi
src/anthropic/resources/messages/messages.py:1562
↓ 44 callersFunction_run_with_fakes
( *, events: FakeAsyncEvents, tools: list[Any], max_idle: float | None = None, environment
tests/lib/tools/test_session_runner.py:309
↓ 44 callersFunctionmake_runner
(*, stream: Literal[False] = False, **fields: Any)
tests/lib/threads/helpers.py:90
↓ 44 callersMethodnamed
(self, name: str)
tests/lib/tools/test_open_telemetry.py:126
↓ 43 callersMethodcancel
Stop a `pending` or `running` dream. The response shows `status` as `canceled`, unless the dream reached `completed` or `fai
src/anthropic/resources/beta/dreams.py:400
↓ 43 callersFunctiondone
The reply that ends the conversation.
tests/lib/tools/test_runner_eager_tools.py:850
↓ 43 callersMethoddownload
Download File Args: file_id: ID of the File. workspace_id: Optional header to select the Workspace for this req
src/anthropic/resources/files.py:193
↓ 43 callersFunctionmake_sync_client
(**kwargs: Any)
tests/test_middleware.py:55
↓ 42 callersFunctionmake_sync_client
(**kwargs: Any)
tests/lib/test_refusal_fallback_streaming.py:77
↓ 42 callersMethodsleep
(self, _seconds: float)
tests/lib/environments/test_poller_method.py:352
↓ 41 callersFunctioncollect
(stream: Stream[BetaRawMessageStreamEvent])
tests/lib/test_refusal_fallback_streaming.py:157
↓ 41 callersFunctioncreate_stream
( client: Anthropic, *, betas: List[AnthropicBetaParam] | Omit = omit, speed: Literal["standar
tests/lib/test_refusal_fallback_streaming.py:211
↓ 41 callersFunctionmake_sync_client
(**kwargs: Any)
tests/lib/test_refusal_fallback.py:36
↓ 41 callersFunctionrespond
(request: httpx2.Request)
tests/lib/test_bedrock.py:869
↓ 39 callersFunctionrefusal
(model: str, fallback_credit_token: str | None = None)
tests/lib/test_refusal_fallback.py:61
↓ 38 callersFunction_sent_request_bodies
(respx_mock: MockRouter)
tests/lib/tools/test_runners.py:2466
↓ 38 callersFunctionsend
(client: Anthropic | AsyncAnthropic)
tests/test_prepare.py:117
next →1–100 of 12,274, ranked by callers