proud-lawyer-39815
09/15/2025, 8:18 PMtall-airline-16756
09/15/2025, 8:18 PMtall-airline-16756
09/15/2025, 8:20 PMfunction_tool() as a function to generate tools whose descriptions depend on the state, like user roles or session information.
• Update Tools at Runtime: The agent.update_tools() method allows you to swap out the active tools for new ones that reflect real-time changes in their descriptions.
• Add Temporary Tools: By modifying the tools list dynamically inside the llm_node() method, you can add tools with context-specific descriptions just for a single LLM call.
If you'd like to see these ideas in action, I highly recommend checking out the dynamic_tool_creation.py example. It walks through these patterns in detail and can be a great resource.
Sources: Tool definition and use | LiveKit Docs | Tool definition and use | LiveKit Docs | livekit-agents/livekit/agents/llm/utils.py | Tool definition and use | LiveKit Docs | livekit-agents/livekit/agents/llm/utils.py