IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python function

convert_max_config_value

convert_max_config_value()​

max.pipelines.lib.convert_max_config_value(config_class, value, field_type, field_name)

source

Converts a config value to the appropriate type.

Handles enums, Optional types, Union types, lists, and basic types.

Parameters:

  • config_class (type[MAXConfig]) – The MAXConfig class requesting the conversion (required for enum resolution).
  • value (Any) – The value from the configuration file.
  • field_type (Any) – The expected type of the field.
  • field_name (str) – The name of the field (for error messages).

Returns:

The converted value.

Raises:

ValueError – If the value cannot be converted.

Return type:

Any