🔧 fix(schemas.py): add optional chatKey field to ChatMessage schema to support additional metadata for chat messages
🔧 fix(manager.py): add support for chatKey field in ChatService to store additional metadata for chat messages
This commit is contained in:
parent
1b5b36a96d
commit
89880b14a0
2 changed files with 3 additions and 1 deletions
|
|
@ -78,6 +78,7 @@ class ChatMessage(BaseModel):
|
|||
|
||||
is_bot: bool = False
|
||||
message: Union[str, None, dict] = None
|
||||
chatKey: Optional[str] = None
|
||||
type: str = "human"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,8 @@ class ChatService(Service):
|
|||
):
|
||||
# Process the graph data and chat message
|
||||
chat_inputs = payload.pop("inputs", {})
|
||||
chat_inputs = ChatMessage(message=chat_inputs)
|
||||
chatkey = payload.pop("chatKey", None)
|
||||
chat_inputs = ChatMessage(message=chat_inputs, chatKey=chatkey)
|
||||
self.chat_history.add_message(client_id, chat_inputs)
|
||||
|
||||
# graph_data = payload
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue