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])

cleanup_target()

Target does not require cleanup.

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

async cleanup_target()[source]#

Target does not require cleanup.

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.

supported_converters: list#