pyrit.prompt_target.TextTarget#
- class TextTarget(*, text_stream: ~typing.IO[str] = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]#
Bases:
PromptTargetThe 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])Target does not require cleanup.
dispose_db_engine()Dispose 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.
set_model_name(*, model_name)Set the model name for this target.
Attributes
- import_scores_from_csv(csv_file_path: Path) list[MessagePiece][source]#