icy-nightfall-64225
12/19/2025, 9:59 AMtall-airline-16756
12/19/2025, 9:59 AMtall-airline-16756
12/19/2025, 10:00 AMsession.interrupt() prevents an ongoing text message from being committed, and how to avoid committing text.
Short answer:
• session.interrupt() stops audio playback and does not commit an incomplete agent response to chat history. Any unspoken or partially generated response is discarded; only the portion actually spoken before the interruption may be committed.
• If you need explicit control (for session.say() calls with pre-supplied text), use add_to_chat_ctx=False to prevent that text from being added to chat history.
Follow-up question:
• Are you interrupting agent-generated speech (the agent composing a response) or calls to session.say() with a supplied text string? I can give exact code snippets for the scenario you use. Sources: Turns overview | LiveKit docs | Text and transcriptions | LiveKit docs | Agent speech and audio | LiveKit docsicy-nightfall-64225
12/19/2025, 10:01 AMtall-airline-16756
12/19/2025, 10:01 AMparallel_tool_calls=True or False?
• What are your max_tool_steps (if set)?
• A short example (logs or sequence) of the consecutive calls you observe.
With that I’ll explain why it’s happening and give exact settings or code changes to control the flow.
Sources: Anthropic Claude LLM plugin guide | LiveKit docs | Agent session | LiveKit docs | Agents (Node.js) | livekit/livekit_composite | DeepWikiicy-nightfall-64225
12/19/2025, 10:02 AMparallel_tool_calls=True or max_tool_steps are set?tall-airline-16756
12/19/2025, 10:02 AMparallel_tool_calls and max_tool_steps. Quick answer and examples:
• parallel_tool_calls is passed to the LLM constructor (controls whether multiple tool calls can be emitted/executed in a single LLM turn).
• max_tool_steps is passed to the AgentSession constructor (limits consecutive tool-call turns the agent can take).
Example (Python):
session = AgentSession(
llm=openai.LLM(
model="your-model",
parallel_tool_calls=True, # or False to serialize tool calls
),
max_tool_steps=3, # max consecutive tool-call turns before producing a response
# ... tts, stt, tools, etc.
)
If you want to stop the agent from chaining many tool calls, set parallel_tool_calls=False and lower max_tool_steps (e.g., 1–3). Would you like a snippet for your specific LLM plugin or an example showing tool definitions and a sample run?
Sources: Cerebras LLM plugin guide | LiveKit docs | Agent session | LiveKit docs | Anthropic Claude LLM plugin guide | LiveKit docs | Groq LLM plugin guide | LiveKit docsicy-nightfall-64225
12/19/2025, 10:03 AMopenai.realtime.RealtimeModel optiontall-airline-16756
12/19/2025, 10:04 AMparallel_tool_calls and max_tool_steps are not options on openai.realtime.RealtimeModel. Those controls live in the LiveKit Agent SDK configuration, not on the underlying realtime model wrapper.
Quick summary and guidance:
• Set parallel_tool_calls on the LLM wrapper you pass into the AgentSession (e.g., openai.LLM(...)), not on openai.realtime.RealtimeModel.
• Set max_tool_steps on the AgentSession itself.
Example (Python) showing the separation:
from livekit_agents import AgentSession
from livekit_agents.llms import openai
session = AgentSession(
llm=openai.LLM(
model="gpt-4o",
parallel_tool_calls=False, # set here, on the LLM wrapper
),
max_tool_steps=2, # set here, on AgentSession
# other session options...
)
If you’re using a realtime model instance for streaming audio (e.g., openai.realtime.RealtimeModel) keep using it for streaming/connection, but wrap/configure the LLM via the LiveKit LLM classes shown above. Would you like a concrete snippet showing how to combine RealtimeModel for streaming with the AgentSession LLM wrapper in your codebase?