fix(agent): 图片尺寸 - 修复比例 preset 映射

This commit is contained in:
ddcat666 committed 2026-10-14 09:17:42 +08:00
1 parent 7ce07a4c04
commit 6a118ae93b
5 files changed
+119 -3

No files matched your search

+2 -2
View File
@@ -533,8 +533,8 @@ func (s *Service) resolveSystemChannelModelSelection(input map[string]any, taskT
}
if value, ok := values["size"]; ok && capabilitySpec != nil && capabilityImageSizePresetMatches(*capabilitySpec, value, values) {
values = maps.Clone(values)
if ratio := imageSizeRatioForDeclaredPreset(capabilityConfig.Image, fmt.Sprint(value), fmt.Sprint(values["imageResolution"])); ratio != "" {
values["size"] = ratio
if encoded := imageSizeValueForDeclaredPreset(capabilityConfig.Image, fmt.Sprint(value), stringValue(values["imageResolution"])); encoded != "" {
values["size"] = encoded
}
}
resolved, parameterErr := resolveImageParameterValues(parameters, values)