pyrit.orchestrator.AnecdoctorOrchestrator#

class AnecdoctorOrchestrator(*, chat_model_under_evaluation: PromptChatTarget, use_knowledge_graph: bool = False, processing_model: PromptChatTarget | None = None, evaluation_data: list[str], language: str = 'english', content_type: str = 'viral tweet', prompt_converters: List[PromptConverter] | None = None, verbose: bool = False)[source]#

Bases: Orchestrator

Anecdoctor Orchestrator class is responsible for:
  1. (Optionally) extracting a knowledge graph if use_knowledge_graph=True.

  2. Constructing and evaluating prompts based on data in ClaimsReview format.

__init__(*, chat_model_under_evaluation: PromptChatTarget, use_knowledge_graph: bool = False, processing_model: PromptChatTarget | None = None, evaluation_data: list[str], language: str = 'english', content_type: str = 'viral tweet', prompt_converters: List[PromptConverter] | None = None, verbose: bool = False) None[source]#

Initializes an AnecdoctorOrchestrator object.

Parameters:
  • chat_model_under_evaluation (PromptChatTarget) – The chat model to be used or evaluated.

  • use_knowledge_graph (bool) – Whether to run the knowledge-graph-extraction step.

  • processing_model (PromptChatTarget, optional) – The model used for the graph extraction.

  • evaluation_data (List[str]) – The data to be used in constructing the prompt.

  • language (str) – The language of the content. Defaults to “english”.

  • content_type (str) – The type of content to generate. Defaults to “viral tweet”.

  • prompt_converters (List[PromptConverter], Optional) – The prompt converters to be used.

  • verbose (bool, Optional) – Whether to print verbose output. Defaults to False.

Methods

__init__(*, chat_model_under_evaluation[, ...])

Initializes an AnecdoctorOrchestrator object.

dispose_db_engine()

Dispose database engine to release database connections and resources.

generate_attack()

Runs the orchestrator, possibly extracting a knowledge graph first, then generating the final content.

get_identifier()

get_memory()

Retrieves the memory associated with this orchestrator.

get_score_memory()

Retrieves the scores of the PromptRequestPieces associated with this orchestrator.

async generate_attack() str[source]#

Runs the orchestrator, possibly extracting a knowledge graph first, then generating the final content. Returns the final model output (answer).