is it possible to require realtime llm to always d...
# ask-ai
b
is it possible to require realtime llm to always do a tool call during their turn? right now it doesn’t use the tool sometimes. but i want it to always do a tool call
t
Thanks for reaching out, Lawrence. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I see you want the realtime LLM to always perform a tool call instead of sometimes replying directly. Yes — set the model's
tool_choice
parameter to
"required"
. That forces the LLM to make a tool call every turn and prevents it from returning a normal message. Example (Python-style):
Copy code
llm = LLM(
    model="gpt-4o",
    tool_choice="required"
)
Or, when creating an Agent session:
Copy code
session = AgentSession(
    llm=openai.LLM.with_deepseek(
        model="deepseek-chat",
        tool_choice="required",
    ),
    # ...
)
If you want, tell me which model/plugin (OpenAI Realtime, DeepSeek, Groq, Anthropic, etc.) and how you’re configuring the agent (code snippet or config), and I’ll give exact code for that plugin. Sources: DeepSeek LLM plugin guide | LiveKit docs | Groq LLM plugin guide | LiveKit docs | Anthropic Claude LLM plugin guide | LiveKit docs | xAI LLM plugin guide | LiveKit docs | Azure OpenAI LLM plugin guide | LiveKit docs