Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/exports/roo-code.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type ProviderSettings = {
outputPrice?: number | undefined
cacheWritesPrice?: number | undefined
cacheReadsPrice?: number | undefined
freeRequestsRpm?: number | undefined
description?: string | undefined
reasoningEffort?: ("low" | "medium" | "high") | undefined
thinking?: boolean | undefined
Expand All @@ -59,6 +60,7 @@ type ProviderSettings = {
outputPrice?: number | undefined
cacheWritesPrice?: number | undefined
cacheReadsPrice?: number | undefined
freeRequestsRpm?: number | undefined
description?: string | undefined
reasoningEffort?: ("low" | "medium" | "high") | undefined
thinking?: boolean | undefined
Expand Down Expand Up @@ -99,6 +101,7 @@ type ProviderSettings = {
outputPrice?: number | undefined
cacheWritesPrice?: number | undefined
cacheReadsPrice?: number | undefined
freeRequestsRpm?: number | undefined
description?: string | undefined
reasoningEffort?: ("low" | "medium" | "high") | undefined
thinking?: boolean | undefined
Expand Down Expand Up @@ -144,6 +147,7 @@ type ProviderSettings = {
outputPrice?: number | undefined
cacheWritesPrice?: number | undefined
cacheReadsPrice?: number | undefined
freeRequestsRpm?: number | undefined
description?: string | undefined
reasoningEffort?: ("low" | "medium" | "high") | undefined
thinking?: boolean | undefined
Expand All @@ -165,6 +169,7 @@ type ProviderSettings = {
outputPrice?: number | undefined
cacheWritesPrice?: number | undefined
cacheReadsPrice?: number | undefined
freeRequestsRpm?: number | undefined
description?: string | undefined
reasoningEffort?: ("low" | "medium" | "high") | undefined
thinking?: boolean | undefined
Expand Down
5 changes: 5 additions & 0 deletions src/exports/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type ProviderSettings = {
outputPrice?: number | undefined
cacheWritesPrice?: number | undefined
cacheReadsPrice?: number | undefined
freeRequestsRpm?: number | undefined
description?: string | undefined
reasoningEffort?: ("low" | "medium" | "high") | undefined
thinking?: boolean | undefined
Expand All @@ -60,6 +61,7 @@ type ProviderSettings = {
outputPrice?: number | undefined
cacheWritesPrice?: number | undefined
cacheReadsPrice?: number | undefined
freeRequestsRpm?: number | undefined
description?: string | undefined
reasoningEffort?: ("low" | "medium" | "high") | undefined
thinking?: boolean | undefined
Expand Down Expand Up @@ -100,6 +102,7 @@ type ProviderSettings = {
outputPrice?: number | undefined
cacheWritesPrice?: number | undefined
cacheReadsPrice?: number | undefined
freeRequestsRpm?: number | undefined
description?: string | undefined
reasoningEffort?: ("low" | "medium" | "high") | undefined
thinking?: boolean | undefined
Expand Down Expand Up @@ -145,6 +148,7 @@ type ProviderSettings = {
outputPrice?: number | undefined
cacheWritesPrice?: number | undefined
cacheReadsPrice?: number | undefined
freeRequestsRpm?: number | undefined
description?: string | undefined
reasoningEffort?: ("low" | "medium" | "high") | undefined
thinking?: boolean | undefined
Expand All @@ -166,6 +170,7 @@ type ProviderSettings = {
outputPrice?: number | undefined
cacheWritesPrice?: number | undefined
cacheReadsPrice?: number | undefined
freeRequestsRpm?: number | undefined
description?: string | undefined
reasoningEffort?: ("low" | "medium" | "high") | undefined
thinking?: boolean | undefined
Expand Down
1 change: 1 addition & 0 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const modelInfoSchema = z.object({
outputPrice: z.number().optional(),
cacheWritesPrice: z.number().optional(),
cacheReadsPrice: z.number().optional(),
freeRequestsRpm: z.number().optional(),
description: z.string().optional(),
reasoningEffort: z.enum(["low", "medium", "high"]).optional(),
thinking: z.boolean().optional(),
Expand Down
13 changes: 13 additions & 0 deletions src/shared/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 5,
},
"gemini-2.5-pro-preview-03-25": {
maxTokens: 65_535,
Expand All @@ -644,6 +645,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 15,
},
"gemini-2.0-flash-lite-preview-02-05": {
maxTokens: 8192,
Expand All @@ -652,6 +654,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 30,
},
"gemini-2.0-pro-exp-02-05": {
maxTokens: 8192,
Expand All @@ -660,6 +663,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 5,
},
"gemini-2.0-flash-thinking-exp-01-21": {
maxTokens: 65_536,
Expand All @@ -668,6 +672,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 10,
},
"gemini-2.0-flash-thinking-exp-1219": {
maxTokens: 8192,
Expand All @@ -676,6 +681,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 10,
},
"gemini-2.0-flash-exp": {
maxTokens: 8192,
Expand All @@ -684,6 +690,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 10,
},
"gemini-1.5-flash-002": {
maxTokens: 8192,
Expand All @@ -692,6 +699,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 15,
},
"gemini-1.5-flash-exp-0827": {
maxTokens: 8192,
Expand All @@ -700,6 +708,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 15,
},
"gemini-1.5-flash-8b-exp-0827": {
maxTokens: 8192,
Expand All @@ -708,6 +717,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 15,
},
"gemini-1.5-pro-002": {
maxTokens: 8192,
Expand All @@ -716,6 +726,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 2,
},
"gemini-1.5-pro-exp-0827": {
maxTokens: 8192,
Expand All @@ -724,6 +735,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 2,
},
"gemini-exp-1206": {
maxTokens: 8192,
Expand All @@ -732,6 +744,7 @@ export const geminiModels = {
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
freeRequestsRpm: 5,
},
} as const satisfies Record<string, ModelInfo>

Expand Down
16 changes: 10 additions & 6 deletions webview-ui/src/components/settings/ModelInfoView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,16 @@ export const ModelInfoView = ({
<span className="italic">
{selectedModelId === "gemini-2.5-pro-preview-03-25"
? t("settings:modelInfo.gemini.billingEstimate")
: t("settings:modelInfo.gemini.freeRequests", {
count: selectedModelId && selectedModelId.includes("flash") ? 15 : 2,
})}{" "}
<VSCodeLink href="https://ai.google.dev/pricing" className="text-sm">
{t("settings:modelInfo.gemini.pricingDetails")}
</VSCodeLink>
: modelInfo.freeRequestsRpm && modelInfo.freeRequestsRpm > 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repeated condition modelInfo.freeRequestsRpm && modelInfo.freeRequestsRpm > 0 is used twice. Consider extracting it into a variable (e.g. const hasFreeRequests = modelInfo.freeRequestsRpm > 0) to improve readability and avoid potential repetition errors.

? t("settings:modelInfo.gemini.freeRequests", {
count: modelInfo.freeRequestsRpm,
})
: null}{" "}
{(selectedModelId === "gemini-2.5-pro-preview-03-25" || (modelInfo.freeRequestsRpm && modelInfo.freeRequestsRpm > 0)) && (
<VSCodeLink href="https://ai.google.dev/pricing" className="text-sm">
{t("settings:modelInfo.gemini.pricingDetails")}
</VSCodeLink>
)}
</span>
),
].filter(Boolean)
Expand Down