Skip to content

Commit 8550822

Browse files
committed
Increase max output tokens for Gemini 2.5
1 parent a24a1dd commit 8550822

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/api/Providers/google_gemini.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export const GeminiProvider = {
2323
"gemini-exp": "experimental",
2424
"gemini-thinking": "thinking",
2525
},
26+
maxOutputTokens: {
27+
default: 8192,
28+
"gemini-2.5-pro-exp-03-25": 64000,
29+
},
2630
generate: async function (chat, options, { stream_update, max_retries = 3 }) {
2731
let APIKeysStr = Preferences["GeminiAPIKeys"];
2832
let APIKeys = APIKeysStr.split(",").map((x) => x.trim());
@@ -49,7 +53,7 @@ export const GeminiProvider = {
4953
history: formattedChat,
5054
safetySettings: constants.safetyDisabledSettings,
5155
generationConfig: {
52-
maxOutputTokens: 8192, // maximum for v1.5 models
56+
maxOutputTokens: this.maxOutputTokens[model] || this.maxOutputTokens.default,
5357
temperature: options.temperature * 1.5, // v1.5 models have temperature in [0, 2] so we scale it up
5458
},
5559
tools: tools,

0 commit comments

Comments
 (0)