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