# PydanticFunctionsOutputParser

> **Class** in `langchain_google_vertexai`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-vertexai/functions_utils/PydanticFunctionsOutputParser)

Parse an output as a pydantic object.

This parser is used to parse the output of a chat model that uses Google Vertex
function format to invoke functions.

The parser extracts the function call invocation and matches them to the pydantic
schema provided.

An exception will be raised if the function call does not match the provided schema.

## Signature

```python
PydanticFunctionsOutputParser()
```

## Description

**Example:**

```python
message = AIMessage(
    content="This is a test message",
    additional_kwargs={
        "function_call": {
            "name": "cookie",
            "arguments": json.dumps({"name": "value", "age": 10}),
        }
    },
)
chat_generation = ChatGeneration(message=message)

class Cookie(BaseModel):
    name: str
    age: int

class Dog(BaseModel):
    species: str

# Full output
parser = PydanticOutputFunctionsParser(
    pydantic_schema={"cookie": Cookie, "dog": Dog}
)
result = parser.parse_result([chat_generation])
```

## Extends

- `BaseOutputParser`

## Properties

- `pydantic_schema`

## Methods

- [`parse_result()`](https://reference.langchain.com/python/langchain-google-vertexai/functions_utils/PydanticFunctionsOutputParser/parse_result)
- [`parse()`](https://reference.langchain.com/python/langchain-google-vertexai/functions_utils/PydanticFunctionsOutputParser/parse)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/a3f016b2a6c4af535df275545f76fa7424aa39e5/libs/vertexai/langchain_google_vertexai/functions_utils.py#L371)