pyrit.prompt_target.CrucibleTarget#

class CrucibleTarget(*, endpoint: str, api_key: str | None = None, max_requests_per_minute: int | None = None)[source]#

Bases: PromptTarget

__init__(*, endpoint: str, api_key: str | None = None, max_requests_per_minute: int | None = None) None[source]#

Initialize the Crucible target.

Parameters:
  • endpoint (str) – The endpoint URL for the Crucible service.

  • api_key (str, Optional) – The API key for accessing the Crucible service. Defaults to the CRUCIBLE_API_KEY environment variable.

  • max_requests_per_minute (int, Optional) – Number of requests the target can handle per minute before hitting a rate limit. The number of requests sent to the target will be capped at the value provided.

Methods

__init__(*, endpoint[, api_key, ...])

Initialize the Crucible target.

dispose_db_engine()

Dispose database engine to release database connections and resources.

get_identifier()

send_prompt_async(**kwargs)

Sends a normalized prompt async to the prompt target.

set_model_name(*, model_name)

Set the model name for this target.

Attributes

API_KEY_ENVIRONMENT_VARIABLE

supported_converters

API_KEY_ENVIRONMENT_VARIABLE: str = 'CRUCIBLE_API_KEY'#
async send_prompt_async(**kwargs)#

Sends a normalized prompt async to the prompt target.