MCPcopy Create free account

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

Functions14,068 in github.com/anthropics/anthropic-sdk-python

↓ 3,257 callersFunctionassert_matches_type
( type_: Any, value: object, *, path: list[str], allow_none: bool = False, )
tests/utils.py:62
↓ 2,261 callersMethodget
(self, key: str, default: object = None)
tests/lib/tools/toolsets/test_interface.py:163
↓ 1,785 callersMethodparse
()
tests/lib/_parse/test_messages.py:200
↓ 1,073 callersMethodlist
(self, memory_store_id: str, **kwargs: Any)
tests/lib/tools/memory_sync/test_memory_sync.py:667
↓ 915 callersFunctionmake_request_options
Create a dict of type RequestOptions without keys of NotGiven values.
src/anthropic/_base_client.py:2663
↓ 809 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
↓ 727 callersMethodpost
(self, *args: Any, **kwargs: Any)
tests/lib/_parse/test_messages.py:191
↓ 599 callersFunctionpath_template
Interpolate {name} placeholders in `template` from keyword arguments. Args: template: The template string containing {name} placeholders.
src/anthropic/_utils/_path.py:78
↓ 595 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
↓ 408 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:512
↓ 286 callersMethoduntil_done
Blocks until the stream has been consumed
src/anthropic/lib/streaming/_messages.py:129
↓ 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
↓ 241 callersMethodstream
Create a Message stream
src/anthropic/resources/messages/messages.py:1314
↓ 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
↓ 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:507
↓ 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
↓ 185 callersMethodget
The file's bytes; `None` when absent.
src/anthropic/lib/tools/_file_store.py:151
↓ 184 callersFunctionrequiring_action
(*calls: Call, at: float = 0)
tests/lib/tools/_fake_sessions_api.py:891
↓ 166 callersMethodone
(self, name: str)
tests/test_open_telemetry.py:154
↓ 166 callersMethodpost
(self, event: Any)
tests/lib/tools/test_session_runner_properties.py:591
↓ 152 callersMethoditems
(self)
src/anthropic/resources/beta/compliance/review/review.py:43
↓ 148 callersMethodtool_runner
( self, *, max_tokens: int, messages: Iterable[BetaMessageParam], mode
src/anthropic/resources/beta/messages/messages.py:1720
↓ 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 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:811
↓ 134 callersFunctionmake_client
(spans: Spans, **options: Any)
tests/test_open_telemetry.py:179
↓ 134 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:794
↓ 133 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:723
↓ 133 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:704
↓ 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
↓ 115 callersMethodcall
(self, input: object)
tests/lib/tools/_fake_sessions_api.py:811
↓ 111 callersMethodoption
(self, **options: Any)
tests/test_open_telemetry.py:159
↓ 91 callersFunctionabout
(seconds: float | list[float])
tests/lib/tools/test_session_runner.py:89
↓ 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
↓ 87 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:426
↓ 85 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
↓ 83 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
↓ 83 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:100
↓ 80 callersFunctionbeta_tool
(func: FunctionT)
src/anthropic/lib/tools/_beta_functions.py:350
↓ 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
↓ 72 callersFunctionmessage_body
(*, model: str = "claude-opus-4-6")
tests/test_middleware.py:64
↓ 71 callersMethod_build_request
( self, options: FinalRequestOptions, *, retries_taken: int = 0, )
src/anthropic/_base_client.py:664
↓ 70 callersMethodjson
(self)
src/anthropic/_request.py:65
↓ 68 callersFunctionget_response
Convert a fixture file into a stream of bytes for testing.
tests/lib/streaming/helpers.py:18
↓ 68 callersMethodoption
(self, **options: Any)
tests/lib/tools/test_open_telemetry.py:144
↓ 67 callersMethodnamed
(self, name: str)
tests/test_open_telemetry.py:151
↓ 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
↓ 55 callersFunctionmake
The model holding `data`, made in each of the ways a model gets made.
tests/test_prepare.py:419
↓ 55 callersFunctionparse_date
(value: Union[date, StrBytesIntFloat])
src/anthropic/_utils/_compat.py:36
↓ 54 callersMethoddecode
(self, line: str)
src/anthropic/_streaming.py:395
↓ 54 callersFunctionsetup
(sync: bool, client: Anthropic, async_client: AsyncAnthropic, respx_mock: MockRouter)
tests/lib/tools/test_runner_eager_tools.py:1160
↓ 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
↓ 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:841
↓ 50 callersFunctionmake_async_client
(spans: Spans, **options: Any)
tests/test_open_telemetry.py:186
↓ 50 callersFunctionrun
()
tests/lib/tools/toolsets/test_browser_runner.py:394
↓ 49 callersFunctionmake_sync_client
(**kwargs: Any)
tests/test_middleware.py:56
↓ 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 callersFunctionattached
(notes: Path, access: str = "read_write")
tests/lib/tools/memory_sync/test_e2e_memory.py:41
↓ 48 callersFunctionreplies_of
What the runner yields, whether it is the sync or the async one.
tests/lib/tools/test_runner_eager_tools.py:1164
↓ 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:1558
↓ 46 callersMethodto_dict
(self)
tests/lib/tools/_fake_sessions_api.py:807
↓ 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:851
↓ 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 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
next →1–100 of 14,068, ranked by callers