MCPcopy Create free account

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

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

↓ 17 callersFunctionto_json
Compact JSON for a content attribute. Values that JSON cannot hold become their `str()`.
src/anthropic/lib/_tracing/_utils.py:36
↓ 17 callersMethodvalidate
Validate an external key config against the customer's KMS. Anthropic performs an encrypt/decrypt roundtrip against the configured K
src/anthropic/resources/organization/external_keys.py:316
↓ 16 callersFunction_compacted_response
()
tests/lib/tools/test_runners.py:2470
↓ 16 callersFunction_install_run_session_tools
( monkeypatch: pytest.MonkeyPatch, record: dict[str, Any], *, serve: Callable[[], Awaitable[No
tests/lib/environments/test_worker.py:196
↓ 16 callersFunction_tool_reference_block
( kind: Literal["tool_removal", "tool_addition"], name: str )
tests/lib/tools/test_runners.py:1009
↓ 16 callersFunction_work_item
( *, work_type: str = "session", work_id: str = "w_1", session_id: str = "s_1", secret: str | None = None
tests/lib/environments/test_worker.py:180
↓ 16 callersMethodinsert
Insert text at a specific line number in a memory file.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:151
↓ 16 callersFunctionmodel_copy
(model: _ModelT, *, deep: bool = False)
src/anthropic/_compat.py:117
↓ 16 callersMethodremove_tools
Take tools away from the model without changing the `tools` param, which would miss the prompt cache. The tools stop being run at once, and t
src/anthropic/lib/tools/_beta_runner.py:508
↓ 16 callersMethodrename
Rename or move a memory file or directory.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:161
↓ 15 callersFunction_clear_aws_url_env
(monkeypatch: pytest.MonkeyPatch)
tests/lib/test_aws.py:126
↓ 15 callersFunction_extract_skill_archive
Extract a skill download (a zip or tar.* archive) from disk into `dest`. Skill bundles are wrapped in a single directory named after the skill; t
src/anthropic/lib/tools/_skills.py:140
↓ 15 callersFunction_recording_tool
A tool taking no input that appends `label` (its name by default) to `calls` when it runs.
tests/lib/tools/test_runners.py:1612
↓ 15 callersFunction_run_with_tool_changes
Drive a tool runner to the end, running `script[message.id]` while each message is being handled.
tests/lib/tools/test_runners.py:1644
↓ 15 callersMethodaction
(self, name: str, context: BetaToolsetCallContext, input: Any)
tests/lib/tools/toolsets/_fakes.py:112
↓ 15 callersFunctionbeta_check_upload_path
Return the resolved path of `path` if it lies under one of `roots` (symlinks resolved on both sides, whole-component comparison), else raise `Uplo
src/anthropic/lib/tools/_toolsets/_security.py:58
↓ 15 callersFunctionev
Serialize one event payload as an SSE frame (its `type` is the event name).
tests/lib/test_refusal_fallback_streaming.py:109
↓ 15 callersFunctionget
`value[key]` for a dict, `value.key` for a model, and `None` when there is no such entry.
src/anthropic/lib/_tracing/_utils.py:19
↓ 15 callersMethodget
( self, path: str, *, cast_to: Type[ResponseT], options: RequestOption
src/anthropic/_base_client.py:1582
↓ 15 callersFunctionis_mapping
(obj: object)
src/anthropic/_utils/_utils.py:186
↓ 15 callersFunctionserver_error
()
tests/lib/threads/helpers.py:775
↓ 15 callersMethodwrite
(profile: str, *, with_base_url: Optional[str])
tests/lib/test_credentials.py:410
↓ 14 callersFunction_as_dict
(value: object)
src/anthropic/lib/middleware/_fallbacks.py:1603
↓ 14 callersFunction_calls_tool
(name: str, tool_use_id: str)
tests/lib/tools/test_runners.py:1628
↓ 14 callersFunction_downloaded
A `SessionMemoryStores` with one store already downloaded to disk.
tests/lib/tools/memory_sync/test_folder_trust.py:32
↓ 14 callersFunction_response
(*blocks: dict[str, Any])
tests/lib/tools/toolsets/test_runner.py:44
↓ 14 callersFunction_sync_compact_runner
( client: Anthropic, *, betas: Union[List[AnthropicBetaParam], Omit] = omit, context_managemen
tests/lib/tools/test_runners.py:2530
↓ 14 callersFunction_tool_use
(name: str, id: str, input: dict[str, Any], *, toolset_name: str | None = None)
tests/lib/tools/toolsets/test_runner.py:37
↓ 14 callersMethodaction
(self, name: str, context: BetaToolsetCallContext, input: Any)
tests/lib/tools/toolsets/_computer_fakes.py:70
↓ 14 callersMethodasync_get_token
Async version of `get_token`. An async provider is awaited on the event loop. A sync provider runs `get_token` in a worker thread.
src/anthropic/lib/credentials/_cache.py:210
↓ 14 callersFunctionasync_stream_response
( id: str, text: str = "Hello there!", *, tool_use_id: str | None = None, container: str |
tests/lib/threads/helpers.py:437
↓ 14 callersFunctionbeta_edit_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:762
↓ 14 callersMethodread
()
src/anthropic/lib/tools/_file_store.py:155
↓ 14 callersMethodread
(self, size: int = -1)
tests/test_prepare.py:666
↓ 14 callersMethodrequest
( self, cast_to: Type[ResponseT], options: FinalRequestOptions, *, str
src/anthropic/_base_client.py:1183
↓ 14 callersFunctionresolve_path
Resolve `p` against the workdir; reject results outside the permitted roots. The permitted roots are `workdir` plus each entry of `allowed_roots`
src/anthropic/lib/tools/agent_toolset.py:394
↓ 14 callersFunctiontag_helper
Mark an object as created by a named SDK helper.
src/anthropic/lib/_stainless_helpers.py:88
↓ 14 callersFunctiontoolset_call
The model calls the tool `name` of a toolset with the id `toolu_<key>`. By default it is the computer toolset's `key` tool. Without a `toolset_nam
tests/lib/tools/test_runner_eager_tools.py:807
↓ 13 callersFunctioncontent_size
The bytes of UTF-8 that the content attributes of `span` that can be reduced hold.
tests/test_open_telemetry.py:279
↓ 13 callersMethodflush_writes
Upload new and changed files; send no deletes and pull nothing. The push-only rescue pass for a session ending on an error or cancel —
src/anthropic/lib/tools/_memories.py:452
↓ 13 callersFunctionget_origin
(t: type[Any])
src/anthropic/_compat.py:36
↓ 13 callersFunctionis_list
(obj: object)
src/anthropic/_utils/_utils.py:198
↓ 13 callersMethodmodel_dump_json
Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json Generates a JSON representation of the model using
src/anthropic/_models.py:439
↓ 13 callersMethodmonotonic
(self)
tests/lib/environments/test_worker.py:1097
↓ 13 callersFunctionopenapi_dumps
Serialize an object to UTF-8 encoded JSON bytes. Extends the standard json.dumps with support for additional types commonly used in the
src/anthropic/_utils/_json.py:20
↓ 13 callersFunctionresolve_base_url
Resolve the base URL from constructor arg, env var, or region. Returns None if no base URL is resolvable (caller should raise).
src/anthropic/lib/aws/_credentials.py:108
↓ 13 callersMethodrun
Poll the environment and service each claimed session until cancelled. Loops forever; cancel the task (or wrap it in `asyncio.wait_for`)
src/anthropic/lib/environments/_worker.py:516
↓ 13 callersMethodupdate
Apply the given request fields, tools and request options to all later turns. They stay, whatever the turn in flight was given for itself.
src/anthropic/lib/threads/_thread_state.py:135
↓ 12 callersFunction_api_status_error
(code: int)
tests/lib/tools/test_session_runner.py:142
↓ 12 callersFunctionasync_run
(client: AsyncAnthropic, **kwargs: Any)
tests/lib/tools/test_open_telemetry.py:198
↓ 12 callersMethodclose
(self)
src/anthropic/_client.py:447
↓ 12 callersMethodclose
(self)
src/anthropic/_client.py:849
↓ 12 callersFunctioncompaction_response
(id: str)
tests/lib/threads/helpers.py:410
↓ 12 callersFunctiondeleted
(path: str, *, was: str)
tests/lib/tools/memory_sync/_fake_anthropic.py:81
↓ 12 callersFunctiondelta
(event_id: str, text: str, index: int | None = None)
tests/lib/sessions/test_accumulate.py:43
↓ 12 callersMethodend
(self, how: StreamEnd, error: BaseException | None = None)
src/anthropic/_tracing.py:530
↓ 12 callersFunctionerror
(status: int)
tests/lib/test_refusal_fallback.py:74
↓ 12 callersFunctionget_auth_headers
( *, method: str, url: str, headers: httpx2.Headers, aws_access_key: str | None, aws_s
src/anthropic/lib/aws/_auth.py:33
↓ 12 callersFunctionget_model_fields
(model: type[pydantic.BaseModel])
src/anthropic/_compat.py:111
↓ 12 callersFunctioniter_next
(iter: Iterator[_T] | AsyncIterator[_T])
tests/test_streaming.py:364
↓ 12 callersFunctionrequest_helper_tags
The lines of the helper telemetry header on each request.
tests/lib/threads/helpers.py:949
↓ 12 callersFunctionresolve_api_key
Resolve the API key. Returns None if using SigV4.
src/anthropic/lib/aws/_credentials.py:65
↓ 12 callersFunctionstarts
When each tool started, and when the caller's loop body ended. `also` keeps the lines that start with it too.
tests/lib/tools/test_runner_eager_toolsets.py:429
↓ 12 callersMethodstop
(self, work_id: str, **kwargs: Any)
tests/lib/environments/test_poller_method.py:78
↓ 12 callersMethodstream
Create a Message stream
src/anthropic/resources/messages/messages.py:1318
↓ 12 callersFunctionturn_overrides
The given keyword arguments as `TurnOverrides`, without the ones left at their "not given" default.
src/anthropic/lib/threads/_params.py:102
↓ 11 callersMethod__init__
(self, reason: str)
src/anthropic/lib/tools/_toolsets/_errors.py:116
↓ 11 callersFunction_compaction_block_alone
()
tests/lib/tools/test_runners.py:2486
↓ 11 callersFunction_custom_tool_use
A CUSTOM (user-defined) tool call — the agent emits `agent.custom_tool_use` rather than `agent.tool_use` for these.
tests/lib/tools/test_session_runner.py:105
↓ 11 callersFunction_downloaded
A `SessionMemoryStores` with one store already downloaded to disk.
tests/lib/tools/memory_sync/test_memory_sync.py:31
↓ 11 callersFunction_not_found_result
(tool_use_id: str)
tests/lib/tools/test_runners.py:1266
↓ 11 callersFunction_tool_changes_message
(*blocks: Any)
tests/lib/tools/test_runners.py:1636
↓ 11 callersFunctionaiter_work
Async version of `iter_work`. See its docstring for semantics, including how `extra_headers` is passed through per request.
src/anthropic/lib/environments/_poller.py:251
↓ 11 callersFunctionbody
()
tests/test_streaming.py:32
↓ 11 callersFunctionconstruct_type_unchecked
Loose coercion to the expected type with construction of nested values. Note: the returned value from this function is not guaranteed to match th
src/anthropic/_models.py:652
↓ 11 callersMethodcopy
Create a new client re-using the current options, with optional overrides. Passing either of `token_provider` / `credentials` replaces the
src/anthropic/lib/google_cloud/_client.py:411
↓ 11 callersFunctiondrive
()
tests/lib/tools/test_session_runner.py:639
↓ 11 callersFunctionerror_response
(message: str, status: int)
tests/lib/test_refusal_fallback_streaming.py:105
↓ 11 callersFunctionfit_content
Serializes each content attribute that is not `None` to JSON, within `limit` bytes of UTF-8 in total. `size` gives the bytes of a string, and nev
src/anthropic/lib/_tracing/_content.py:160
↓ 11 callersMethodheartbeat
(self, work_id: str, **_kwargs: Any)
tests/lib/environments/test_worker.py:1195
↓ 11 callersFunctionmake_async_client
(**kwargs: Any)
tests/lib/test_refusal_fallback.py:40
↓ 11 callersFunctionmake_async_client
(**kwargs: Any)
tests/lib/test_refusal_fallback_streaming.py:81
↓ 11 callersFunctionmessage_start
()
tests/lib/test_refusal_fallback_streaming.py:114
↓ 11 callersFunctionmiddleware_request_body
(request: APIRequest)
tests/test_middleware.py:84
↓ 11 callersFunctionnew_client
Constructs a client, which reads the environment. One that is given a `server` sends its requests there.
tests/test_tracing.py:126
↓ 11 callersMethodquery
The query string that `query` is sent as, parsed back into a dict.
tests/test_prepare.py:81
↓ 11 callersFunctionrefusal_delta
(token: str | None = "tok_abc", has_prefill_claim: bool = True)
tests/lib/test_refusal_fallback_streaming.py:132
↓ 11 callersFunctionresolve_region
Resolve the AWS region from constructor arg or env var. Does not silently default — returns None if no region is available.
src/anthropic/lib/aws/_credentials.py:82
↓ 11 callersFunctionseed
(event_id: str)
tests/lib/sessions/test_accumulate.py:28
↓ 11 callersFunctionserving_stream
(model: str = FALLBACK_MODEL, message_id: str = "msg_b")
tests/lib/test_refusal_fallback_streaming.py:976
↓ 11 callersMethodset_attribute
(self, key: AttributeName, value: AttributeValue)
src/anthropic/lib/_tracing/_attributes.py:46
↓ 11 callersFunctionsse
(events: Sequence[dict[str, Any]])
tests/test_open_telemetry.py:271
↓ 11 callersMethodstr_replace
Replace text in a memory file.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:146
↓ 10 callersFunctionTypeAdapter
(*_args: Any, **_kwargs: Any)
src/anthropic/_models.py:1037
↓ 10 callersFunction_addition
(definition: Any)
tests/lib/tools/test_runners.py:1640
↓ 10 callersFunction_client_kwargs
When `deferred`, the project comes from ADC on the first request instead of from the arguments.
tests/lib/test_google_cloud.py:89
↓ 10 callersFunction_downloaded
A `SessionMemoryStores` with one store already downloaded, plus the fake `client.beta.memory_stores.memories` resource it calls.
tests/lib/tools/memory_sync/test_lost_response.py:28
↓ 10 callersFunction_downloaded
A `SessionMemoryStores` with one store already downloaded to disk.
tests/lib/tools/memory_sync/test_delete_discipline.py:32
↓ 10 callersFunction_install_aiter_work
(monkeypatch: pytest.MonkeyPatch, items: list[Any])
tests/lib/environments/test_worker.py:188
↓ 10 callersFunction_message
(*blocks: dict[str, Any], stop: str = "tool_use")
tests/lib/tools/toolsets/test_browser_runner.py:36
← previousnext →201–300 of 12,274, ranked by callers