Skip to content

Input transformer config

Defines the input transformer config schema.

InputTransformerConfig

Bases: BaseModel

Defines the input transformer config schema.

Attributes:

Name Type Description
type InputTransformerType

The type of input transformer to use.

kwargs dict[str, Any]

The additional keyword arguments for the output transformer.

build()

Build an input transformer from the config.

Returns:

Name Type Description
BaseInputTransformer BaseInputTransformer

The input transformer.

Raises:

Type Description
ValueError

If the input transformer type is invalid.

filter_empty() classmethod

Create a filter-empty input transformer config.

Returns:

Name Type Description
InputTransformerConfig 'InputTransformerConfig'

The filter-empty input transformer config.

from_config(config) classmethod

Create an input transformer config from a string or dictionary.

Parameters:

Name Type Description Default
config InputTransformer

The input transformer config, can be one of the following: 1. str: The type of the input transformer 2. dict[str, Any]: The input transformer config as a dictionary 3. InputTransformerConfig: The input transformer config itself

required

Returns:

Name Type Description
InputTransformerConfig 'InputTransformerConfig'

A new input transformer config.

Raises:

Type Description
ValueError

identity() classmethod

Create an identity input transformer config.

Returns:

Name Type Description
InputTransformerConfig 'InputTransformerConfig'

The identity input transformer config.

Key

Defines valid keys in input transformer config.