Chat Threads, ConversationAgent (WIP)

This commit is contained in:
Shivering Ocelot committed 2025-06-16 19:59:37 -05:00
1 parent 22fe5619d8
commit e8d80c5495
6 files changed
+519 -46

No files matched your search

+42
View File
@@ -89,3 +89,45 @@ class Message(Base):
# Tells whether this message continues in the chat after the session when it was sent.
persistent: Mapped[bool] = mapped_column(default=False)
thread_id: Mapped[Optional[int]] = mapped_column(ForeignKey("threads.id"))
# Represents a temporary topic or stage in a conversation
class Thread(Base):
__modelname__ = 'thread'
__tablename__ = 'threads'
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
chat_id: Mapped[int] = mapped_column(ForeignKey("chats.id"))
# Optional name and descriptions of the thread
name: Mapped[Optional[str]]
description: Mapped[Optional[str]]
# A persistent object or value associated with an agent
class AgentResource(Base):
__modelname__ = 'agent_resource'
__tablename__ = 'agent_resources'
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
agent_id: Mapped[int] = mapped_column(ForeignKey("agents.id"))
# Kind is the class of the resource
# Key is the specific identifier within the class
# Multiple resources can share key
kind: Mapped[str]
key: Mapped[str]
value = mapped_column(JSON, default=None)
# A log entry of an agent, the use and meaning depends on the agent class
class AgentLog(Base):
__modelname__ = 'agent_log'
__tablename__ = 'agent_logs'
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
agent_id: Mapped[int] = mapped_column(ForeignKey("agents.id"))
# Kind is the class of the resource
# Key is the specific identifier within the class
# Multiple resources can share key
value: Mapped[str]