pyrit.prompt_converter.TenseConverter#
- class TenseConverter(*, converter_target: PromptChatTarget, tense: str, prompt_template: SeedPrompt = None)[source]#
Bases:
LLMGenericTextConverter
- __init__(*, converter_target: PromptChatTarget, tense: str, prompt_template: SeedPrompt = None)[source]#
Converts a conversation to a different tense
- Parameters:
converter_target (PromptChatTarget) – The target chat support for the conversion which will translate
tone (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.
- Raises:
ValueError – If the language is not provided.
Methods
__init__
(*, converter_target, tense[, ...])Converts a conversation to a different tense
convert_async
(*, prompt[, input_type])Convert a prompt based on the prompt template
convert_tokens_async
(*, prompt[, ...])Converts substrings within a prompt that are enclosed by specified start and end tokens.
get_identifier
()input_supported
(input_type)Checks if the input type is supported by the converter