create_model#

langchain_core.utils.pydantic.create_model(
model_name: str,
module_name: str | None = None,
/,
**field_definitions: Any,
) type[BaseModel][source]#

Create a pydantic model with the given field definitions.

Please use create_model_v2 instead of this function.

Parameters:
  • model_name (str) – The name of the model.

  • module_name (str | None) – The name of the module where the model is defined. This is used by Pydantic to resolve any forward references.

  • **field_definitions (Any) – The field definitions for the model.

Returns:

The created model.

Return type:

Type[BaseModel]