early-window-29567
11/17/2025, 6:08 PMtall-airline-16756
11/17/2025, 6:08 PMtall-airline-16756
11/17/2025, 6:09 PMupdate_tools() method, which lets you modify an agent's available tools while it’s running.
For instance, if you want to remove a specific tool, you can filter it out from the tool list and then use update_tools() like this:
# Remove a tool named "temporary_tool" after another function has been called
remaining_tools = [tool for tool in agent.tools if get_function_info(tool).name != "temporary_tool"]
await agent.update_tools(remaining_tools)
This approach replaces the entire set of tools, so you have the flexibility to add or remove tools dynamically. You can do this during agent initialization or even at runtime, including from within other function tools.
If you have any questions or need a hand with the implementation, please feel free to ask—I’m here to help!
Sources: tool_calling/update_tools.py | livekit-plugins/livekit-plugins-ultravox/livekit/plugins/ultravox/realtime/... | Agent Session Management & Turn Detection | livekit/livekit_composite | Dee... | Tool definition and use | LiveKit docsearly-window-29567
11/17/2025, 6:11 PMtall-airline-16756
11/17/2025, 6:12 PMagent object is actually an instance of the Agent class in the LiveKit Python SDK. It represents your AI agent and gets initialized when you set up your agent in your application. You won’t need to import it directly because it’s created as part of that setup process.
For example, when you’re initializing an agent, it might look something like this:
from livekit.agents.voice.agent import Agent
agent = Agent(
instructions="Your agent instructions",
tools=[tool_a, tool_b],
chat_ctx=chat_context,
stt=stt_model,
tts=tts_model,
llm=llm_model
)
Once your agent is up and running, you can easily use methods like update_tools() to adjust its tools dynamically while your application is running. If anything feels unclear or if you’d like me to walk you through it more, just let me know—I’m here to help!
Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/real... | Agent Session Management & Turn Detection | livekit/livekit_composite | Dee... | Tool definition and use | LiveKit docsearly-window-29567
11/17/2025, 6:13 PMtall-airline-16756
11/17/2025, 6:14 PMupdate_tools() method is designed to work smoothly with any agent that inherits from the base Agent class in LiveKit. Could you please confirm if your ConciergeAgent is a custom class you’ve created? If it is, I’d love to understand a bit more:
• Does it extend livekit.agents.Agent or one of its subclasses?
• Are you working with a Realtime LLM (like OpenAI Realtime) or a standard LLM integration?
Knowing this will really help us figure out compatibility and the best next steps for you. I’m here to help!
Sources: Tool definition and use | LiveKit docs | Agent Session Management & Turn Detection | livekit/livekit_composite | Dee... | livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/real...early-window-29567
11/17/2025, 6:14 PMtall-airline-16756
11/17/2025, 6:15 PMAssistant class inherits from Agent, you’re all set to use self.update_tools() right within your custom agent class. This works because update_tools() is a method of the Agent class, so your Assistant class naturally has access to it through inheritance.
Here’s a little example of how you might call it inside your custom agent:
class Assistant(Agent):
async def some_method(self):
# Update tools dynamically
await self.update_tools(new_tools)
This way, you can dynamically update the tools your Assistant instance uses. If you have any more questions or need a hand with anything else, just let me know—I’m here to help!early-window-29567
11/17/2025, 6:21 PM# Get current tools
current_tools = list(self.tools)
# Remove any existing handler tool (dynamic send_template_data)
current_tools = [t for t in current_tools if getattr(t, '__name__', None) != "handler"]
# Add the new dynamic tool
current_tools.append(template_tool)
# Update the agent's tools
await self.update_tools(current_tools)tall-airline-16756
11/17/2025, 6:22 PMupdate_tools() method in LiveKit takes care of replacing the entire tool set with the new list you provide. It makes sure everything stays in sync with the backend, validates the tools, and keeps only the valid ones.
For instance, if you want to add or remove tools, you can simply do this:
# Add a new tool
await self.update_tools(self.tools + [new_tool])
# Remove a tool
await self.update_tools([t for t in self.tools if t != tool_to_remove])
This way, you don’t have to worry about manually filtering or appending tools because update_tools() handles all that for you behind the scenes. If you want me to explain anything further, just let me know—I’m happy to help!
Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/real... | Tool definition and use | LiveKit docs | Agent Session Management & Turn Detection | livekit/livekit_composite | Dee...