what is `chat_ctx` exactly? Am I right that under ...
# ask-ai
m
what is
chat_ctx
exactly? Am I right that under LiveKit Agent v1.0, we use all messages from
chat_ctx
to generate a response for the user?
t
Thanks for reaching out, Nikita. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The
chat_ctx
in LiveKit Agent v1.0 is a revamped API for managing chat history. It provides a unified interface that accounts for differences between stateless and stateful LLM APIs. The chat history in
chat_ctx
can include: • `ChatMessage`: Messages with roles (user, assistant) containing content like text, images, or audio. • `FunctionCall`: Function calls initiated by the LLM. • `FunctionCallOutput`: Results returned from function calls. Under LiveKit Agent v1.0, all messages from
chat_ctx
are indeed used to generate responses for the user. Additionally, the complete conversation history for a session is always accessible in
session.history
. Sources: Agents 0.x migration guide | LiveKit Docs | Workflows | LiveKit Docs