Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
959 changes: 959 additions & 0 deletions pyrit/memory/alembic/versions/e5f7a9c1b3d2_add_identifiers_tables.py

Large diffs are not rendered by default.

17 changes: 1 addition & 16 deletions pyrit/memory/azure_sql_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
PromptMemoryEntry,
)
from pyrit.memory.storage import AzureBlobStorageIO
from pyrit.models import ConversationStats, MessagePiece
from pyrit.models import ConversationStats

if TYPE_CHECKING:
from azure.core.credentials import AccessToken
Expand Down Expand Up @@ -685,21 +685,6 @@ def _get_scenario_result_label_condition(self, *, labels: dict[str, str]) -> Any
conditions.append(condition)
return and_(*conditions)

def _add_message_pieces_to_memory(self, *, message_pieces: Sequence[MessagePiece]) -> None:
"""
Persist already-validated message pieces to the Azure SQL store.

``not_in_memory`` pieces are ephemeral -- typically synthesized inside a
scorer to score arbitrary content that never came through a real
PromptTarget. They are filtered out upstream in
``add_message_pieces_to_memory`` before this method is called.

Args:
message_pieces (Sequence[MessagePiece]): Persistable pieces (filtered and
validated by ``add_message_pieces_to_memory``).
"""
self._insert_entries(entries=[PromptMemoryEntry(entry=piece) for piece in message_pieces])

def dispose_engine(self) -> None:
"""
Dispose the engine and clean up resources.
Expand Down
Loading
Loading