pyrit.models.SeedPromptGroup#

class SeedPromptGroup(*, prompts: Sequence[SeedPrompt] | Sequence[Dict[str, Any]])[source]#

Bases: YamlLoadable

A group of prompts that need to be sent together.

This class is useful when a target requires multiple (multimodal) prompt pieces to be grouped and sent together. All prompts in the group should share the same prompt_group_id.

__init__(*, prompts: Sequence[SeedPrompt] | Sequence[Dict[str, Any]])[source]#

Methods

__init__(*, prompts)

from_yaml_file(file)

Creates a new object from a YAML file.

is_single_request()

render_template_value(**kwargs)

Renders self.value as a template, applying provided parameters in kwargs

Attributes

is_single_request() bool[source]#
prompts: Sequence[SeedPrompt]#
render_template_value(**kwargs)[source]#

Renders self.value as a template, applying provided parameters in kwargs

Parameters:

kwargs – Key-value pairs to replace in the SeedPromptGroup value.

Returns:

None

Raises:

ValueError – If parameters are missing or invalid in the template.