feat: update gemini sdk and add thinking budget support (#2964)

* feat: update gemini sdk and add thinking budget support

* chore: remove redundant comments

* refactor(thinking-budget): abstract calculation for budget slider

* chore: remove some more redundant comments
This commit is contained in:
monotykamary authored and GitHub committed 2025-04-22 16:50:59 -07:00
1 parent dfcb3d5d9b
commit fffcc80477
8 files changed
+226 -92

No files matched your search

+29
View File
@@ -104,6 +104,11 @@ export interface ModelInfo {
inputPriceTiers?: PriceTier[] // Add for tiered input pricing
outputPrice?: number // Keep for non-tiered output models
outputPriceTiers?: PriceTier[] // Add for tiered output pricing
thinkingConfig?: {
maxBudget?: number // Max allowed thinking budget tokens
outputPrice?: number // Output price per million tokens when budget > 0
outputPriceTiers?: PriceTier[] // Optional: Tiered output price when budget > 0
}
cacheWritesPrice?: number
cacheReadsPrice?: number
description?: string
@@ -409,6 +414,18 @@ export const vertexModels = {
{ tokenLimit: Infinity, price: 15.0 }, // Output price for > 200k input tokens
],
},
"gemini-2.5-flash-preview-04-17": {
maxTokens: 65536,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0.15,
outputPrice: 0.6,
thinkingConfig: {
maxBudget: 24576,
outputPrice: 3.5,
},
},
"gemini-2.0-flash-thinking-exp-01-21": {
maxTokens: 65_536,
contextWindow: 1_048_576,
@@ -505,6 +522,18 @@ export const geminiModels = {
{ tokenLimit: Infinity, price: 15.0 }, // Output price for > 200k input tokens
],
},
"gemini-2.5-flash-preview-04-17": {
maxTokens: 65536,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0.15,
outputPrice: 0.6,
thinkingConfig: {
maxBudget: 24576,
outputPrice: 3.5,
},
},
"gemini-2.0-flash-001": {
maxTokens: 8192,
contextWindow: 1_048_576,