fix(ai): clamp streamSimple max tokens

Clamps streamSimple max-token defaults against estimated context, addressing #5595.

closes #6061
This commit is contained in:
Mario Zechner
2026-06-25 14:10:05 +02:00
parent 49956a7cd0
commit 09f1059575
13 changed files with 198 additions and 20 deletions
+1 -1
View File
@@ -290,7 +290,7 @@ export const streamSimple: StreamFunction<"google-generative-ai", SimpleStreamOp
throw new Error(`No API key for provider: ${model.provider}`);
}
const base = buildBaseOptions(model, options, apiKey);
const base = buildBaseOptions(model, context, options, apiKey);
if (!options?.reasoning) {
return stream(model, context, { ...base, thinking: { enabled: false } } satisfies GoogleOptions);
}