Improve source-specific search queries and preview layout
build-push / docker (push) Successful in 4m14s

This commit is contained in:
AI Assistant
2026-03-13 11:39:51 +09:00
parent c7261edc7d
commit 1fc06fb785
3 changed files with 71 additions and 23 deletions
+14
View File
@@ -43,6 +43,13 @@ func (g *GeminiService) ExpandQuery(query string) ([]string, error) {
}
body := map[string]any{
"systemInstruction": map[string]any{
"parts": []map[string]string{
{
"text": "You are a JSON-only API. Output valid JSON only. Never add prose, labels, markdown, or explanations before or after the JSON.",
},
},
},
"contents": []map[string]any{
{
"parts": []map[string]string{
@@ -85,6 +92,13 @@ User query: ` + query,
jsonText, err := extractJSONObject(rawText)
if err != nil {
strictBody := map[string]any{
"systemInstruction": map[string]any{
"parts": []map[string]string{
{
"text": "You are a strict JSON emitter. Output one valid JSON object only. Do not write any other text.",
},
},
},
"contents": []map[string]any{
{
"parts": []map[string]string{