cold-soccer-35030
05/12/2025, 12:36 PMtall-airline-16756
05/12/2025, 12:36 PMtall-airline-16756
05/12/2025, 12:36 PMMAX_TOOL_STEPS
parameter in the AgentSession
class defines the maximum number of consecutive tool calls that can be made per LLM turn. By default, this value is set to 3. When this limit is reached during tool execution, the system logs a warning message: "maximum number of function calls steps reached" and stops further tool execution for that turn.
This parameter is designed to prevent infinite loops or excessive tool usage by limiting how many consecutive tool operations can occur before requiring another interaction with the user.
Sources: Tree View: | dse-workbenchcold-soccer-35030
05/12/2025, 12:39 PMtall-airline-16756
05/12/2025, 12:39 PMmax_nested_fnc_calls
parameter. This parameter controls the maximum depth of nested function calls allowed. When the nested function depth reaches or exceeds the configured maximum depth, the function context is dropped, and additional function calls are prevented.
For your scenario, you can set max_nested_fnc_calls
to a lower value or even to 0 to completely disable nested function calls. This ensures that the agent will not call the function again while it is still running.
Sources: livekit.agents.pipeline.pipeline_agent API documentationcold-soccer-35030
05/12/2025, 12:40 PMtall-airline-16756
05/12/2025, 12:40 PMcold-soccer-35030
05/12/2025, 12:41 PMtall-airline-16756
05/12/2025, 12:41 PMmax_nested_fnc_calls
parameter is available in V1. It is part of the VoicePipelineAgent
class constructor and controls the maximum depth of nested function calls allowed. By default, its value is set to 1.
Sources: livekit.agents.pipeline API documentation