pyrit.prompt_normalizer.PromptConverterConfiguration#

class PromptConverterConfiguration(converters: list[PromptConverter], indexes_to_apply: list[int] = None, prompt_data_types_to_apply: list[Literal['text', 'image_path', 'audio_path', 'video_path', 'url', 'error']] = None)[source]#

Bases: object

Represents the configuration for a prompt response converter.

The list of converters are applied to a response, which can have multiple response pieces. indexes_to_apply are which pieces to apply to. By default, all indexes are applied. prompt_data_types_to_apply are the types of the responses to apply the converters.

__init__(converters: list[PromptConverter], indexes_to_apply: list[int] = None, prompt_data_types_to_apply: list[Literal['text', 'image_path', 'audio_path', 'video_path', 'url', 'error']] = None) None#

Methods

__init__(converters[, indexes_to_apply, ...])

from_converters(*, converters)

Converts a list of converters into a list of PromptConverterConfiguration objects.

Attributes

converters: list[PromptConverter]#
classmethod from_converters(*, converters: List[PromptConverter]) List[PromptConverterConfiguration][source]#

Converts a list of converters into a list of PromptConverterConfiguration objects. Each converter gets its own configuration with default settings.

Parameters:

converters – List of PromptConverters

Returns:

List of configurations, one per converter

Return type:

List[PromptConverterConfiguration]

indexes_to_apply: list[int] = None#
prompt_data_types_to_apply: list[Literal['text', 'image_path', 'audio_path', 'video_path', 'url', 'error']] = None#