fix(canvas): 媒体提示词 - 统一 Agent 更新与画布生成读取生成合同

This commit is contained in:
ddcat666 committed 2026-10-04 10:43:55 +08:00
1 parent d0b27d2871
commit ed68608080
20 files changed
+174 -48

No files matched your search

@@ -440,9 +440,15 @@ func cloudAgentProjectNodeFields(node, meta map[string]any, descriptor capabilit
}
continue
}
value, ok := node[key]
if !ok {
value, ok = meta[key]
var value any
var ok bool
if key == "prompt" && descriptor.GenerationMode != "" {
value, ok = cloudAgentMediaPrompt(meta)
} else {
value, ok = node[key]
if !ok {
value, ok = meta[key]
}
}
if !ok || (key == "content" && descriptor.GenerationMode != "") {
continue
@@ -457,6 +463,21 @@ func cloudAgentProjectNodeFields(node, meta map[string]any, descriptor capabilit
return projected, nil
}
func cloudAgentMediaPrompt(meta map[string]any) (string, bool) {
if generationSpec, ok := meta["generationSpec"].(map[string]any); ok {
if prompt, ok := generationSpec["prompt"].(string); ok {
return prompt, true
}
}
if prompt, ok := meta["composerContent"].(string); ok {
return prompt, true
}
if prompt, ok := meta["prompt"].(string); ok {
return prompt, true
}
return "", false
}
func cloudAgentProjectionValue(node, meta map[string]any, path string) (any, bool) {
parts := strings.Split(path, ".")
for _, root := range []map[string]any{node, meta} {