Skip to content

Commit 66851d3

Browse files
authored
Gemini image config: thinking + search grounding + image size
Gemini image config: thinking + search grounding + image size
2 parents 5cda134 + e85f6a7 commit 66851d3

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

lib/services/gemini-infographics.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @module lib/services/gemini-infographics
1313
*/
1414

15-
import { GoogleGenAI } from "@google/genai";
15+
import { GoogleGenAI, ThinkingLevel } from "@google/genai";
1616
import { getConfigValue } from "@/lib/config";
1717

1818
// ---------------------------------------------------------------------------
@@ -110,10 +110,19 @@ async function generateWithGeminiContent(
110110
model,
111111
contents: prompt,
112112
config: {
113-
responseModalities: ['IMAGE'],
113+
responseModalities: ['IMAGE', 'TEXT'],
114+
thinkingConfig: {
115+
thinkingLevel: ThinkingLevel.MINIMAL,
116+
},
114117
imageConfig: {
115118
aspectRatio: aspectRatio as '1:1' | '3:4' | '4:3' | '9:16' | '16:9',
119+
imageSize: '1K',
116120
},
121+
tools: [
122+
{
123+
googleSearch: {},
124+
},
125+
],
117126
},
118127
});
119128

0 commit comments

Comments
 (0)