pyrit.orchestrator.ScoringOrchestrator#
- class ScoringOrchestrator(batch_size: int = 10, verbose: bool = False)[source]#
Bases:
Orchestrator
This orchestrator scores prompts in a parallelizable and convenient way.
- __init__(batch_size: int = 10, verbose: bool = False) None [source]#
- Parameters:
batch_size (int, Optional) – The (max) batch size for sending prompts. Defaults to 10. Note: If using a scorer that takes a prompt target, and providing max requests per minute on the target, this should be set to 1 to ensure proper rate limit management.
Methods
__init__
([batch_size, verbose])dispose_db_engine
()Dispose database engine to release database connections and resources.
get_identifier
()get_memory
()Retrieves the memory associated with this orchestrator.
get_score_memory
()Retrieves the scores of the PromptRequestPieces associated with this orchestrator.
score_prompts_by_memory_labels_async
(*, scorer)Scores prompts using the Scorer for prompts based on the memory labels.
Scores prompts using the Scorer for prompts correlated to the orchestrator_ids.
score_prompts_by_request_id_async
(*, scorer, ...)Scores prompts using the Scorer for prompts with the prompt_ids
- async score_prompts_by_memory_labels_async(*, scorer: Scorer, memory_labels: dict[str, str] = {}, responses_only: bool = True) list[Score] [source]#
Scores prompts using the Scorer for prompts based on the memory labels.