Skip to content

Commit 1f87589

Browse files
authored
Update models.py
1 parent 325c684 commit 1f87589

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎app/models.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,27 @@ class Secret(Base):
120120
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utcnow)
121121

122122

123+
class ConversationFile(Base):
124+
"""An uploaded file attached to a conversation.
125+
126+
Stored on disk inside the conversation's sandbox workspace so the
127+
agent can read it directly; ``path`` is the absolute location.
128+
"""
129+
130+
__tablename__ = "conversation_files"
131+
132+
id: Mapped[str] = mapped_column(String(40), primary_key=True)
133+
conversation_id: Mapped[str] = mapped_column(ForeignKey("conversations.id"), index=True)
134+
user_id: Mapped[str] = mapped_column(String(40), index=True)
135+
filename: Mapped[str] = mapped_column(String(255))
136+
stored_name: Mapped[str] = mapped_column(String(255))
137+
size: Mapped[int] = mapped_column(Integer, default=0)
138+
path: Mapped[str] = mapped_column(String(1024))
139+
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utcnow)
140+
141+
conversation: Mapped[Conversation] = relationship()
142+
143+
123144
class Sandbox(Base):
124145
"""Sandbox registry: one row per live (or recently live) sandbox.
125146

0 commit comments

Comments
 (0)