Output transformer config
Defines the output transformer config schema.
Key
Defines valid keys in output transformer config.
OutputTransformerConfig
Bases: BaseModel
Defines the output transformer config schema.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
OutputTransformerType
|
The type of output transformer to use. |
kwargs |
dict[str, Any]
|
The additional keyword arguments for the output transformer. |
build()
Build an output transformer from the config.
Returns:
| Name | Type | Description |
|---|---|---|
BaseOutputTransformer |
BaseOutputTransformer
|
The output transformer. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the output transformer type is invalid. |
event_filter(event_types)
classmethod
Create an event filter output transformer config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_types
|
list[str]
|
Base event types to keep. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
OutputTransformerConfig |
'OutputTransformerConfig'
|
The event filter output transformer config. |
from_config(config)
classmethod
Create an output transformer config from a string or a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
OutputTransformer
|
The output transformer config, can be one of the following: 1. str: The type of the output transformer 2. dict[str, Any]: The output transformer config as a dictionary 3. OutputTransformerConfig: The output transformer config itself |
required |
Returns:
| Name | Type | Description |
|---|---|---|
OutputTransformerConfig |
'OutputTransformerConfig'
|
A new output transformer config. |
Raises:
| Type | Description |
|---|---|
ValueError
|
|
identity()
classmethod
Create an identity output transformer config.
Returns:
| Name | Type | Description |
|---|---|---|
OutputTransformerConfig |
'OutputTransformerConfig'
|
The identity output transformer config. |
json()
classmethod
Create a JSON output transformer config.
Returns:
| Name | Type | Description |
|---|---|---|
OutputTransformerConfig |
'OutputTransformerConfig'
|
The JSON output transformer config. |
think_tag()
classmethod
Create a think tag output transformer config.
Returns:
| Name | Type | Description |
|---|---|---|
OutputTransformerConfig |
'OutputTransformerConfig'
|
The think tag output transformer config. |