From 498852f6d2403bf28b92863dcc8c041f2aa89152 Mon Sep 17 00:00:00 2001 From: Novice Date: Tue, 20 May 2025 09:46:01 +0800 Subject: [PATCH] chore: increase agent max iteration to 10-99 --- api/core/agent/cot_agent_runner.py | 2 +- api/core/agent/fc_agent_runner.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/core/agent/cot_agent_runner.py b/api/core/agent/cot_agent_runner.py index 24a6c79582..1351b964e0 100644 --- a/api/core/agent/cot_agent_runner.py +++ b/api/core/agent/cot_agent_runner.py @@ -63,7 +63,7 @@ class CotAgentRunner(BaseAgentRunner, ABC): self._instruction = self._fill_in_inputs_from_external_data_tools(instruction, inputs) iteration_step = 1 - max_iteration_steps = max(app_config.agent.max_iteration if app_config.agent else 5, 5) + 1 + max_iteration_steps = min(max(app_config.agent.max_iteration, 10), 99) + 1 # convert tools into ModelRuntime Tool format tool_instances, prompt_messages_tools = self._init_prompt_tools() diff --git a/api/core/agent/fc_agent_runner.py b/api/core/agent/fc_agent_runner.py index 9368c409c8..be669c4a18 100644 --- a/api/core/agent/fc_agent_runner.py +++ b/api/core/agent/fc_agent_runner.py @@ -48,7 +48,7 @@ class FunctionCallAgentRunner(BaseAgentRunner): assert app_config.agent iteration_step = 1 - max_iteration_steps = max(app_config.agent.max_iteration, 5) + 1 + max_iteration_steps = min(max(app_config.agent.max_iteration, 10), 99) + 1 # continue to run until there is not any tool call function_call_state = True