From 0941f60a0c599da3482ebde7f04f1ea3ca6c3ba1 Mon Sep 17 00:00:00 2001 From: AI Assistant Date: Fri, 13 Mar 2026 11:19:52 +0900 Subject: [PATCH] Strengthen Gemini JSON output and range UI --- backend/services/gemini.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/backend/services/gemini.go b/backend/services/gemini.go index c1cafa4..71f8e5f 100644 --- a/backend/services/gemini.go +++ b/backend/services/gemini.go @@ -62,6 +62,18 @@ User query: ` + query, "responseMimeType": "application/json", "temperature": 0.2, "maxOutputTokens": 220, + "responseSchema": map[string]any{ + "type": "OBJECT", + "properties": map[string]any{ + "querywords": map[string]any{ + "type": "ARRAY", + "items": map[string]any{ + "type": "STRING", + }, + }, + }, + "required": []string{"querywords"}, + }, }, } @@ -92,6 +104,18 @@ User query: ` + query, "responseMimeType": "application/json", "temperature": 0.1, "maxOutputTokens": 220, + "responseSchema": map[string]any{ + "type": "OBJECT", + "properties": map[string]any{ + "querywords": map[string]any{ + "type": "ARRAY", + "items": map[string]any{ + "type": "STRING", + }, + }, + }, + "required": []string{"querywords"}, + }, }, } rawText, retryErr := g.generateText(strictBody)