Conversation messages refactor add msg ids (#500)

* update ConversationMessage in protocal.py

* updated ConversationMessage instantiations in tasks.py and util.py to include message_id and frontend_message_id

* changed message_id and frontend_message_id to type UUID

* update ConversationMessage instantiation in main.py to include message_id and frontend_message_id"

* changed frontend_message_id to type str

* ran precomit
This commit is contained in:
Daniel Hug
2023-01-07 19:16:32 +01:00
committed by GitHub
parent 8e03e87367
commit f75a07301b
4 changed files with 29 additions and 5 deletions
+5 -2
View File
@@ -136,9 +136,12 @@ if settings.DEBUG_USE_SEED_DATA:
conversation = protocol_schema.Conversation(
messages=[
protocol_schema.ConversationMessage(
text=msg.text, is_assistant=msg.role == "assistant"
text=cmsg.text,
is_assistant=cmsg.role == "assistant",
message_id=cmsg.id,
fronend_message_id=cmsg.frontend_message_id,
)
for msg in conversation_messages
for cmsg in conversation_messages
]
)
task = pr.store_task(