@RunLLM What is the best way to save the session m...
# ask-ai
f
@RunLLM What is the best way to save the session messages after the call? that includes system, user, agent, and function tools
t
Thanks for reaching out, Muthana. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To save session messages, including system, user, agent, and function tool messages, you can use a
ChatContext
object. This object maintains a collection of items, such as messages and function calls, and allows for transferring chat history between agents. Here are the key steps: • Messages are stored in the
ChatContext
object, which can be copied and truncated as needed when switching agents. • System messages can be added to the context to provide relevant information, such as user data or agent roles. • Different message types (e.g., system, user, assistant, function calls) are converted into appropriate formats for processing. • Function tool calls are preserved in the chat context, ensuring all interactions are saved. If you need further details or examples, feel free to ask! Sources: Tree View: | dse-workbench | Tree View: | dse-workbench
f
@RunLLM Give me a code exampple
t
I'm sorry, but I don't have the information you need at the moment. If you would like a member of the LiveKit team to respond, please ask your question in one of the other channels.