how can i get context, list of tools, called tools...
# ask-ai
n
how can i get context, list of tools, called tools and tool results for every LLM response
t
Thanks for reaching out, Kaster. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm here to help you easily access the context, list of tools, called tools, and tool results for every LLM response in LiveKit. Here's a friendly guide to get you started: • Context: You can use the
chat_ctx
property in the agent session or model to see the full conversation history, including all tool calls and their results. This way, you won’t miss any important details! • List of Tools: Tools are managed through the
update_tools()
method. Simply provide a list of tools, and they’ll be ready for you to select during response generation. • Called Tools: These show up in
ChatChunk
objects or as
function_call
items inside the
ChatContext
. It’s a great way to keep track of what’s been used. • Tool Results: You’ll find these captured as
function_call_output
items within the
ChatContext
. Plus, you can easily process them using the
get_tool_results_for_realtime()
function. If you want to dive deeper or need more examples, feel free to check out the Tool definition and use documentation. I’m confident it’ll be really helpful! Sources: livekit-agents/livekit/agents/voice/agent_activity.py | Docs::Agents | Tool definition and use | LiveKit Docs