* feat: add conversation_id parameter to context endpoint [LET-6989] Add optional conversation_id query parameter to retrieve_agent_context_window. When provided, the endpoint uses messages from the specific conversation instead of the agent's default message_ids. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta <noreply@letta.com> * chore: regenerate SDK after context endpoint update [LET-6989] 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta <noreply@letta.com> * feat: add isolated blocks support for conversations Allows conversations to have their own copies of specific memory blocks (e.g., todo_list) that override agent defaults, enabling conversation-specific state isolation. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta <noreply@letta.com> * undo * update apis * test * cleanup * fix tests * simplify * move override logic * patch --------- Co-authored-by: Letta <noreply@letta.com>
20 lines
916 B
Python
20 lines
916 B
Python
from sqlalchemy import ForeignKey, Index, String, UniqueConstraint
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from letta.orm.base import Base
|
|
|
|
|
|
class BlocksConversations(Base):
|
|
"""Tracks conversation-specific blocks that override agent defaults for isolated memory."""
|
|
|
|
__tablename__ = "blocks_conversations"
|
|
__table_args__ = (
|
|
UniqueConstraint("conversation_id", "block_label", name="unique_label_per_conversation"),
|
|
UniqueConstraint("conversation_id", "block_id", name="unique_conversation_block"),
|
|
Index("ix_blocks_conversations_block_id", "block_id"),
|
|
)
|
|
|
|
conversation_id: Mapped[str] = mapped_column(String, ForeignKey("conversations.id", ondelete="CASCADE"), primary_key=True)
|
|
block_id: Mapped[str] = mapped_column(String, ForeignKey("block.id", ondelete="CASCADE"), primary_key=True)
|
|
block_label: Mapped[str] = mapped_column(String, primary_key=True)
|