Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: Fix cascade deletion (#1641)

Matthew Zhoubb0ea1844fa8
diff --git a/letta/orm/organization.py b/letta/orm/organization.py
index df0ea75e8..22edb215a 100644
--- a/letta/orm/organization.py
+++ b/letta/orm/organization.py
@@ -51,8 +51,10 @@ class Organization(SqlalchemyBase):
providers: Mapped[List["Provider"]] = relationship("Provider", back_populates="organization", cascade="all, delete-orphan")
identities: Mapped[List["Identity"]] = relationship("Identity", back_populates="organization", cascade="all, delete-orphan")
groups: Mapped[List["Group"]] = relationship("Group", back_populates="organization", cascade="all, delete-orphan")
- llm_batch_jobs: Mapped[List["Agent"]] = relationship("LLMBatchJob", back_populates="organization", cascade="all, delete-orphan")
- llm_batch_items: Mapped[List["Agent"]] = relationship("LLMBatchItem", back_populates="organization", cascade="all, delete-orphan")
+ llm_batch_jobs: Mapped[List["LLMBatchJob"]] = relationship("LLMBatchJob", back_populates="organization", cascade="all, delete-orphan")
+ llm_batch_items: Mapped[List["LLMBatchItem"]] = relationship(
+ "LLMBatchItem", back_populates="organization", cascade="all, delete-orphan"
+ )
@property
def passages(self) -> List[Union["SourcePassage", "AgentPassage"]]:
diff --git a/tests/integration_test_summarizer.py b/tests/integration_test_summarizer.py
index ff446b4d2..00e927332 100644
--- a/tests/integration_test_summarizer.py
+++ b/tests/integration_test_summarizer.py
@@ -9,14 +9,12 @@ import pytest
from letta import create_client
from letta.agent import Agent
from letta.client.client import LocalClient
-from letta.errors import ContextWindowExceededError
from letta.llm_api.helpers import calculate_summarizer_cutoff
from letta.schemas.embedding_config import EmbeddingConfig
from letta.schemas.enums import MessageRole
from letta.schemas.letta_message_content import TextContent
from letta.schemas.llm_config import LLMConfig
from letta.schemas.message import Message
-from letta.settings import summarizer_settings
from letta.streaming_interface import StreamingRefreshCLIInterface
from tests.helpers.endpoints_helper import EMBEDDING_CONFIG_PATH
from tests.helpers.utils import cleanup