is_basemodel_subclass#

langchain_core.utils.pydantic.is_basemodel_subclass(cls: Type) bool[source]#

Check if the given class is a subclass of Pydantic BaseModel.

Check if the given class is a subclass of any of the following:

  • pydantic.BaseModel in Pydantic 1.x

  • pydantic.BaseModel in Pydantic 2.x

  • pydantic.v1.BaseModel in Pydantic 2.x

Parameters:

cls (Type) –

Return type:

bool