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

_get_extra_fields_type() — anthropic-sdk-python Function Reference

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

Function python AnthropicClient SyncAPI calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  1f3d71e8_e87a_ef4b_aa3d_66605c49e5bd["_get_extra_fields_type()"]
  3912cc3f_b0e8_a732_b8e2_613b018b830d["_models.py"]
  1f3d71e8_e87a_ef4b_aa3d_66605c49e5bd -->|defined in| 3912cc3f_b0e8_a732_b8e2_613b018b830d
  57e8da7b_af31_35a8_78f7_c274f7fbb350["construct()"]
  57e8da7b_af31_35a8_78f7_c274f7fbb350 -->|calls| 1f3d71e8_e87a_ef4b_aa3d_66605c49e5bd
  afc80c40_7ec9_e8a7_8063_f2ab74bc2ee7["get()"]
  1f3d71e8_e87a_ef4b_aa3d_66605c49e5bd -->|calls| afc80c40_7ec9_e8a7_8063_f2ab74bc2ee7
  style 1f3d71e8_e87a_ef4b_aa3d_66605c49e5bd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/_models.py lines 430–444

def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None:
    if PYDANTIC_V1:
        # TODO
        return None

    schema = cls.__pydantic_core_schema__
    if schema["type"] == "model":
        fields = schema["schema"]
        if fields["type"] == "model-fields":
            extras = fields.get("extras_schema")
            if extras and "cls" in extras:
                # mypy can't narrow the type
                return extras["cls"]  # type: ignore[no-any-return]

    return None

Subdomains

Calls

Called By

Frequently Asked Questions

What does _get_extra_fields_type() do?
_get_extra_fields_type() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/_models.py.
Where is _get_extra_fields_type() defined?
_get_extra_fields_type() is defined in src/anthropic/_models.py at line 430.
What does _get_extra_fields_type() call?
_get_extra_fields_type() calls 1 function(s): get.
What calls _get_extra_fields_type()?
_get_extra_fields_type() is called by 1 function(s): construct.

Analyze Your Own Codebase

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

Try Supermodel Free