fix(canvas): 画布智能体 - 严格校验模型选择并修正任务与 DNS 错误诊断

This commit is contained in:
ddCat
2026-09-20 12:47:07 +08:00
parent 46c498ff87
commit be5f2733b6
17 changed files with 407 additions and 13 deletions

View File

@@ -120,7 +120,11 @@ func compileCloudAgentTools(req CloudAgentRequest, includeProfileTool bool) []ma
if required == nil {
required = []string{}
}
tools = append(tools, map[string]any{"type": "function", "function": map[string]any{"name": name, "description": description, "parameters": map[string]any{"type": "object", "properties": properties, "required": required, "additionalProperties": false}}})
parameters := map[string]any{"type": "object", "properties": properties, "required": required, "additionalProperties": false}
if name == "generate_media" || name == "image_layer_split" {
description += " " + cloudAgentModelSelectionDescription
}
tools = append(tools, map[string]any{"type": "function", "function": map[string]any{"name": name, "description": description, "parameters": parameters}})
}
str := func(description string) map[string]any {
return map[string]any{"type": "string", "description": description}