# create_extraction_chain_pydantic

> **Function** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/chains/openai_tools/extraction/create_extraction_chain_pydantic)

Creates a chain that extracts information from a passage.

## Signature

```python
create_extraction_chain_pydantic(
    pydantic_schemas: list[type[BaseModel]] | type[BaseModel],
    llm: BaseLanguageModel,
    system_message: str = _EXTRACTION_TEMPLATE,
) -> Runnable
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `pydantic_schemas` | `list[type[BaseModel]] \| type[BaseModel]` | Yes | The schema of the entities to extract. |
| `llm` | `BaseLanguageModel` | Yes | The language model to use. |
| `system_message` | `str` | No | The system message to use for extraction. (default: `_EXTRACTION_TEMPLATE`) |

## Returns

`Runnable`

A runnable that extracts information from a passage.

## ⚠️ Deprecated

Deprecated since version 0.1.14. Use ChatModel.with_structured_output(...) instead. Will be removed in version 2.0.0. Available on chat models capable of tool calling. Note: `with_structured_output` does not currently support a list of pydantic schemas. See https://docs.langchain.com/oss/python/langchain/structured-output

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/42f8f79293cfb7589e5bc1d74a8ae4dfd0bf15e3/libs/langchain/langchain_classic/chains/openai_tools/extraction.py#L17)