Home / Function/ is_pydantic_v2_subclass() — langchain Function Reference

is_pydantic_v2_subclass() — langchain Function Reference

Architecture documentation for the is_pydantic_v2_subclass() function in pydantic.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  becaa38e_5e59_781a_b67b_a77334e9d7f6["is_pydantic_v2_subclass()"]
  892b1d9f_bb87_0364_19af_71382204e430["pydantic.py"]
  becaa38e_5e59_781a_b67b_a77334e9d7f6 -->|defined in| 892b1d9f_bb87_0364_19af_71382204e430
  becaa38e_5e59_781a_b67b_a77334e9d7f6["is_pydantic_v2_subclass()"]
  becaa38e_5e59_781a_b67b_a77334e9d7f6 -->|calls| becaa38e_5e59_781a_b67b_a77334e9d7f6
  becaa38e_5e59_781a_b67b_a77334e9d7f6["is_pydantic_v2_subclass()"]
  becaa38e_5e59_781a_b67b_a77334e9d7f6 -->|calls| becaa38e_5e59_781a_b67b_a77334e9d7f6
  style becaa38e_5e59_781a_b67b_a77334e9d7f6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/utils/pydantic.py lines 87–93

def is_pydantic_v2_subclass(cls: type) -> bool:
    """Check if the given class is Pydantic v2-like.

    Returns:
        `True` if the given class is a subclass of Pydantic `BaseModel` 2.x.
    """
    return issubclass(cls, BaseModel)

Domain

Subdomains

Frequently Asked Questions

What does is_pydantic_v2_subclass() do?
is_pydantic_v2_subclass() is a function in the langchain codebase, defined in libs/core/langchain_core/utils/pydantic.py.
Where is is_pydantic_v2_subclass() defined?
is_pydantic_v2_subclass() is defined in libs/core/langchain_core/utils/pydantic.py at line 87.
What does is_pydantic_v2_subclass() call?
is_pydantic_v2_subclass() calls 1 function(s): is_pydantic_v2_subclass.
What calls is_pydantic_v2_subclass()?
is_pydantic_v2_subclass() is called by 1 function(s): is_pydantic_v2_subclass.

Analyze Your Own Codebase

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

Try Supermodel Free