wooden-librarian-60399
09/11/2025, 4:12 AMtall-airline-16756
09/11/2025, 4:12 AMtall-airline-16756
09/11/2025, 4:13 AMNone
triggers an immediate subsequent tool call before the user speaks again. Here's how the system carefully handles tool call results, including `None`:
• If reply_required
is set to True
, the result is sent back to the LLM.
• If auto_tool_reply_generation
is enabled, the LLM may generate a reply automatically, but this doesn’t cause uncontrolled cascading tool calls.
• The system also enforces a maximum number of tool steps to prevent any infinite loops.
Tool outputs are collected and processed in order, ensuring everything stays well-controlled. Please feel free to share any more details or questions you have—I’m here to help and make sure everything is clear for you!
Sources: livekit-agents/livekit/agents/voice/generation.pywooden-librarian-60399
09/11/2025, 4:14 AMtall-airline-16756
09/11/2025, 4:15 AMTrue
, the system will schedule a task to send that tool call result back to the LLM so it can continue processing.
• auto_tool_reply_generation: Enabling this lets the LLM automatically create a reply based on the tool call result. Don’t worry—this won’t cause endless tool calls because the system has safeguards and limits in place to keep things running smoothly.
If you’re looking to set up or adjust these configurations, you’ll usually work with the agent’s tool call handling logic. Feel free to share the programming language or framework you’re using, and I’d be happy to provide some tailored code examples or guidance to help you along!wooden-librarian-60399
09/11/2025, 4:16 AMtall-airline-16756
09/11/2025, 4:17 AMTrue
if your tool returns a value. If you want to prevent a reply, you can design your tool to return None
or explicitly cancel the reply by using cancel_tool_reply()
within the function_tools_executed
event handler.
• auto_tool_reply_generation: This is a capability flag of the LLM that lets it automatically generate a reply after a tool call. It’s built into the model itself and can’t be changed through the API.
Here’s a friendly example to show you how to control tool reply behavior in Python:
# Define a tool that does not trigger a reply
@function_tool()
async def turn_on_light(self):
"""Called when user asks to turn on the light."""
self.light_on = True
# No return value prevents auto-reply
# Cancel a reply in the event handler
@session.on("function_tools_executed")
def on_function_tools_executed(ev: FunctionToolsExecutedEvent):
tools = (fnc.name for fnc in ev.function_calls)
if "turn_off_light" in tools:
# Explicitly cancel the reply for this tool
ev.cancel_tool_reply()
If anything isn’t clear or you’d like more examples, please don’t hesitate to ask—I’m here to help!wooden-librarian-60399
09/11/2025, 4:28 AMtall-airline-16756
09/11/2025, 4:29 AM# Configure the agent to allow only one tool call at a time
agent = LiveKitAgent(
parallel_tool_calls=False, # Disable parallel tool calls
max_tool_steps=1 # Limit to one tool call per turn
)
If you have any questions or would like me to walk you through more examples, just let me know—I’m here to help!
Sources: DeepSeek LLM integration guide | LiveKit Docs | Fireworks AI LLM integration guide | LiveKit Docs | Perplexity LLM integration guide | LiveKit Docs | examples/voice_agents/silent_function_call.py | Telnyx LLM integration guide | LiveKit Docswooden-librarian-60399
09/11/2025, 4:29 AMtall-airline-16756
09/11/2025, 4:30 AMTrue
, the agent can run tools concurrently, which can speed things up. On the other hand, setting it to False
means the tools will be called one after another, step by step.
• max_tool_steps: This one limits how many times the agent can call tools in a row within a single session or conversation turn. For example, if you set max_tool_steps=1
, the agent will only call one tool before giving you a response.
So, to sum it up, parallel_tool_calls is all about whether tool calls happen simultaneously, while max_tool_steps manages how many sequential tool calls can happen. If you’d like, I’m here to provide more examples or clarify anything further—just let me know!
Sources: livekit-plugins/livekit-plugins-anthropic/livekit/plugins/anthropic/llm.py | DeepSeek LLM integration guide | LiveKit Docs | Fireworks AI LLM integration guide | LiveKit Docs | Together AI LLM integration guide | LiveKit Docs | Telnyx LLM integration guide | LiveKit Docswooden-librarian-60399
09/11/2025, 4:31 AMtall-airline-16756
09/11/2025, 4:32 AMparallel_tool_calls
parameter to False
. This way, the LLM will make just one tool call at a time, even if multiple tools could be used.
Here’s a friendly example in Python to guide you:
from livekit.plugins import openai
session = AgentSession(
llm=openai.LLM.with_x_ai(
model="grok-2-public",
temperature=1.0,
parallel_tool_calls=False, # This makes sure only one tool call happens per completion
),
# ... tts, stt, vad, etc.
)
If you’re working with JavaScript or TypeScript, here’s how you can set up the LLMOptions
object:
const llm = new LLM({
model: 'gpt-4.1',
parallelToolCalls: false, // This limits tool calls to one per completion
});
Please feel free to reach out if you’d like me to walk you through more examples or if there’s anything else I can help with!
Sources: plugins/test/src/llm.ts | tests/test_llm.py | xAI LLM integration guide | LiveKit Docs | Together AI LLM integration guide | LiveKit Docs | Perplexity LLM integration guide | LiveKit Docswooden-librarian-60399
09/11/2025, 4:41 AMtall-airline-16756
09/11/2025, 4:41 AMparallel_tool_calls
parameter is actually available only in the chat()
function, not during initialization. So, if you’d like to disable parallel tool calls, you just need to set parallel_tool_calls=False
when you call the chat()
method.
Here’s a little example to make it clearer:
# Disable parallel tool calls during a chat session
response = gemini_llm.chat(
chat_ctx=chat_context,
tools=tools,
parallel_tool_calls=False # Ensures only one tool call per completion
)
If you have any questions or want me to walk you through more examples, please don’t hesitate to ask—I’m here to help!
Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime... | plugins/openai/src/llm.ts | xAI LLM integration guide | LiveKit Docstall-airline-16756
09/11/2025, 4:41 AMparallel_tool_calls
parameter isn’t available during initialization or in the chat()
function. I know this is a bit different from other integrations like Anthropic or xAI, where you can disable parallel tool calls via the API. Unfortunately, the Gemini plugin doesn’t support that just yet.
If you’d like, I’m here to help you explore other options or answer any questions you might have—just let me know!wooden-librarian-60399
09/11/2025, 5:02 AMtall-airline-16756
09/11/2025, 5:03 AMNone
. The system is thoughtfully designed to handle tool outputs one at a time to keep things running smoothly and predictably. However, if you're experiencing this behavior, it might be helpful to take a closer look at your specific setup or configuration.
Please feel free to share any additional details or examples you have—I’m here to help and would be happy to assist you further!wooden-librarian-60399
09/11/2025, 5:11 AMtall-airline-16756
09/11/2025, 5:12 AMresume_false_interruption
is enabled, the agent can smoothly pick up its speech again.
• user_away_timeout: This one keeps an eye on user inactivity by monitoring silence from both the user and the agent. When this timeout is reached (default: 15.0 seconds), the system marks the user as "away" and triggers a user_state_changed
event.
Please feel free to reach out if you'd like me to walk you through any part of this or provide some examples—I’m here to help!
Sources: tests/test_agent_session.py | Events and error handling | LiveKit Docstall-airline-16756
09/11/2025, 5:12 AMresume_false_interruption
enabled, the agent will pick up speaking again.
• user_away_timeout: This parameter watches for user inactivity by keeping an ear out for silence from both the user and the agent. If this timeout passes (default is 15.0 seconds), the system marks the user as "away" and triggers a user_state_changed
event.
If anything’s unclear or you’d like me to walk you through some examples, just let me know—I’m here to help!