MCPcopy Create free account

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

Functions9,455 in github.com/anthropics/anthropic-sdk-python

↓ 5 callersMethodprovider
(*, force_refresh: bool = False)
tests/lib/test_credentials.py:1549
↓ 5 callersMethodrequest
( self, cast_to: Type[ResponseT], options: FinalRequestOptions, *, str
src/anthropic/_base_client.py:1828
↓ 5 callersFunctionserving_stream
(model: str = FALLBACK_MODEL, message_id: str = "msg_b")
tests/lib/test_refusal_fallback_streaming.py:945
↓ 5 callersFunctionset_pydantic_config
Add a pydantic config for the given type. Note: this is a no-op on Pydantic v1.
src/anthropic/_models.py:873
↓ 5 callersFunctiontext
(value: str)
tests/lib/tools/test_runner_eager_tools.py:821
↓ 5 callersMethodto_param
Convert this response Message to a MessageParam so it can be passed back to the API as an input message, e.g. in the `messages` param.
src/anthropic/types/message.py:141
↓ 5 callersFunctiontoolset_result_block
The `tool_result` answering a member `tool_use`. `toolset_name` is required on a member result (the API rejects a mismatch), so it is echoed on er
src/anthropic/lib/tools/_toolsets/_runnable.py:264
↓ 5 callersFunctiontransforming_stream
A hop whose message_start reports `input_transformations`. It serves — its terminal message_delta carrying `delta_transformations` only when given
tests/lib/test_refusal_fallback_streaming.py:983
↓ 5 callersMethodwalk
()
src/anthropic/lib/tools/_file_store.py:173
↓ 5 callersMethodworker
()
tests/lib/test_credentials.py:1735
↓ 4 callersMethod__init__
( self, *, params: ParseMessageCreateParamsBase[ResponseFormatT], options: Req
src/anthropic/lib/tools/_beta_runner.py:165
↓ 4 callersMethod__init__
( self, cls: type[BaseToolset[Any, Any, Any]], *, configs: BetaBrowserToolsetC
src/anthropic/lib/tools/_toolsets/_browser.py:117
↓ 4 callersFunction_adrain_one
(ait: AsyncIterator[Any])
tests/lib/environments/test_poller_method.py:128
↓ 4 callersFunction_apply_hop
`entry` applied as a patch against `body`: a field set to a value overrides it, a field explicitly `None` unsets it (absent from the retried r
src/anthropic/lib/middleware/_fallbacks.py:1486
↓ 4 callersFunction_assert_credential_chain_off
(client: AnthropicGoogleCloud | AsyncAnthropicGoogleCloud)
tests/lib/test_google_cloud.py:942
↓ 4 callersFunction_assert_exchanged_and_called_own_deployment
The traffic seen by `base_url` is exactly one exchange followed by one request bearing the token that exchange minted.
tests/lib/test_credentials.py:2302
↓ 4 callersFunction_async_secure_mkdir
(path: AsyncPath, mode: int = _DIR_CREATE_MODE)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:656
↓ 4 callersFunction_async_weather_tool
()
tests/lib/tools/test_runners.py:2512
↓ 4 callersMethod_calculate_retry_timeout
( self, remaining_retries: int, options: FinalRequestOptions, response_headers
src/anthropic/_base_client.py:837
↓ 4 callersFunction_call
(browser: FakeBrowser | AsyncFakeBrowser, name: str, input: dict[str, Any])
tests/lib/tools/toolsets/test_pipeline.py:345
↓ 4 callersFunction_count
(respx_mock: MockRouter)
tests/lib/test_output_format_helpers.py:19
↓ 4 callersFunction_current_messages
(runner: Union[BetaToolRunner[None], BetaAsyncToolRunner[None]])
tests/lib/tools/test_runners.py:2555
↓ 4 callersFunction_format_file_size
(bytes_size: int)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:372
↓ 4 callersMethod_get_last_message
(self)
src/anthropic/lib/tools/_beta_runner.py:646
↓ 4 callersMethod_get_last_message
(self)
src/anthropic/lib/tools/_beta_runner.py:930
↓ 4 callersFunction_get_open_connections
(client: Anthropic | AsyncAnthropic)
tests/test_client.py:108
↓ 4 callersMethod_item
(self, path: str, *, view: str = "full")
tests/lib/tools/memory_sync/_fake_anthropic.py:96
↓ 4 callersFunction_json_dumps
(value: Any)
src/anthropic/lib/middleware/_fallbacks.py:1542
↓ 4 callersFunction_last_body
(respx_mock: MockRouter)
tests/lib/test_output_format_helpers.py:23
↓ 4 callersFunction_max_tokens_with_tool_use
()
tests/lib/tools/test_runners.py:905
↓ 4 callersFunction_merge_output_configs
( output_config: BetaOutputConfigParam | Omit, output_format: Optional[BetaJSONOutputFormatParam] | Om
src/anthropic/resources/beta/messages/messages.py:4095
↓ 4 callersFunction_mock_token_exchange
(respx_mock: MockRouter, base_url: str, token: str)
tests/lib/test_credentials.py:2282
↓ 4 callersMethod_prepare_options
(self, options: FinalRequestOptions)
src/anthropic/lib/foundry.py:272
↓ 4 callersMethod_prepare_options
(self, options: FinalRequestOptions)
src/anthropic/lib/foundry.py:492
↓ 4 callersFunction_read_env
Return the first non-None value from the given env vars, or None.
src/anthropic/lib/aws/_credentials.py:22
↓ 4 callersFunction_refusal
The refusal behind the `ToolError` a call raises: its cause, whose own text is what the model reads.
tests/lib/tools/toolsets/test_refusals.py:47
↓ 4 callersFunction_require_https
Reject non-`https://` token-endpoint URLs. Localhost is allowed for testing so `base_url="http://localhost:8080"` works against a local `oaut
src/anthropic/lib/credentials/_constants.py:116
↓ 4 callersFunction_run_tool_use
`_run_sync_tool_use` for either client.
tests/lib/tools/test_runners.py:2238
↓ 4 callersFunction_secure_mkdir
Create `path` and any missing parents with `mode`, regardless of umask. `Path.mkdir(parents=True, mode=...)` and `os.makedirs(mode=...)` apply th
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:307
↓ 4 callersFunction_tar_file
( name: str, data: bytes, *, mode: int = 0o644, type: bytes = tarfile.REGTYPE )
tests/lib/tools/test_skills.py:69
↓ 4 callersMethod_toolset_confirm
The approval gate: every call about to run is shown to `confirm` first, inside the pipeline and under the lock, so no override of `execute` or
src/anthropic/lib/tools/_toolsets/_base.py:324
↓ 4 callersMethod_toolset_member_method
Resolve `name` through the registry before touching the instance: `getattr(self, name)` on raw model output would reach `__init__` or any othe
src/anthropic/lib/tools/_toolsets/_base.py:238
↓ 4 callersFunction_weather_tool
A `get_weather(location, units)` tool over `run`, synchronous or asynchronous.
tests/lib/tools/test_runners.py:2227
↓ 4 callersFunction_zip_entry
(name: str, *, mode: int, create_system: int = 3)
tests/lib/tools/test_skills.py:94
↓ 4 callersMethodaiter_bytes
Given an iterator that yields raw binary data, iterate over it & yield every event encountered
src/anthropic/_streaming.py:428
↓ 4 callersFunctionassert_message_matches
(message: BetaMessage, expected: Dict[str, Any])
tests/lib/streaming/test_beta_messages.py:228
↓ 4 callersFunctionassert_signatures_in_sync
Ensure that the signature of the second function matches the first.
src/anthropic/_utils/_reflection.py:30
↓ 4 callersFunctionasync_to_custom_raw_response_wrapper
Higher order function that takes one of our bound API methods and an `APIResponse` class and wraps the method to support returning the given respo
src/anthropic/_response.py:842
↓ 4 callersFunctionasync_to_custom_streamed_response_wrapper
Higher order function that takes one of our bound API methods and an `APIResponse` class and wraps the method to support streaming and returning t
src/anthropic/_response.py:760
↓ 4 callersFunctionbeta_headers
(respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:166
↓ 4 callersFunctionbounded_result
`result` as it is rendered: the line a pure action returned is folded to one line and cut, so one that is only whitespace or control characters be
src/anthropic/lib/tools/_toolsets/_computer.py:410
↓ 4 callersFunctionbuild_headers
Fold header layers into one `httpx2.Headers`, later layers taking precedence whatever a name's casing. An `Omit` value removes the header set by
src/anthropic/_base_client.py:2568
↓ 4 callersMethodclose
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/lib/streaming/_beta_messages.py:89
↓ 4 callersMethodclose
Close the response and release the connection. Automatically called if the response body is read to completion.
src/anthropic/lib/streaming/_messages.py:86
↓ 4 callersFunctionconfirm_context
What the `confirm` callable is told: the member, its parsed input and the `tool_use` being answered. Built from values the pipeline already holds,
src/anthropic/lib/tools/_toolsets/_computer.py:425
↓ 4 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/anthropic/lib/bedrock/_mantle.py:271
↓ 4 callersFunctioncreate_message_async
(client: AsyncAnthropic)
tests/lib/test_refusal_fallback.py:91
↓ 4 callersFunctioncreate_stream_async
(client: AsyncAnthropic)
tests/lib/test_refusal_fallback_streaming.py:210
↓ 4 callersFunctionerror_text
`repr(exc)` as the `is_error` result the model reads, well formed and cut to the field limit: a driver's exception can embed a page-sized payload
src/anthropic/lib/tools/_toolsets/_sanitize.py:75
↓ 4 callersFunctionextract_type_arg
(typ: type, index: int)
src/anthropic/_utils/_typing.py:83
↓ 4 callersFunctionfield_outer_type
(field: FieldInfo)
src/anthropic/_compat.py:99
↓ 4 callersFunctionfolded
`text` on one line, not yet cut: line breaks, control and bidi characters folded to spaces, a lone surrogate to U+FFFD, the ends trimmed. For a va
src/anthropic/lib/tools/_toolsets/_sanitize.py:52
↓ 4 callersMethodhash_file
One file's sha256; `None` when absent. Shares `hashtree`'s cache.
src/anthropic/lib/tools/_file_store.py:203
↓ 4 callersFunctionhelper_headers
(respx_mock: MockRouter)
tests/lib/test_refusal_fallback.py:631
↓ 4 callersFunctionhook_refusal
The rule for an exception out of a developer hook (`confirm`, `url_policy`, the file policy): a `ToolsetUsageError` stops the run, a `ToolError` i
src/anthropic/lib/tools/_toolsets/_runnable.py:235
↓ 4 callersFunctionis_annotated_type
(typ: type)
src/anthropic/_utils/_typing.py:21
↓ 4 callersFunctionis_async_token_provider
True for an `async def` function, an object whose `__call__` is one, or a `functools.partial` of either.
src/anthropic/lib/credentials/_types.py:85
↓ 4 callersMethodis_closed
Whether or not the response body has been closed. If this is False then there is response data that has not been read yet. You must e
src/anthropic/_response.py:115
↓ 4 callersMethodis_path_visible
(self, path: str)
src/anthropic/lib/tools/_toolsets/_security.py:237
↓ 4 callersFunctioniter_next
(iter: Iterator[_T] | AsyncIterator[_T])
tests/decoders/test_jsonl.py:68
↓ 4 callersMethodls
The relative path of every file under the directory `under`.
src/anthropic/lib/tools/_file_store.py:169
↓ 4 callersFunctionmake_async_client
(**kwargs: Any)
tests/lib/test_refusal_fallback_streaming.py:77
↓ 4 callersFunctionmcp_message
Convert an MCP prompt message to an Anthropic `BetaMessageParam`.
src/anthropic/lib/tools/mcp.py:230
↓ 4 callersFunctionmock_results
(respx_mock: MockRouter)
tests/api_resources/beta/messages/test_batches.py:23
↓ 4 callersFunctionmock_results
(respx_mock: MockRouter)
tests/api_resources/messages/test_batches.py:23
↓ 4 callersMethodmove
Rename `src` to `dst`; an existing `dst` is refused. The banned store root as either end does nothing.
src/anthropic/lib/tools/_file_store.py:220
↓ 4 callersFunctionopenapi_dumps_str
`openapi_dumps`, as a `str`; for transports that send text frames.
src/anthropic/_utils/_json.py:30
↓ 4 callersFunctionparse_obj
(model: type[_ModelT], value: object)
src/anthropic/_compat.py:75
↓ 4 callersFunctionparse_text
(text: str, output_format: ResponseFormatT | NotGiven)
src/anthropic/lib/_parse/_response.py:16
↓ 4 callersFunctionquote
Add single quotation marks around the given string. Does *not* do any escaping.
src/anthropic/_utils/_utils.py:221
↓ 4 callersFunctionread_text_exact
Read a UTF-8 file without newline translation.
src/anthropic/lib/tools/_files.py:13
↓ 4 callersMethodrecord
(self, tool_use: BetaToolUseBlock, result: BetaToolResultBlockParam)
src/anthropic/lib/tools/_beta_runner.py:1202
↓ 4 callersMethodretrieve
Get a specific model. The Models API response can be used to determine information about a specific model or resolve a model
src/anthropic/resources/models.py:46
↓ 4 callersMethodstate
(self, context: BetaToolsetCallContext)
tests/lib/tools/toolsets/_fakes.py:64
↓ 4 callersFunctionto_custom_raw_response_wrapper
Higher order function that takes one of our bound API methods and an `APIResponse` class and wraps the method to support returning the given respo
src/anthropic/_response.py:819
↓ 4 callersFunctionto_custom_streamed_response_wrapper
Higher order function that takes one of our bound API methods and an `APIResponse` class and wraps the method to support streaming and returning t
src/anthropic/_response.py:735
↓ 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:247
↓ 4 callersFunctiontool_result_content
(content: None)
src/anthropic/lib/tools/_tool_dispatch.py:262
↓ 4 callersFunctionunwrap_partial
(obj: object)
src/anthropic/lib/credentials/_types.py:79
↓ 3 callersMethod__init__
(self, *, cache_control: BetaCacheControlEphemeralParam | None = None)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:88
↓ 3 callersMethod__init__
( self, cls: type[BaseToolset[Any, Any, Any]], *, configs: BetaComputerToolset
src/anthropic/lib/tools/_toolsets/_computer.py:74
↓ 3 callersMethod_apply_verdict
Dispatch or resolve a gated call according to the user's verdict. The idle-clock hold accounting lives here: a denial drops the held
src/anthropic/lib/tools/_beta_session_runner.py:758
↓ 3 callersFunction_async_read_file_content
(full_path: AsyncPath, memory_path: str)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:660
↓ 3 callersFunction_backoff
(attempt: int)
src/anthropic/lib/environments/_poller.py:32
↓ 3 callersFunction_beat_ok
(ttl_seconds: int = 0)
tests/lib/environments/test_worker.py:1089
↓ 3 callersMethod_check_can_compact
(self, params: ParseMessageCreateParamsBase[ResponseFormatT])
src/anthropic/lib/tools/_beta_runner.py:256
↓ 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:67
↓ 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:1346
↓ 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:107
↓ 3 callersFunction_fs_error
(op: str, file_path: str, e: OSError)
src/anthropic/lib/tools/agent_toolset.py:183
← previousnext →401–500 of 9,455, ranked by callers