is_basemodel_instance#

langchain_core.utils.pydantic.is_basemodel_instance(obj: Any) bool[source]#

Check if the given class is an instance of Pydantic BaseModel.

Check if the given class is an instance 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:

obj (Any) –

Return type:

bool