MCPcopy Create free account

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

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

↓ 4 callersFunctiontool_change_replies
The replies of a run that calls `get_weather`, then `lookup`, then `get_weather` again, and then ends.
tests/lib/threads/helpers.py:372
↓ 4 callersFunctiontool_change_turns
What answers each of the first three `tool_change_replies()` when `lookup` is added while the first one is handled and `get_weather` is removed wh
tests/lib/threads/helpers.py:382
↓ 4 callersFunctiontool_error_content
Render an exception raised by a tool as tool-result content. A `ToolError` has its own structured content, made well formed but never cut. An
src/anthropic/lib/tools/_tool_dispatch.py:263
↓ 4 callersFunctiontool_result_content
(content: None)
src/anthropic/lib/tools/_tool_dispatch.py:278
↓ 4 callersFunctionunwrap_partial
(obj: object)
src/anthropic/lib/credentials/_types.py:79
↓ 4 callersFunctionvalidate_output_config_conflict
Reject a call that passes both `output_format` and `output_config.format`.
src/anthropic/lib/_parse/_transform.py:19
↓ 4 callersFunctionwait_until
(condition: Callable[[Trace], object])
tests/lib/tools/_fake_sessions_api.py:875
↓ 4 callersFunctionwithhold_message_snapshot
Keeps the snapshot shared for `stream` out of the output content of the span of its API call. The stream helper could not accumulate an event, so
src/anthropic/lib/_tracing/_streaming.py:158
↓ 4 callersFunctionwithout_speed
(body: dict[str, Any])
tests/lib/test_refusal_fallback.py:122
↓ 4 callersFunctionwithout_speed
(body: dict[str, Any])
tests/lib/test_refusal_fallback_streaming.py:175
↓ 4 callersFunctionwork_kinds
(trace: Trace)
tests/lib/environments/test_worker.py:72
↓ 3 callersMethod__init__
(self, *, cache_control: BetaCacheControlEphemeralParam | None = None)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:89
↓ 3 callersMethod__init__
( self, cls: type[BaseToolset[Any, Any, Any]], *, configs: BetaComputerToolset
src/anthropic/lib/tools/_toolsets/_computer.py:74
↓ 3 callersMethod__init__
(self, beta: Beta)
src/anthropic/lib/bedrock/_beta.py:81
↓ 3 callersMethod_accept
(self, thread: str, event: Event)
tests/lib/tools/_fake_sessions_api.py:667
↓ 3 callersFunction_async_read_file_content
(full_path: AsyncPath, memory_path: str)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:669
↓ 3 callersMethod_build_middleware_chain
Build the middleware invocation chain. The chain only depends on the immutable `self._middleware` tuple so it is built once at constr
src/anthropic/_base_client.py:1357
↓ 3 callersMethod_check_can_compact
(self, params: ParseMessageCreateParamsBase[ResponseFormatT])
src/anthropic/lib/tools/_beta_runner.py:379
↓ 3 callersFunction_config_dir
Resolve the config directory. `ANTHROPIC_CONFIG_DIR` env var → platform default. Platform defaults: * Linux & macOS: `~/.config/anthro
src/anthropic/lib/credentials/_constants.py:63
↓ 3 callersMethod_copy_and_prepare
A copy of `options` with `extra_body` merged into the body, and the body and query prepared. The data is walked once per request, before the
src/anthropic/_base_client.py:1488
↓ 3 callersMethod_copy_open_telemetry
The `open_telemetry` option of a copy of this client: the one given, or else, for `None`, this client's own. The one given replaces this clie
src/anthropic/_base_client.py:492
↓ 3 callersFunction_determine_next_step_from_stop_reason
Decide how the runner loop treats a finished assistant turn. - `run_tools`: run the turn's client tool calls, append their results and continue;
src/anthropic/lib/tools/_beta_runner.py:121
↓ 3 callersMethod_end
(self, state: str, *published: Event | None)
tests/lib/tools/_fake_sessions_api.py:771
↓ 3 callersFunction_fs_error
(op: str, file_path: str, e: OSError)
src/anthropic/lib/tools/agent_toolset.py:197
↓ 3 callersMethod_get_page_items
(self)
src/anthropic/_base_client.py:245
↓ 3 callersMethod_handle_ack
(self, item: Item, client: str)
tests/lib/environments/_fake_work_api.py:422
↓ 3 callersFunction_is_supported_image_type
(mime_type: str)
src/anthropic/lib/tools/mcp.py:102
↓ 3 callersFunction_json_dumps_secrets
`json.dumps` with `SecretStr` values unwrapped at dump time. Returns bytes so call sites can pass the result inline (request content, `os.wri
src/anthropic/lib/credentials/_secrets.py:95
↓ 3 callersMethod_kill
(self)
src/anthropic/lib/tools/agent_toolset.py:652
↓ 3 callersMethod_list_memories
The store's memories — `basic` view (shas, no content) at `_LIST_PAGE_SIZE` per page unless the caller needs `full` pages. `memory_pre
src/anthropic/lib/tools/_memories.py:804
↓ 3 callersFunction_make_tar
(path: Path, members: list[tuple[tarfile.TarInfo, bytes]])
tests/lib/tools/test_skills.py:121
↓ 3 callersFunction_make_zip_infos
(path: Path, entries: list[tuple[zipfile.ZipInfo, bytes]])
tests/lib/tools/test_skills.py:134
↓ 3 callersFunction_missing_target_fixture
Workdir with two links to `deep/t`, which doesn't exist. With `..` collapsed by name, both targets read as `t`, whose entries link outside.
tests/lib/tools/test_agent_toolset.py:1709
↓ 3 callersFunction_move_authorization
(request: httpx2.Request)
tests/lib/test_credentials.py:2483
↓ 3 callersMethod_move_to_log
(self, *rows: Event)
tests/lib/tools/_fake_sessions_api.py:673
↓ 3 callersFunction_prepare_options
(input_options: FinalRequestOptions, *, project_id: str | None, region: str)
src/anthropic/lib/vertex/_client.py:387
↓ 3 callersFunction_read_file_content
(full_path: Path, memory_path: str)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:356
↓ 3 callersFunction_redact_body
Truncate a token-endpoint error body for safe inclusion in an exception.
src/anthropic/lib/credentials/_workload.py:55
↓ 3 callersFunction_reject_read_only
Raise `ToolError` when `target` falls under a read-only root. Roots resolve at check time, exactly like `allowed_roots` in `resolve_path` — a
src/anthropic/lib/tools/agent_toolset.py:451
↓ 3 callersMethod_request_api_list
( self, model: Type[object], page: Type[SyncPageT], options: FinalRequestOptio
src/anthropic/_base_client.py:1572
↓ 3 callersFunction_request_id
(resp: httpx2.Response)
src/anthropic/lib/credentials/_workload.py:50
↓ 3 callersMethod_resolve
(self, id: str)
tests/lib/tools/_fake_sessions_api.py:677
↓ 3 callersMethod_resolve_base_url
base_url precedence: top-level config field → bound (the owning client's base_url, via `bind_base_url`) → default. Validated against t
src/anthropic/lib/credentials/_providers.py:277
↓ 3 callersFunction_resolve_max_bytes
Resolve a configured cap to an effective size limit. `not_given` selects `default`; `None` disables the size check (uncapped); a positive int
src/anthropic/lib/tools/agent_toolset.py:145
↓ 3 callersFunction_response_without_a_summary
(content: List[Any], stop_reason: str)
tests/lib/tools/test_runners.py:2507
↓ 3 callersMethod_run_tool
(self, tool: BetaRunnableTool, tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_beta_runner.py:853
↓ 3 callersMethod_run_toolset_member
(self, tool_use: BetaToolUseBlock)
src/anthropic/lib/tools/_beta_runner.py:876
↓ 3 callersFunction_safe_json
(text: str)
src/anthropic/lib/middleware/_fallbacks.py:1592
↓ 3 callersMethod_scan_marker
(self, store: _AttachedStore)
src/anthropic/lib/tools/_memories.py:374
↓ 3 callersFunction_seam_block
The synthetic `fallback` content block marking one model boundary.
src/anthropic/lib/middleware/_fallbacks.py:1438
↓ 3 callersFunction_sent_tools
The `tools` array of the first request the runner sent.
tests/lib/tools/toolsets/test_runner.py:141
↓ 3 callersMethod_session_events
The session's status comes from the statuses of all threads, or only the primary thread's if that failed.
tests/lib/tools/_fake_sessions_api.py:710
↓ 3 callersMethod_set_open_telemetry
Sets this client's `open_telemetry` option, and has it get its tracer anew. Nothing else sets the option. The constructor calls this, and so
src/anthropic/_base_client.py:469
↓ 3 callersMethod_should_retry
(self, response: httpx2.Response)
src/anthropic/_base_client.py:942
↓ 3 callersFunction_sse_message
(content_block: Dict[str, Any], stop_reason: str, *deltas: Dict[str, Any])
tests/lib/tools/test_runners.py:3466
↓ 3 callersMethod_start_new_thread
Stop continuing from the stored reply so the turn re-sends the full history under a new thread.
src/anthropic/lib/threads/_thread_state.py:296
↓ 3 callersFunction_strip_traceback
Detach the frames chained onto `err` before raising from it. Foreign frames (json decoder, httpx transport) hold raw payloads — request bodie
src/anthropic/lib/credentials/_secrets.py:104
↓ 3 callersMethod_sync_all
(self, *, final: bool)
src/anthropic/lib/tools/_memories.py:368
↓ 3 callersFunction_tar_special
(name: str, type: bytes, linkname: str = "")
tests/lib/tools/test_skills.py:112
↓ 3 callersFunction_thread_fields
(fields: dict[str, Any])
tests/lib/threads/helpers.py:85
↓ 3 callersFunction_unwrap_secret
Inverse of `_wrap_secret_fields` for a single value; pass-through for values that were never wrapped (absent or non-string fields).
src/anthropic/lib/credentials/_secrets.py:83
↓ 3 callersFunction_validate_profile_name
Reject profile names that could escape the config directory. Profile names come from user-controlled sources (`ANTHROPIC_PROFILE`, the `activ
src/anthropic/lib/credentials/_constants.py:131
↓ 3 callersFunction_vertex_message
(content: List[Dict[str, Any]], stop_reason: str)
tests/lib/test_vertex.py:111
↓ 3 callersMethod_walk_sync_auth
(client: Anthropic)
tests/lib/test_credentials.py:4551
↓ 3 callersFunction_wrap_secret_fields
Wrap the secret fields of a parsed JSON object in `SecretStr`. Called at every boundary where credential material enters SDK code. Traceback
src/anthropic/lib/credentials/_secrets.py:51
↓ 3 callersMethod_write_result
The server writes the call's result, which the log shows only for the primary thread.
tests/lib/tools/_fake_sessions_api.py:682
↓ 3 callersFunctionaction_line
The line of text a pure action returned, as written: `render_result` folds it to one line (control, line-separator and bidi characters a space) an
src/anthropic/lib/tools/_toolsets/_render.py:101
↓ 3 callersFunctionadd_response_ids
(obj: BaseModel, *, request_id: str | None, workspace_id: str | None)
src/anthropic/_models.py:969
↓ 3 callersMethodafter_failure
(self)
src/anthropic/lib/environments/_poller.py:63
↓ 3 callersFunctionas_dict
(value: object)
src/anthropic/lib/_tracing/_utils.py:28
↓ 3 callersFunctionbeta_bash_tool
(ctx: AgentToolContext)
src/anthropic/lib/tools/agent_toolset.py:861
↓ 3 callersMethodbind_base_url
Adopt the owning client's `base_url` as a fallback for the token exchange. Slots between the config file's own `base_url` field and th
src/anthropic/lib/credentials/_providers.py:231
↓ 3 callersFunctionblock
(awaitable: Any)
tests/lib/environments/_schedules.py:183
↓ 3 callersMethodblocked_until
(self, now: float)
tests/lib/environments/test_worker_properties.py:139
↓ 3 callersFunctionbuild
`_models.build()` without its walk over the field annotations: stream event fields are already constructed.
src/anthropic/lib/streaming/_messages.py:465
↓ 3 callersMethodcall
(self, input: object)
src/anthropic/lib/tools/_tool_dispatch.py:148
↓ 3 callersFunctioncall_messages
Creates a Message from `messages` with a synchronous or an asynchronous client.
tests/test_open_telemetry.py:4354
↓ 3 callersFunctioncancel
(tool: Any, command: str)
tests/lib/tools/test_agent_toolset.py:1020
↓ 3 callersMethodclose
Close the underlying HTTPX client. The client will *not* be usable after this.
src/anthropic/_base_client.py:1155
↓ 3 callersMethodclose
Release what the toolset holds when you are done. The tool runner never calls this, so one instance can serve several runs, and a `with` block
src/anthropic/lib/tools/_toolsets/_base.py:299
↓ 3 callersMethodclose
(self)
src/anthropic/lib/credentials/_close.py:14
↓ 3 callersMethodclose
(self)
src/anthropic/lib/middleware/_fallbacks.py:1703
↓ 3 callersFunctionconsume_async_iterator
(iterator: AsyncIterator[Any])
src/anthropic/_utils/_streams.py:10
↓ 3 callersFunctionconsume_sync_iterator
(iterator: Iterator[Any])
src/anthropic/_utils/_streams.py:5
↓ 3 callersMethodcopy
( # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] — narrows `credentials` to No
src/anthropic/lib/aws/_client.py:406
↓ 3 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/vertex/_client.py:164
↓ 3 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/vertex/_client.py:330
↓ 3 callersFunctioncount_accumulated_events
Wraps the stable or the beta `accumulate_event`, which the stream helpers and the spans share, so that the type of each event it takes is added to
tests/test_open_telemetry.py:820
↓ 3 callersMethodcountdown_end
(self, session: FakeSession)
tests/lib/tools/test_session_runner_properties.py:316
↓ 3 callersFunctionderived_url
(template: str, /, **values: str)
src/anthropic/lib/google_cloud/_client.py:179
↓ 3 callersFunctiondig
The value at `path` in `data`, whose every level is a dict or a model. `None` where a level lacks its name.
src/anthropic/_tracing.py:807
↓ 3 callersMethoddo
(self, name: str, context: BetaToolsetCallContext, input: Any)
tests/lib/tools/test_runner_eager_tools.py:1050
↓ 3 callersFunctionevaluated_permission
(event: DispatchedToolUseEvent | None)
src/anthropic/lib/tools/_beta_session_runner.py:868
↓ 3 callersFunctionexchange_federation_assertion
Perform a single RFC 7523 `jwt-bearer` exchange and return the resulting `AccessToken`. This is a one-shot convenience wrapper around `Worklo
src/anthropic/lib/credentials/_workload.py:363
↓ 3 callersMethodexecute
(self, context: BetaToolsetCallContext, name: Any, input: Any)
tests/lib/tools/toolsets/test_computer_interface.py:109
↓ 3 callersFunctionfamily_call
A call to a tool of the `family` toolset, and the timeline line for when that tool starts.
tests/lib/tools/test_runner_eager_toolsets.py:438
↓ 3 callersMethodfind_symlinks
Every symlink under `under` — listings skip them and reads refuse them, so a caller that must know they exist asks here.
src/anthropic/lib/tools/_file_store.py:178
↓ 3 callersMethodfirst_at
(self, *outcomes: str)
tests/lib/environments/test_worker_properties.py:124
↓ 3 callersMethodget_final_text
Returns all `text` content blocks concatenated together. > [!NOTE] > Currently the API will only respond with a single content block.
src/anthropic/lib/streaming/_messages.py:106
↓ 3 callersMethodget_max_retries
(self, max_retries: int)
src/anthropic/_models.py:1109
← previousnext →701–800 of 13,873, ranked by callers