Home / Function/ _is_pydantic_class() — langchain Function Reference

_is_pydantic_class() — langchain Function Reference

Architecture documentation for the _is_pydantic_class() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  d89431ed_ce69_57ad_733e_2a7726f52453["_is_pydantic_class()"]
  cbac6225_d16a_7d3b_a2eb_91848460cf5a["base.py"]
  d89431ed_ce69_57ad_733e_2a7726f52453 -->|defined in| cbac6225_d16a_7d3b_a2eb_91848460cf5a
  ebd1bfb1_67ad_e1e6_3202_04ca697dfd47["_generate()"]
  ebd1bfb1_67ad_e1e6_3202_04ca697dfd47 -->|calls| d89431ed_ce69_57ad_733e_2a7726f52453
  dcbd739a_66ae_915f_7087_234dec7749be["_agenerate()"]
  dcbd739a_66ae_915f_7087_234dec7749be -->|calls| d89431ed_ce69_57ad_733e_2a7726f52453
  87f27511_fdba_ef62_5d49_9bb5bb7b4c3e["with_structured_output()"]
  87f27511_fdba_ef62_5d49_9bb5bb7b4c3e -->|calls| d89431ed_ce69_57ad_733e_2a7726f52453
  1782a9b7_5310_befd_b211_b39285a871e1["_construct_responses_api_payload()"]
  1782a9b7_5310_befd_b211_b39285a871e1 -->|calls| d89431ed_ce69_57ad_733e_2a7726f52453
  3595fa9f_20d5_1aa8_5e31_d40aff0893df["_construct_lc_result_from_responses_api()"]
  3595fa9f_20d5_1aa8_5e31_d40aff0893df -->|calls| d89431ed_ce69_57ad_733e_2a7726f52453
  style d89431ed_ce69_57ad_733e_2a7726f52453 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/langchain_openai/chat_models/base.py lines 3490–3491

def _is_pydantic_class(obj: Any) -> bool:
    return isinstance(obj, type) and is_basemodel_subclass(obj)

Subdomains

Frequently Asked Questions

What does _is_pydantic_class() do?
_is_pydantic_class() is a function in the langchain codebase, defined in libs/partners/openai/langchain_openai/chat_models/base.py.
Where is _is_pydantic_class() defined?
_is_pydantic_class() is defined in libs/partners/openai/langchain_openai/chat_models/base.py at line 3490.
What calls _is_pydantic_class()?
_is_pydantic_class() is called by 5 function(s): _agenerate, _construct_lc_result_from_responses_api, _construct_responses_api_payload, _generate, with_structured_output.

Analyze Your Own Codebase

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

Try Supermodel Free