MCPcopy Create free account

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

Functions13,873 in github.com/anthropics/anthropic-sdk-python

↓ 3,249 callersFunctionassert_matches_type
( type_: Any, value: object, *, path: list[str], allow_none: bool = False, )
tests/utils.py:62
↓ 2,225 callersMethodget
(self, key: str, default: object = None)
tests/lib/tools/toolsets/test_interface.py:163
↓ 1,779 callersMethodparse
(self, query: str)
src/anthropic/_qs.py:33
↓ 1,065 callersMethodlist
(self, memory_store_id: str, **kwargs: Any)
tests/lib/tools/memory_sync/test_memory_sync.py:667
↓ 913 callersFunctionmake_request_options
Create a dict of type RequestOptions without keys of NotGiven values.
src/anthropic/_base_client.py:2549
↓ 862 callersMethodpost
(self, event: Any)
tests/lib/tools/test_session_runner_properties.py:589
↓ 791 callersMethodcreate
(self, memory_store_id: str, **kwargs: Any)
tests/lib/tools/memory_sync/test_memory_sync.py:685
↓ 769 callersMethodretrieve
(self, version: str, *, skill_id: str)
tests/lib/tools/test_skills.py:425
↓ 598 callersFunctionpath_template
Interpolate {name} placeholders in `template` from keyword arguments. Args: template: The template string containing {name} placeholders.
src/anthropic/_utils/_path.py:78
↓ 596 callersFunctionis_given
(obj: _T | NotGiven | Omit)
src/anthropic/_utils/_utils.py:156
↓ 595 callersFunctionstrip_not_given
(obj: None)
src/anthropic/_utils/_utils.py:306
↓ 516 callersMethodupdate
(self, memory_id: str, *, memory_store_id: str, **kwargs: Any)
tests/lib/tools/memory_sync/test_memory_sync.py:688
↓ 405 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
↓ 332 callersMethoddelete
(self, published: bool = True)
tests/lib/tools/_fake_sessions_api.py:508
↓ 282 callersMethoduntil_done
Blocks until the stream has been consumed
src/anthropic/lib/streaming/_messages.py:127
↓ 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
↓ 247 callersFunctionrun
()
tests/lib/tools/test_runners.py:1616
↓ 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
↓ 235 callersMethodstream
Create a Message stream
src/anthropic/resources/messages/messages.py:1305
↓ 226 callersMethodarchive
Only streams that are open now can show it. They may not, and then they stay open.
tests/lib/tools/_fake_sessions_api.py:503
↓ 205 callersFunctionrequest_bodies
(respx_mock: MockRouter)
tests/lib/threads/helpers.py:935
↓ 200 callersMethodsend
Send Events Args: events: Events to send to the `session`. betas: This endpoint is in beta: requests must send
src/anthropic/resources/beta/sessions/events.py:165
↓ 199 callersFunctionuser
(text: str)
tests/lib/threads/helpers.py:165
↓ 191 callersFunctionattributes
(span: ReadableSpan)
tests/test_open_telemetry.py:210
↓ 183 callersMethodget
The file's bytes; `None` when absent.
src/anthropic/lib/tools/_file_store.py:151
↓ 166 callersMethodone
(self, name: str)
tests/test_open_telemetry.py:154
↓ 164 callersFunctionrequiring_action
(*calls: Call, at: float = 0)
tests/lib/tools/_fake_sessions_api.py:883
↓ 148 callersMethodtool_runner
( self, *, max_tokens: int, messages: Iterable[BetaMessageParam], mode
src/anthropic/resources/beta/messages/messages.py:1711
↓ 147 callersMethoditems
(self)
src/anthropic/resources/beta/compliance/review/review.py:43
↓ 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
↓ 135 callersMethodremove
Delete a file or subtree; absent — and the banned store root — do nothing.
src/anthropic/lib/tools/_file_store.py:232
↓ 134 callersFunctionmake_client
(spans: Spans, **options: Any)
tests/test_open_telemetry.py:179
↓ 133 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
↓ 133 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
↓ 132 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
↓ 132 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
↓ 118 callersMethodadd
Add two numbers.
tests/lib/tools/test_functions.py:470
↓ 117 callersMethodcall
(self, context: BetaToolsetCallContext, name: str, input: object)
tests/lib/tools/toolsets/test_runnable.py:90
↓ 113 callersMethodcall
(self, input: object)
tests/lib/tools/_fake_sessions_api.py:803
↓ 111 callersMethodoption
(self, **options: Any)
tests/test_open_telemetry.py:159
↓ 91 callersFunctionabout
(seconds: float | list[float])
tests/lib/tools/test_session_runner.py:88
↓ 91 callersFunctionparse_datetime
(value: Union[datetime, StrBytesIntFloat])
src/anthropic/_utils/_compat.py:40
↓ 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
↓ 84 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
↓ 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:148
↓ 82 callersMethodconstruct
( # pyright: ignore[reportIncompatibleMethodOverride] __cls: Type[ModelT], _fields_set: set[s
src/anthropic/_models.py:297
↓ 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:98
↓ 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
↓ 79 callersFunctioncreate
(client: Any, **kwargs: Any)
tests/test_open_telemetry.py:258
↓ 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
↓ 73 callersMethodclose
(self)
tests/lib/tools/toolsets/_stubs.py:62
↓ 71 callersMethod_build_request
( self, options: FinalRequestOptions, *, retries_taken: int = 0, )
src/anthropic/_base_client.py:598
↓ 69 callersMethodjson
(self)
src/anthropic/_request.py:58
↓ 68 callersMethodoption
(self, **options: Any)
tests/lib/tools/test_open_telemetry.py:144
↓ 67 callersMethodnamed
(self, name: str)
tests/test_open_telemetry.py:151
↓ 62 callersFunctionget_response
Convert a fixture file into a stream of bytes for testing.
tests/lib/streaming/helpers.py:18
↓ 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 callersMethodone
(self, name: str)
tests/lib/tools/test_open_telemetry.py:139
↓ 58 callersFunctionsse_response
(body: str)
tests/lib/test_refusal_fallback_streaming.py:97
↓ 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
↓ 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 callersFunctionbeta_async_tool
(func: AsyncFunctionT)
src/anthropic/lib/tools/_beta_functions.py:480
↓ 53 callersFunctionparse_date
(value: Union[date, StrBytesIntFloat])
src/anthropic/_utils/_compat.py:36
↓ 52 callersFunctionattributes
(span: ReadableSpan)
tests/lib/tools/test_open_telemetry.py:153
↓ 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 callersMethoddecode
(self, line: str)
src/anthropic/_streaming.py:393
↓ 50 callersFunctionmake_async_client
(spans: Spans, **options: Any)
tests/test_open_telemetry.py:186
↓ 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 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:84
↓ 47 callersFunctionroles
(messages: Iterable[BetaMessageParam | dict[str, Any]])
tests/lib/threads/helpers.py:283
↓ 46 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:1549
↓ 46 callersMethodto_dict
(self)
tests/lib/tools/_fake_sessions_api.py:799
↓ 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
↓ 44 callersMethodcancel
(self, client: str)
tests/lib/environments/_schedules.py:44
↓ 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:136
↓ 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
↓ 43 callersMethodwait
(self, context: BetaToolsetCallContext, input: BetaBrowserWaitInput)
tests/lib/tools/toolsets/_fakes.py:196
↓ 42 callersFunctionmake_sync_client
(**kwargs: Any)
tests/lib/test_refusal_fallback_streaming.py:77
↓ 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:870
↓ 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 callersMethodresolve
Stage one of a call: the registry row for `name`, or the refusal the model reads (an unknown name, a member this application disabled, or one
src/anthropic/lib/tools/_toolsets/_base.py:213
↓ 38 callersFunctionsend
(client: Anthropic | AsyncAnthropic)
tests/test_prepare.py:117
↓ 38 callersFunctiontexts
(content: Any)
tests/lib/tools/toolsets/_fakes.py:315
↓ 37 callersFunctionbeta_read_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:953
next →1–100 of 13,873, ranked by callers