miniature-nail-35141
10/27/2025, 5:47 AMtall-airline-16756
10/27/2025, 5:47 AMtall-airline-16756
10/27/2025, 5:49 AMgenerate_reply(tool_choice=), you can specify the tool_choice parameter to guide how the LLM uses tools. Here are some friendly examples to get you started:
• Auto Mode: This lets the LLM decide if a tool is needed based on the context.
await session.generate_reply(user_input="What's the weather like?", tool_choice="auto")
• Required Mode: This makes sure the LLM uses at least one function tool.
await session.generate_reply(user_input="Tell me about New York", tool_choice="required")
• None Mode: This turns off tool usage, so the LLM responds directly.
await session.generate_reply(user_input="What's the weather in Paris?", tool_choice="none")
• Specific Tool: This directs the LLM to use a particular tool.
await session.generate_reply(user_input="I want to know about the weather", tool_choice=ToolChoice(type="function", name="get_weather"))
If you have any questions or want me to walk you through more examples, just let me know—I’m here to help!
Sources: OpenAI LLM plugin guide | LiveKit Docs | Azure OpenAI LLM plugin guide | LiveKit Docs | livekit-agents/livekit/agents/voice/agent_activity.pyminiature-nail-35141
10/27/2025, 7:37 AMtall-airline-16756
10/27/2025, 7:38 AMToolChoice like this:
• In Python:
from livekit.agents.llm import ToolChoice
• In JavaScript:
import { ToolChoice } from 'livekit-agents';
If you have any questions or need a hand with anything else, just let me know—I’m here to help!
Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti... | plugins/google/src/llm.ts | OpenAI LLM plugin guide | LiveKit Docs