[fix] Collaboration Mode default_model_config_id error
This commit is contained in:
@@ -84,9 +84,9 @@ class MultiAgentConfigUpdate(BaseModel):
|
|||||||
"""更新多 Agent 配置"""
|
"""更新多 Agent 配置"""
|
||||||
master_agent_id: Optional[uuid.UUID] = None
|
master_agent_id: Optional[uuid.UUID] = None
|
||||||
master_agent_name: Optional[str] = Field(None, max_length=100, description="主 Agent 名称")
|
master_agent_name: Optional[str] = Field(None, max_length=100, description="主 Agent 名称")
|
||||||
default_model_config_id : uuid.UUID = Field(description="默认模型配置ID")
|
default_model_config_id: Optional[uuid.UUID] = Field(None, description="默认模型配置ID")
|
||||||
model_parameters: ModelParameters | None = Field(
|
model_parameters: Optional[ModelParameters] = Field(
|
||||||
default_factory=ModelParameters,
|
None,
|
||||||
description="模型参数配置(temperature、max_tokens 等)"
|
description="模型参数配置(temperature、max_tokens 等)"
|
||||||
)
|
)
|
||||||
orchestration_mode: Optional[str] = Field(
|
orchestration_mode: Optional[str] = Field(
|
||||||
|
|||||||
@@ -264,10 +264,11 @@ class MultiAgentService:
|
|||||||
if not app:
|
if not app:
|
||||||
raise ResourceNotFoundException("应用", str(app_id))
|
raise ResourceNotFoundException("应用", str(app_id))
|
||||||
|
|
||||||
# 2. 验证模型配置
|
# 2. 验证模型配置(如果提供了)
|
||||||
model_api_key = ModelApiKeyService.get_a_api_key(self.db,data.default_model_config_id)
|
if data.default_model_config_id:
|
||||||
if not model_api_key:
|
model_api_key = ModelApiKeyService.get_a_api_key(self.db, data.default_model_config_id)
|
||||||
raise ResourceNotFoundException("模型配置", str(data.default_model_config_id))
|
if not model_api_key:
|
||||||
|
raise ResourceNotFoundException("模型配置", str(data.default_model_config_id))
|
||||||
|
|
||||||
# 3. 验证子 Agent 存在并获取发布版本 ID
|
# 3. 验证子 Agent 存在并获取发布版本 ID
|
||||||
for sub_agent in data.sub_agents:
|
for sub_agent in data.sub_agents:
|
||||||
|
|||||||
Reference in New Issue
Block a user