Update the chat memory :param chat: the chat to update :param memory: the chat memory to update :return: the updated chat
(
chat: Chat,
memory: ChatMemory,
)
| 9 | |
| 10 | |
| 11 | async def update_chat_memory( |
| 12 | chat: Chat, |
| 13 | memory: ChatMemory, |
| 14 | ) -> Chat: |
| 15 | """ |
| 16 | Update the chat memory |
| 17 | :param chat: the chat to update |
| 18 | :param memory: the chat memory to update |
| 19 | :return: the updated chat |
| 20 | """ |
| 21 | |
| 22 | chat = await chat_ops.update( |
| 23 | assistant_id=chat.assistant_id, |
| 24 | chat_id=chat.chat_id, |
| 25 | update_dict={"memory": memory.model_dump()}, |
| 26 | ) |
| 27 | |
| 28 | return chat |
| 29 | |
| 30 | |
| 31 | async def get_chat( |
no test coverage detected