Home / Function/ make_request_options() — anthropic-sdk-python Function Reference

make_request_options() — anthropic-sdk-python Function Reference

Architecture documentation for the make_request_options() function in _base_client.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  cd0ebdb5_facf_4a5b_42cf_a4c5b06b8eb2["make_request_options()"]
  31e60ad8_cac8_652d_176d_4f7cf7dda1ad["_base_client.py"]
  cd0ebdb5_facf_4a5b_42cf_a4c5b06b8eb2 -->|defined in| 31e60ad8_cac8_652d_176d_4f7cf7dda1ad
  afc80c40_7ec9_e8a7_8063_f2ab74bc2ee7["get()"]
  cd0ebdb5_facf_4a5b_42cf_a4c5b06b8eb2 -->|calls| afc80c40_7ec9_e8a7_8063_f2ab74bc2ee7
  style cd0ebdb5_facf_4a5b_42cf_a4c5b06b8eb2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/_base_client.py lines 2086–2120

def make_request_options(
    *,
    query: Query | None = None,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    idempotency_key: str | None = None,
    timeout: float | httpx.Timeout | None | NotGiven = not_given,
    post_parser: PostParser | NotGiven = not_given,
) -> RequestOptions:
    """Create a dict of type RequestOptions without keys of NotGiven values."""
    options: RequestOptions = {}
    if extra_headers is not None:
        options["headers"] = extra_headers

    if extra_body is not None:
        options["extra_json"] = cast(AnyMapping, extra_body)

    if query is not None:
        options["params"] = query

    if extra_query is not None:
        options["params"] = {**options.get("params", {}), **extra_query}

    if not isinstance(timeout, NotGiven):
        options["timeout"] = timeout

    if idempotency_key is not None:
        options["idempotency_key"] = idempotency_key

    if is_given(post_parser):
        # internal
        options["post_parser"] = post_parser  # type: ignore

    return options

Subdomains

Calls

Frequently Asked Questions

What does make_request_options() do?
make_request_options() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/_base_client.py.
Where is make_request_options() defined?
make_request_options() is defined in src/anthropic/_base_client.py at line 2086.
What does make_request_options() call?
make_request_options() calls 1 function(s): get.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free