ERROR livekit.agents - received a tool call with t...
# ask-ai
p
ERROR livekit.agents - received a tool call with tool_choice set to 'none', ignoring, how fix this?
t
Thanks for reaching out, harish. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! This error pops up because the
tool_choice
parameter is set to 'none', which basically turns off tool usage completely. So, any tool calls made while it's set to 'none' just get ignored and show up as errors. Here’s how you can fix it: 1. Double-check your
tool_choice
setting. If you want to use tools, switch it from 'none' to 'auto' or 'required'. 2. Make sure your agent logic isn’t trying to call tools when
tool_choice
is set to 'none'. 3. Turn on detailed logging (like
lk_oai_debug
) so you can see exactly what
tool_choice
and tool context are being sent to the LLM. 4. If you’re using specific integrations (like Anthropic, Google, AWS), double-check how they handle
tool_choice
in their API calls. And if you don’t need any tools at all, just make sure you’re not registering or calling any functions in your agent logic—that way, you won’t run into this error. Sources: Perplexity LLM integration guide | LiveKit Docs | DeepSeek LLM integration guide | LiveKit Docs | Amazon Bedrock LLM integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py | xAI LLM integration guide | LiveKit Docs
p
where to set it?
t
Here’s how you can set the
tool_choice
parameter: 1. When You Initialize the LLM: Just set
tool_choice
as you create the LLM instance. For example:
Copy code
from livekit.plugins import openai
llm = openai.LLM(tool_choice='required')
2. For Each Chat Request: You can override
tool_choice
on the fly in the
chat()
method:
stream = llm.chat(chat_ctx=chat_ctx, tool_choice='required')
3. Change It During Runtime for Realtime Models: Use
update_options()
to switch up
tool_choice
while a session is active:
realtime_llm.update_options(tool_choice='none')
4. At the Agent Level: Update
tool_choice
for voice agents like this:
agent_activity.update_options(tool_choice='auto')
If you want to dive deeper into any of these or need help with a specific setup, just let me know—I’m here to help! Sources: Groq LLM integration guide | LiveKit Docs | Cerebras LLM integration guide | LiveKit Docs | Telnyx LLM integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti...
p
ToolChoice = Union[NamedToolChoice, Literal["auto", "required", "none"]] what does these mean?
t
The
ToolChoice
parameter controls how the LLM interacts with tools. Here’s a quick rundown of what each option means: 1. 'auto': The LLM decides on its own whether to use tools based on your input. This is the default setting. 2. 'required': The LLM has to use at least one tool. If no tools are available, it might throw an error. 3. 'none': Tool usage is completely turned off. The LLM will respond without calling any tools. 4. NamedToolChoice: Lets you specify a particular tool to use. For example,
{"type": "function", "name": "get_weather"}
makes the LLM call the
get_weather
function. You can set these options when you initialize the LLM or change them on the fly for specific requests. If you want me to explain anything further or show some examples, just let me know—I’m here to help! Sources: xAI LLM integration guide | LiveKit Docs | Together AI LLM integration guide | LiveKit Docs | Telnyx LLM integration guide | LiveKit Docs | Fireworks AI LLM integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py
p
ERROR livekit.agents - received a tool call with tool_choice set to 'none', ignoring, how fix this?
t
Hey there! If you’re running into the
ERROR livekit.agents - received a tool call with tool_choice set to 'none'
, no worries—here’s a simple way to sort it out: 1. First, double-check your
tool_choice
setting. If you want to use tools, try switching it from 'none' to either 'auto' or 'required'. 2. Make sure your agent isn’t trying to call any tools when
tool_choice
is set to 'none'. That can cause this hiccup. 3. Turn on detailed logging (like
lk_oai_debug
) so you can see exactly what
tool_choice
and tool info are being sent to the LLM—it’s super helpful for troubleshooting. 4. If you’d rather keep tools off completely, just make sure no functions are registered or called in your agent’s logic to avoid this error popping up. If any of these steps feel tricky or you want me to walk you through a specific part, just give me a shout—I’m here to help!