diff --git a/agent/agent_config.py b/agent/agent_config.py index a24f5fe..86df410 100644 --- a/agent/agent_config.py +++ b/agent/agent_config.py @@ -85,6 +85,8 @@ class AgentConfig: robot_type = "deep_agent" preamble_text, system_prompt = get_preamble_text(request.language, request.system_prompt) + enable_thinking = request.enable_thinking and "```guideline" in request.system_prompt + config = cls( bot_id=request.bot_id, api_key=api_key, @@ -96,7 +98,7 @@ class AgentConfig: robot_type=robot_type, user_identifier=request.user_identifier, session_id=request.session_id, - enable_thinking=request.enable_thinking, + enable_thinking=enable_thinking, project_dir=project_dir, stream=request.stream, tool_response=request.tool_response, @@ -121,10 +123,10 @@ class AgentConfig: messages = [] language = request.language or bot_config.get("language", "zh") preamble_text, system_prompt = get_preamble_text(language, bot_config.get("system_prompt")) - robot_type = bot_config.get("robot_type", "general_agent") if robot_type == "catalog_agent": robot_type = "deep_agent" + enable_thinking = request.enable_thinking and "```guideline" in bot_config.get("system_prompt") config = cls( bot_id=request.bot_id, @@ -137,7 +139,7 @@ class AgentConfig: robot_type=robot_type, user_identifier=request.user_identifier, session_id=request.session_id, - enable_thinking=request.enable_thinking, + enable_thinking=enable_thinking, project_dir=project_dir, stream=request.stream, tool_response=request.tool_response,