general_agent
This commit is contained in:
parent
9b9d81a098
commit
081089a053
@ -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
|
||||
|
||||
@ -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] = ""
|
||||
|
||||
|
||||
|
||||
@ -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:
|
||||
"""获取或创建文件预加载的助手实例
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user