pyrit.models.PromptRequestResponse#

class PromptRequestResponse(request_pieces: Sequence[PromptRequestPiece])[source]#

Bases: object

Represents a response to a prompt request.

This is a single request to a target. It can contain multiple prompt request pieces.

Parameters:

request_pieces (Sequence[PromptRequestPiece]) – The list of prompt request pieces.

__init__(request_pieces: Sequence[PromptRequestPiece])[source]#

Methods

__init__(request_pieces)

flatten_to_prompt_request_pieces(...)

get_value([n])

Return the converted value of the nth request piece.

get_values()

Return the converted values of all request pieces.

validate()

Validates the request response.

static flatten_to_prompt_request_pieces(request_responses: Sequence[PromptRequestResponse]) MutableSequence[PromptRequestPiece][source]#
get_value(n: int = 0) str[source]#

Return the converted value of the nth request piece.

get_values() list[str][source]#

Return the converted values of all request pieces.

validate()[source]#

Validates the request response.