MCPcopy Create free account

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

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

↓ 4 callersFunction_member_use
(name: str, id: str, input: dict[str, Any])
tests/lib/tools/toolsets/test_browser_runner.py:52
↓ 4 callersFunction_mock_skill
Mocks the lookup of the skill's version, and returns the route of its download.
tests/lib/tools/test_skills.py:478
↓ 4 callersMethod_prepare_options
(self, options: FinalRequestOptions)
src/anthropic/lib/foundry.py:481
↓ 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 serve
src/anthropic/lib/credentials/_constants.py:112
↓ 4 callersFunction_run_tool_use
`_run_sync_tool_use` for either client.
tests/lib/tools/test_runners.py:2246
↓ 4 callersFunction_runner_class
(*, sync: bool, stream: bool)
tests/lib/tools/test_runners.py:3573
↓ 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:308
↓ 4 callersFunction_session_with_skills
(*skill_ids: str)
tests/lib/tools/test_skills.py:496
↓ 4 callersFunction_sse_body
( id: str, text: str = "Hello there!", *, tool_use_id: str | None = None, container: str |
tests/lib/threads/helpers.py:675
↓ 4 callersMethod_status_event
(self, prefix: str, stop_reason: str | None, status: str, ids: list[str])
tests/lib/tools/_fake_sessions_api.py:733
↓ 4 callersFunction_tar_file
( name: str, data: bytes, *, mode: int = 0o644, type: bytes = tarfile.REGTYPE )
tests/lib/tools/test_skills.py:102
↓ 4 callersFunction_targz_bytes
(entries: dict[str, bytes])
tests/lib/tools/test_skills.py:70
↓ 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 callersMethod_turn_options
The runner's request options for a turn on `thread`. A turn's `extra_headers` replace the thread's, so the runner's helper tags go on top of t
src/anthropic/lib/tools/_beta_runner.py:278
↓ 4 callersFunction_weather_tool
A `get_weather(location, units)` tool over `run`, synchronous or asynchronous.
tests/lib/tools/test_runners.py:2235
↓ 4 callersFunction_zip_entry
(name: str, *, mode: int, create_system: int = 3)
tests/lib/tools/test_skills.py:127
↓ 4 callersFunctionaccumulate_event
( *, event: RawMessageStreamEvent, current_snapshot: ParsedMessage[ResponseFormatT] | None, js
src/anthropic/lib/streaming/_messages.py:480
↓ 4 callersMethodaclose
(self)
src/anthropic/lib/credentials/_close.py:19
↓ 4 callersMethodaiter_bytes
Given an iterator that yields raw binary data, iterate over it & yield every event encountered
src/anthropic/_streaming.py:371
↓ 4 callersFunctionas_sent
A copy of `value` with every model in it dumped as a request body sends it.
src/anthropic/lib/threads/_thread_state.py:641
↓ 4 callersFunctionasync_interrupted_stream_response
( id: str, text: str, *, error: type[httpx2.TransportError] | None = None )
tests/lib/threads/helpers.py:502
↓ 4 callersFunctionasync_requester
A method shaped like a generated streaming method, whose response is `body`.
tests/utils.py:242
↓ 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:844
↓ 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:762
↓ 4 callersFunctionbackoff
Exponential backoff for `attempt` (1-indexed), capped at `cap`.
src/anthropic/lib/_retry.py:43
↓ 4 callersFunctionbeta_headers
(respx_mock: MockRouter)
tests/lib/test_refusal_fallback_streaming.py:170
↓ 4 callersFunctionbody
()
tests/decoders/test_jsonl.py:19
↓ 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 callersFunctionchat_message
(role: str, *parts: dict[str, Any])
tests/test_open_telemetry.py:295
↓ 4 callersFunctioncleaning_up_for
(seconds: float, seen: list[str])
tests/lib/tools/test_session_runner.py:112
↓ 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:94
↓ 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:90
↓ 4 callersFunctioncommon_arguments
(client_class: ClientClass)
tests/lib/test_client_copy.py:194
↓ 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/foundry.py:213
↓ 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:273
↓ 4 callersFunctioncount
How many items the list `value` has, and `None` for anything else, such as a list that the request lacks.
src/anthropic/lib/_tracing/_attributes.py:54
↓ 4 callersFunctioncreate
(client: AnthropicBedrockMantle, user_profile_id: str | Omit, extra_body: object)
tests/lib/test_bedrock_mantle.py:457
↓ 4 callersMethodcreate
Create a new memory file with the specified content.
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:141
↓ 4 callersFunctioncut_tool_stream_events
The events of `tool_stream_events` up to a delta that leaves the input of its `tool_use` block open.
tests/test_open_telemetry.py:781
↓ 4 callersMethoddispose
Remove every store directory that `download` created. Pre-existing directories are left alone — that is `FileStore.dispose`'s own rul
src/anthropic/lib/tools/_memories.py:562
↓ 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 callersFunctionevents_up_to_message_delta
The events of a stream that ends before `message_stop`, whose `message_delta` has all that one can have.
tests/test_open_telemetry.py:836
↓ 4 callersMethodexpires_at
(self, now: float)
tests/lib/environments/test_worker_properties.py:128
↓ 4 callersFunctionextract_type_arg
(typ: type, index: int)
src/anthropic/_utils/_typing.py:83
↓ 4 callersFunctionfinish_api_call_span
Records the call's `result` on its span, and ends the span. The body of a stream or of an unread raw response keeps the span until the applicatio
src/anthropic/lib/_tracing/_api_call.py:39
↓ 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 callersFunctionget_async_library
()
src/anthropic/_utils/_utils.py:435
↓ 4 callersMethodget_tracer
(self, *args: Any, **kwargs: Any)
tests/test_open_telemetry.py:8151
↓ 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:691
↓ 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 callersFunctionid_headers
The response headers that a reply's `_request_id` and `_workspace_id` come from.
tests/lib/threads/helpers.py:322
↓ 4 callersFunctioninterrupted_stream_response
A streamed reply cut off in its text block, once `text` has arrived: the body ends there, or reading on raises `error`.
tests/lib/threads/helpers.py:492
↓ 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 callersFunctionis_fatal_status_error
True for a 4xx that retrying will not fix (bad key, missing resource). Aligns with the core client's `_should_retry` policy: 408 / 409 / 429 are
src/anthropic/lib/_retry.py:56
↓ 4 callersMethodis_path_visible
(self, path: str)
src/anthropic/lib/tools/_toolsets/_security.py:238
↓ 4 callersFunctionis_running
(pid: object)
tests/lib/tools/test_agent_toolset.py:979
↓ 4 callersMethodis_waited_on
(self)
src/anthropic/lib/tools/_beta_session_runner.py:852
↓ 4 callersMethoditem
(self, item: object)
src/anthropic/_tracing.py:526
↓ 4 callersFunctionmake_async_client
()
tests/lib/threads/helpers.py:58
↓ 4 callersFunctionmake_jsonl_iterator
( content: Iterator[bytes], *, sync: bool, line_type: type[_T], )
tests/decoders/test_jsonl.py:138
↓ 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 callersFunctionperformed
(actions: list[Step], steps: list[Step] | None = None, **options: Any)
tests/lib/environments/test_fake_work_api.py:27
↓ 4 callersFunctionperforming
(*actions: Step)
tests/lib/tools/test_session_runner_properties.py:593
↓ 4 callersFunctionprint_obj
Pretty print an object to a string
tests/lib/utils.py:18
↓ 4 callersFunctionquote
Add single quotation marks around the given string. Does *not* do any escaping.
src/anthropic/_utils/_utils.py:221
↓ 4 callersMethodread
(self)
tests/lib/environments/test_worker_properties.py:318
↓ 4 callersMethodrecord
(self, tool_use: BetaToolUseBlock, result: BetaToolResultBlockParam)
src/anthropic/lib/tools/_beta_runner.py:1707
↓ 4 callersMethodrecord_reply
Record `message` as the turn's reply, for the next turn to continue from. A refused turn is not recorded, and the next turn starts a new threa
src/anthropic/lib/threads/_thread_state.py:310
↓ 4 callersFunctionrequester
A method shaped like a generated streaming method, whose response is `body`.
tests/utils.py:226
↓ 4 callersFunctionrequeued_and_claimed
(at: float)
tests/lib/environments/test_worker.py:68
↓ 4 callersFunctionresponse_ids
(*replies: BetaMessage)
tests/lib/threads/helpers.py:327
↓ 4 callersMethodresult
The result of the call, as far as the call has got.
src/anthropic/_tracing.py:342
↓ 4 callersFunctionrun_with_a_browser_toolset
Runs the loop of a tool runner that has a browser toolset on `reply` and then `FINAL`, and returns the route. A streamed reply is read to its end
tests/lib/tools/test_open_telemetry.py:268
↓ 4 callersMethodrunnable
(self, session: FakeSession)
tests/lib/tools/test_session_runner_properties.py:253
↓ 4 callersFunctionsame_message
Whether `a` and `b` are sent as the same message. A recorded reply holds its content blocks as models, and the caller gives the same blocks back a
src/anthropic/lib/threads/_thread_state.py:635
↓ 4 callersFunctionschedule
(data: st.DataObject, kinds: list[list[Step]], gaps: list[float])
tests/lib/tools/test_session_runner_properties.py:139
↓ 4 callersFunctionset_content_attributes
Sets the content attributes of `span` within `limit`, the client's `max_content_bytes`. `limit` is in bytes of UTF-8. Each of `attributes` is set
src/anthropic/lib/_tracing/_content.py:118
↓ 4 callersFunctionshare_message_snapshot
Lets the span of the API call that returned `stream` take its output content from `reader`.
src/anthropic/lib/_tracing/_streaming.py:152
↓ 4 callersFunctionsignature_without_evaluating_annotations
Like `inspect.signature()`, for callers that only need parameter names, kinds and defaults. Python 3.14 evaluates annotations lazily and `inspect
src/anthropic/_utils/_reflection.py:9
↓ 4 callersFunctionslow_stream_closes
Makes closing a response stream wait, as closing a connection does, and lists each close as it starts and finishes.
tests/lib/tools/test_open_telemetry.py:232
↓ 4 callersMethodstart_turn
Stage `messages` and start the turn that sends them. The turn goes out even if nothing is staged then.
src/anthropic/lib/threads/_thread_state.py:248
↓ 4 callersMethodstate
(self, context: BetaToolsetCallContext)
tests/lib/tools/toolsets/_fakes.py:64
↓ 4 callersMethodstatuses
(self, kind: str)
tests/lib/tools/_fake_sessions_api.py:179
↓ 4 callersFunctionthread_logs
The (level, message) pairs logged under the `anthropic.lib.threads` logger or its children.
tests/lib/threads/helpers.py:954
↓ 4 callersFunctiontimestamp
(at: float | None)
tests/lib/environments/_fake_work_api.py:519
↓ 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:821
↓ 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:737
← previousnext →601–700 of 13,873, ranked by callers