# get_openai_output_parser

> **Function** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/chains/structured_output/base/get_openai_output_parser)

Get the appropriate function output parser given the user functions.

## Signature

```python
get_openai_output_parser(
    functions: Sequence[dict[str, Any] | type[BaseModel] | Callable],
) -> BaseOutputParser | BaseGenerationOutputParser
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `functions` | `Sequence[dict[str, Any] \| type[BaseModel] \| Callable]` | Yes | Sequence where element is a dictionary, a pydantic.BaseModel class, or a Python function. If a dictionary is passed in, it is assumed to already be a valid OpenAI function. |

## Returns

`BaseOutputParser | BaseGenerationOutputParser`

A PydanticOutputFunctionsParser if functions are Pydantic classes, otherwise
a JsonOutputFunctionsParser. If there's only one function and it is
not a Pydantic class, then the output parser will automatically extract
only the function arguments and not the function name.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/f0c5a28fa05adcda89aebcb449d897245ab21fa4/libs/langchain/langchain_classic/chains/structured_output/base.py#L493)