Improve source-specific search queries and preview layout
build-push / docker (push) Successful in 4m14s
build-push / docker (push) Successful in 4m14s
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user