pyrit.prompt_target.TextTarget#

class TextTarget(*, text_stream: ~typing.IO[str] = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]#

Bases: PromptTarget

The TextTarget takes prompts, adds them to memory and writes them to io which is sys.stdout by default

This can be useful in various situations, for example, if operators want to generate prompts but enter them manually.

__init__(*, text_stream: ~typing.IO[str] = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) None[source]#

Methods

__init__(*[, text_stream])

dispose_db_engine()

Dispose DuckDB database engine to release database connections and resources.

get_identifier()

import_scores_from_csv(csv_file_path)

send_prompt_async(*, prompt_request)

Sends a normalized prompt async to the prompt target.

Attributes

supported_converters

import_scores_from_csv(csv_file_path: Path) list[PromptRequestPiece][source]#
async send_prompt_async(*, prompt_request: PromptRequestResponse) PromptRequestResponse[source]#

Sends a normalized prompt async to the prompt target.