Files
letta-server/letta/orm/tools_agents.py
Kian Jones b8e9a80d93 merge this (#4759)
* wait I forgot to comit locally

* cp the entire core directory and then rm the .git subdir
2025-09-17 15:47:40 -07:00

19 lines
700 B
Python

from sqlalchemy import ForeignKey, Index, String, UniqueConstraint
from sqlalchemy.orm import Mapped, mapped_column
from letta.orm import Base
class ToolsAgents(Base):
"""Agents can have one or many tools associated with them."""
__tablename__ = "tools_agents"
__table_args__ = (
UniqueConstraint("agent_id", "tool_id", name="unique_agent_tool"),
Index("ix_tools_agents_tool_id", "tool_id"),
)
# Each agent must have unique tool names
agent_id: Mapped[str] = mapped_column(String, ForeignKey("agents.id", ondelete="CASCADE"), primary_key=True)
tool_id: Mapped[str] = mapped_column(String, ForeignKey("tools.id", ondelete="CASCADE"), primary_key=True)