diff --git a/backend/internal/service/image_generation_intent.go b/backend/internal/service/image_generation_intent.go index 630ed3b229..9593213da3 100644 --- a/backend/internal/service/image_generation_intent.go +++ b/backend/internal/service/image_generation_intent.go @@ -300,7 +300,7 @@ func openAIJSONInputContainsImageGenTool(input gjson.Result) bool { } func openAIRequestBodyHasImageGenerationDeclaration(body []byte) bool { - if len(body) == 0 || !gjson.ValidBytes(body) { + if len(body) == 0 || !openAIBodyMayDeclareImageGeneration(body) || !gjson.ValidBytes(body) { return false } return openAIJSONToolsContainImageGeneration(gjson.GetBytes(body, "tools")) || @@ -309,7 +309,7 @@ func openAIRequestBodyHasImageGenerationDeclaration(body []byte) bool { } func openAIRequestBodyImageGenerationToolNeedsNormalization(body []byte) bool { - if len(body) == 0 || !gjson.ValidBytes(body) { + if len(body) == 0 || !openAIBodyMayDeclareImageGeneration(body) || !gjson.ValidBytes(body) { return false } tools := gjson.GetBytes(body, "tools")