Skip to content

Commit 0eb5364

Browse files
behnam-obehnamousat
andauthored
FEAT Persist component identifiers as normalized, content-addressed graphs (microsoft#2164)
Co-authored-by: behnamousat <behnamousat@microsoft.com>
1 parent 0ed915a commit 0eb5364

12 files changed

Lines changed: 3488 additions & 44 deletions

pyrit/memory/alembic/versions/e5f7a9c1b3d2_add_identifiers_tables.py

Lines changed: 959 additions & 0 deletions
Large diffs are not rendered by default.

pyrit/memory/azure_sql_memory.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
PromptMemoryEntry,
2828
)
2929
from pyrit.memory.storage import AzureBlobStorageIO
30-
from pyrit.models import ConversationStats, MessagePiece
30+
from pyrit.models import ConversationStats
3131

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

688-
def _add_message_pieces_to_memory(self, *, message_pieces: Sequence[MessagePiece]) -> None:
689-
"""
690-
Persist already-validated message pieces to the Azure SQL store.
691-
692-
``not_in_memory`` pieces are ephemeral -- typically synthesized inside a
693-
scorer to score arbitrary content that never came through a real
694-
PromptTarget. They are filtered out upstream in
695-
``add_message_pieces_to_memory`` before this method is called.
696-
697-
Args:
698-
message_pieces (Sequence[MessagePiece]): Persistable pieces (filtered and
699-
validated by ``add_message_pieces_to_memory``).
700-
"""
701-
self._insert_entries(entries=[PromptMemoryEntry(entry=piece) for piece in message_pieces])
702-
703688
def dispose_engine(self) -> None:
704689
"""
705690
Dispose the engine and clean up resources.

0 commit comments

Comments
 (0)