langchain_core.utils.function_calling.convert_pydantic_to_openai_tool¶

langchain_core.utils.function_calling.convert_pydantic_to_openai_tool(model: Type[BaseModel], *, name: Optional[str] = None, description: Optional[str] = None) ToolDescription[source]¶

Deprecated since version 0.1.16: Use langchain_core.utils.function_calling.convert_to_openai_tool() instead.

Converts a Pydantic model to a function description for the OpenAI API.

Parameters
  • model (Type[BaseModel]) – The Pydantic model to convert.

  • name (Optional[str]) – The name of the function. If not provided, the title of the schema will be used.

  • description (Optional[str]) – The description of the function. If not provided, the description of the schema will be used.

Returns

The tool description.

Return type

ToolDescription