Introduce message kinds, and handle them appropriately in user and agent chat

This commit is contained in:
Shivering Ocelot committed 2025-07-08 18:01:46 -05:00
1 parent cba41f1e7e
commit 396b06b05c
4 files changed
+89 -18

No files matched your search

+3 -2
View File
@@ -86,14 +86,15 @@ class ChatMixin:
print(f"Added agent #{agent_id} to chat #{chat_id}")
# If an integer is passed in sender, it is interpreted as an agent id
def send_chat_message(self, chat_id, content, sender='user', thread_id=None):
def send_chat_message(self, chat_id, content, sender='user', thread_id=None, kind=None, subkind=None, format=None):
with self.sql_session() as session:
message = db.Message()
message.chat_id = chat_id
message.time = int(datetime.now().timestamp())
message.last_edit = message.time
message.sender = sender
message.kind = 'text' # default kind
message.kind = kind or 'message'
message.subkind = subkind
message.content = content
message.thread_id = thread_id