From 081089a053decc2f825ead3767075a9579499a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Sun, 16 Nov 2025 20:11:46 +0800 Subject: [PATCH] general_agent --- fastapi_app.py | 6 +++--- utils/api_models.py | 2 +- utils/file_loaded_agent_manager.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fastapi_app.py b/fastapi_app.py index 05f9d1b..642fea8 100644 --- a/fastapi_app.py +++ b/fastapi_app.py @@ -1091,7 +1091,7 @@ async def create_agent_and_generate_response( raise HTTPException(status_code=500, detail="No response from agent") -def create_project_directory(dataset_ids: Optional[List[str]], bot_id: str, robot_type: str = "generic_agent") -> Optional[str]: +def create_project_directory(dataset_ids: Optional[List[str]], bot_id: str, robot_type: str = "general_agent") -> Optional[str]: """创建项目目录的公共逻辑""" # 只有当 robot_type == "catalog_agent" 且 dataset_ids 不为空时才创建目录 if robot_type != "catalog_agent" or not dataset_ids or len(dataset_ids) == 0: @@ -1186,7 +1186,7 @@ async def chat_completions_v2(request: ChatRequestV2, authorization: Optional[st project_dir = create_project_directory( bot_config.get("dataset_ids", []), bot_id, - bot_config.get("robot_type", "generic_agent") + bot_config.get("robot_type", "general_agent") ) # 处理消息 @@ -1204,7 +1204,7 @@ async def chat_completions_v2(request: ChatRequestV2, authorization: Optional[st language=request.language or bot_config.get("language", "ja"), system_prompt=bot_config.get("system_prompt"), mcp_settings=bot_config.get("mcp_settings", []), - robot_type=bot_config.get("robot_type", "generic_agent"), + robot_type=bot_config.get("robot_type", "general_agent"), project_dir=project_dir, generate_cfg={}, # v2接口不传递额外的generate_cfg user_identifier=request.user_identifier diff --git a/utils/api_models.py b/utils/api_models.py index 025ac1f..b733168 100644 --- a/utils/api_models.py +++ b/utils/api_models.py @@ -50,7 +50,7 @@ class ChatRequest(BaseModel): tool_response: Optional[bool] = False system_prompt: Optional[str] = None mcp_settings: Optional[List[Dict]] = None - robot_type: Optional[str] = "generic_agent" + robot_type: Optional[str] = "general_agent" user_identifier: Optional[str] = "" diff --git a/utils/file_loaded_agent_manager.py b/utils/file_loaded_agent_manager.py index a751af9..c34b92e 100644 --- a/utils/file_loaded_agent_manager.py +++ b/utils/file_loaded_agent_manager.py @@ -112,7 +112,7 @@ class FileLoadedAgentManager: language: Optional[str] = None, system_prompt: Optional[str] = None, mcp_settings: Optional[List[Dict]] = None, - robot_type: Optional[str] = "generic_agent", + robot_type: Optional[str] = "general_agent", user_identifier: Optional[str] = None) -> Assistant: """获取或创建文件预加载的助手实例