💄 style: support adjust thinkingBudget in gemini 2.5 flash (#7947)

* 💄 style: support adjust thinkingBudget in gemini 2.5 flash

* 💄 style: support adjust thinkingBudget in gemini 2.5 flash

* 💄 style: support adjust thinkingBudget in gemini 2.5 flash
This commit is contained in:
Alex Lin
2025-05-27 18:31:08 +08:00
committed by GitHub
parent 7f2f30feb9
commit a9db54810a
3 changed files with 6 additions and 2 deletions
+2
View File
@@ -68,6 +68,7 @@ const googleChatModels: AIChatModelCard[] = [
},
releasedAt: '2025-05-20',
settings: {
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
searchImpl: 'params',
searchProvider: 'google',
},
@@ -91,6 +92,7 @@ const googleChatModels: AIChatModelCard[] = [
},
releasedAt: '2025-04-17',
settings: {
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
searchImpl: 'params',
searchProvider: 'google',
},
+3 -1
View File
@@ -89,6 +89,7 @@ interface LobeGoogleAIParams {
interface GoogleAIThinkingConfig {
includeThoughts?: boolean;
thinkingBudget?: number;
}
export class LobeGoogleAI implements LobeRuntimeAI {
@@ -113,10 +114,11 @@ export class LobeGoogleAI implements LobeRuntimeAI {
async chat(rawPayload: ChatStreamPayload, options?: ChatCompetitionOptions) {
try {
const payload = this.buildPayload(rawPayload);
const model = payload.model;
const { model, thinking } = payload;
const thinkingConfig: GoogleAIThinkingConfig = {
includeThoughts: true,
thinkingBudget: thinking?.type === 'enabled' ? Math.min(thinking.budget_tokens, 24_576) : 0,
};
const contents = await this.buildGoogleMessages(payload.messages);
+1 -1
View File
@@ -122,7 +122,7 @@ export interface ChatStreamPayload {
*/
temperature: number;
/**
* use for Claude
* use for Claude and Gemini
*/
thinking?: {
budget_tokens: number;