i have used session say in tool call to provide a ...
# ask-ai
w
i have used session say in tool call to provide a confirmation to user and returned what to do next but llm is itself generating a confirmation as well, how to stop that and i want llm to proceed directly to next steps
t
Thanks for reaching out, Test. 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 prevent the LLM from generating a confirmation after using
session.say
in a tool call, so it can move smoothly to the next steps. Here are some friendly methods you can try: • Return No Value from the Tool Function: Simply not returning a value from your tool function will keep the LLM from giving a verbal response. It’s an easy way to run a tool quietly. • Cancel Tool Reply: You can use
ev.cancel_tool_reply()
inside the
function_tools_executed
event. This is especially handy when you have multiple tools running at the same time and want to avoid extra replies. • Interrupt or Skip Generation: By raising
StopResponse()
in the
on_user_turn_completed
hook, you can stop the response generation altogether. • Custom LLM Node: If you want more control, you can override the
llm_node
to detect tool calls and either suppress or tailor the agent’s verbal output. • Defer Response: For Realtime API-based models, setting
defer_response=True
helps prevent automatic replies during interruptions. If you’d like, I’m happy to walk you through detailed examples or assist you further with any of these approaches. Just let me know! Sources: Pipeline nodes and hooks | LiveKit Docs | agent.py | livekit-plugins/livekit-plugins-ultravox/livekit/plugins/ultravox/realtime/...