> ## Documentation Index
> Fetch the complete documentation index at: https://www.getmaxim.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GenerationParser

> Generation Parser functionality for Parsers integration.

[View module source on GitHub](https://github.com/maximhq/maxim-py/blob/main/maxim/logger/parsers/generation_parser.py)

#### parse\_function\_call

```python theme={null}
def parse_function_call(function_call_data)
```

Parse function call from a dictionary.

**Arguments**:

| Name                 | Description              |
| -------------------- | ------------------------ |
| `function_call_data` | The dictionary to parse. |

**Returns**:

The parsed function call.

#### parse\_tool\_calls

```python theme={null}
def parse_tool_calls(tool_calls_data)
```

Parse tool calls from a dictionary.

**Arguments**:

| Name              | Description              |
| ----------------- | ------------------------ |
| `tool_calls_data` | The dictionary to parse. |

**Returns**:

The parsed tool calls.

#### parse\_content\_list

```python theme={null}
def parse_content_list(content_list_data)
```

Parse content list from a dictionary.

**Arguments**:

| Name                | Description              |
| ------------------- | ------------------------ |
| `content_list_data` | The dictionary to parse. |

**Returns**:

The parsed content list.

#### parse\_chat\_completion\_choice

```python theme={null}
def parse_chat_completion_choice(messages_data)
```

Parse chat completion choice from a dictionary.

**Arguments**:

| Name            | Description              |
| --------------- | ------------------------ |
| `messages_data` | The dictionary to parse. |

**Returns**:

The parsed chat completion choice.

#### parse\_choice

```python theme={null}
def parse_choice(choice_data)
```

Parse choice from a dictionary.

**Arguments**:

| Name          | Description              |
| ------------- | ------------------------ |
| `choice_data` | The dictionary to parse. |

**Returns**:

The parsed choice.

#### parse\_usage

```python theme={null}
def parse_usage(usage_data)
```

Parse usage from a dictionary.

**Arguments**:

| Name         | Description              |
| ------------ | ------------------------ |
| `usage_data` | The dictionary to parse. |

**Returns**:

The parsed usage.

#### parse\_generation\_error

```python theme={null}
def parse_generation_error(error_data)
```

Parse generation error from a dictionary.

**Arguments**:

| Name         | Description              |
| ------------ | ------------------------ |
| `error_data` | The dictionary to parse. |

**Returns**:

The parsed generation error.

#### default\_json\_serializer

```python theme={null}
def default_json_serializer(o: Any) -> Any
```

Default JSON serializer for objects.

**Arguments**:

| Name | Description              |
| ---- | ------------------------ |
| `o`  | The object to serialize. |

**Returns**:

The serialized object.

#### parse\_result

```python theme={null}
def parse_result(data: Any) -> Dict[str, Any]
```

Parse result from a dictionary.

**Arguments**:

| Name   | Description              |
| ------ | ------------------------ |
| `data` | The dictionary to parse. |

**Returns**:

The parsed result.

#### parse\_message

```python theme={null}
def parse_message(message: Any) -> Any
```

Parse message from a dictionary.

**Arguments**:

| Name      | Description              |
| --------- | ------------------------ |
| `message` | The dictionary to parse. |

**Returns**:

The parsed message.

#### parse\_messages

```python theme={null}
def parse_messages(messages: List[Any]) -> List[Any]
```

Parse messages from a list.

**Arguments**:

| Name       | Description        |
| ---------- | ------------------ |
| `messages` | The list to parse. |

**Returns**:

The parsed messages.

#### parse\_model\_parameters

```python theme={null}
def parse_model_parameters(
        parameters: Optional[Dict[str, Any]]) -> Dict[str, Any]
```

Parse model parameters from a dictionary.

**Arguments**:

| Name         | Description              |
| ------------ | ------------------------ |
| `parameters` | The dictionary to parse. |

**Returns**:

The parsed model parameters.
