pyrit.prompt_converter.TenseConverter#
- class TenseConverter(*, converter_target: PromptChatTarget = REQUIRED_VALUE, tense: str, prompt_template: SeedPrompt | None = None)[source]#
Bases:
LLMGenericTextConverterConverts a conversation to a different tense using an LLM.
An existing
PromptChatTargetis used to perform the conversion (like Azure OpenAI).- __init__(*, converter_target: PromptChatTarget = REQUIRED_VALUE, tense: str, prompt_template: SeedPrompt | None = None)[source]#
Initialize the converter with the target chat support, tense, and optional prompt template.
- Parameters:
converter_target (PromptChatTarget) – The target chat support for the conversion which will translate. Can be omitted if a default has been configured via PyRIT initialization.
tense (str) – The tense the converter should convert the prompt to. E.g. past, present, future.
prompt_template (SeedPrompt, Optional) – The prompt template for the conversion.
Methods
__init__(*[, converter_target, prompt_template])Initialize the converter with the target chat support, tense, and optional prompt template.
convert_async(*, prompt[, input_type])Convert the given prompt using an LLM via the specified converter target.
convert_tokens_async(*, prompt[, ...])Convert substrings within a prompt that are enclosed by specified start and end tokens.
get_identifier()Return an identifier dictionary for the converter.
input_supported(input_type)Check if the input type is supported by the converter.
output_supported(output_type)Check if the output type is supported by the converter.
Attributes
SUPPORTED_INPUT_TYPESTuple of input modalities supported by this converter.
SUPPORTED_OUTPUT_TYPESTuple of output modalities supported by this converter.
supported_input_typesReturns a list of supported input types for the converter.
supported_output_typesReturns a list of supported output types for the converter.