Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions packages/types/src/providers/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const geminiModels = {
supportsPromptCache: true,
supportsReasoningEffort: ["low", "high"],
reasoningEffort: "low",
includedTools: ["write_file", "edit_file"],
supportsTemperature: true,
defaultTemperature: 1,
inputPrice: 4.0,
Expand All @@ -41,6 +42,7 @@ export const geminiModels = {
supportsPromptCache: true,
supportsReasoningEffort: ["minimal", "low", "medium", "high"],
reasoningEffort: "medium",
includedTools: ["write_file", "edit_file"],
supportsTemperature: true,
defaultTemperature: 1,
inputPrice: 0.3,
Expand All @@ -56,6 +58,7 @@ export const geminiModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 2.5, // This is the pricing for prompts above 200k tokens.
outputPrice: 15,
cacheReadsPrice: 0.625,
Expand Down Expand Up @@ -85,6 +88,7 @@ export const geminiModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 2.5, // This is the pricing for prompts above 200k tokens.
outputPrice: 15,
cacheReadsPrice: 0.625,
Expand Down Expand Up @@ -113,6 +117,7 @@ export const geminiModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 2.5, // This is the pricing for prompts above 200k tokens.
outputPrice: 15,
cacheReadsPrice: 0.625,
Expand All @@ -139,6 +144,7 @@ export const geminiModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 2.5, // This is the pricing for prompts above 200k tokens.
outputPrice: 15,
cacheReadsPrice: 0.625,
Expand Down Expand Up @@ -169,6 +175,7 @@ export const geminiModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.3,
outputPrice: 2.5,
cacheReadsPrice: 0.075,
Expand All @@ -183,6 +190,7 @@ export const geminiModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.3,
outputPrice: 2.5,
cacheReadsPrice: 0.075,
Expand All @@ -197,6 +205,7 @@ export const geminiModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.3,
outputPrice: 2.5,
cacheReadsPrice: 0.075,
Expand All @@ -213,6 +222,7 @@ export const geminiModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.1,
outputPrice: 0.4,
cacheReadsPrice: 0.025,
Expand All @@ -227,6 +237,7 @@ export const geminiModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.1,
outputPrice: 0.4,
cacheReadsPrice: 0.025,
Expand Down
19 changes: 19 additions & 0 deletions packages/types/src/providers/vertex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const vertexModels = {
supportsPromptCache: true,
supportsReasoningEffort: ["low", "high"],
reasoningEffort: "low",
includedTools: ["write_file", "edit_file"],
supportsTemperature: true,
defaultTemperature: 1,
inputPrice: 4.0,
Expand All @@ -41,6 +42,7 @@ export const vertexModels = {
supportsPromptCache: true,
supportsReasoningEffort: ["minimal", "low", "medium", "high"],
reasoningEffort: "medium",
includedTools: ["write_file", "edit_file"],
supportsTemperature: true,
defaultTemperature: 1,
inputPrice: 0.3,
Expand All @@ -55,6 +57,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.15,
outputPrice: 3.5,
maxThinkingTokens: 24_576,
Expand All @@ -68,6 +71,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.15,
outputPrice: 0.6,
},
Expand All @@ -78,6 +82,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.3,
outputPrice: 2.5,
cacheReadsPrice: 0.075,
Expand All @@ -92,6 +97,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: false,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.15,
outputPrice: 3.5,
maxThinkingTokens: 24_576,
Expand All @@ -105,6 +111,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: false,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.15,
outputPrice: 0.6,
},
Expand All @@ -115,6 +122,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 2.5,
outputPrice: 15,
},
Expand All @@ -125,6 +133,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 2.5,
outputPrice: 15,
},
Expand All @@ -135,6 +144,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 2.5,
outputPrice: 15,
maxThinkingTokens: 32_768,
Expand All @@ -147,6 +157,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 2.5,
outputPrice: 15,
maxThinkingTokens: 32_768,
Expand Down Expand Up @@ -174,6 +185,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: false,
includedTools: ["write_file", "edit_file"],
inputPrice: 0,
outputPrice: 0,
},
Expand All @@ -184,6 +196,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: false,
includedTools: ["write_file", "edit_file"],
inputPrice: 0,
outputPrice: 0,
},
Expand All @@ -194,6 +207,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.15,
outputPrice: 0.6,
},
Expand All @@ -204,6 +218,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: false,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.075,
outputPrice: 0.3,
},
Expand All @@ -214,6 +229,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: false,
includedTools: ["write_file", "edit_file"],
inputPrice: 0,
outputPrice: 0,
},
Expand All @@ -224,6 +240,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.075,
outputPrice: 0.3,
},
Expand All @@ -234,6 +251,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: false,
includedTools: ["write_file", "edit_file"],
inputPrice: 1.25,
outputPrice: 5,
},
Expand Down Expand Up @@ -381,6 +399,7 @@ export const vertexModels = {
supportsNativeTools: true,
defaultToolProtocol: "native",
supportsPromptCache: true,
includedTools: ["write_file", "edit_file"],
inputPrice: 0.1,
outputPrice: 0.4,
cacheReadsPrice: 0.025,
Expand Down
11 changes: 10 additions & 1 deletion src/api/providers/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,14 +530,23 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH

// For OpenAI models via OpenRouter, exclude write_to_file and apply_diff, and include apply_patch
// This matches the behavior of the native OpenAI provider
if (id.startsWith("openai/")) {
if (id.includes("openai")) {
info = {
...info,
excludedTools: [...new Set([...(info.excludedTools || []), "apply_diff", "write_to_file"])],
includedTools: [...new Set([...(info.includedTools || []), "apply_patch"])],
}
}

// For Gemini models via OpenRouter, include write_file and edit_file
// This matches the behavior of the native Gemini provider
if (id.includes("gemini")) {
info = {
...info,
includedTools: [...new Set([...(info.includedTools || []), "write_file", "edit_file"])],
}
}

const isDeepSeekR1 = id.startsWith("deepseek/deepseek-r1") || id === "perplexity/sonar-reasoning"

const params = getModelParams({
Expand Down
21 changes: 20 additions & 1 deletion src/api/providers/requesty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,26 @@ export class RequestyHandler extends BaseProvider implements SingleCompletionHan

override getModel() {
const id = this.options.requestyModelId ?? requestyDefaultModelId
const info = this.models[id] ?? requestyDefaultModelInfo
let info = this.models[id] ?? requestyDefaultModelInfo

// For OpenAI models via Requesty, exclude write_to_file and apply_diff, and include apply_patch
// This matches the behavior of the native OpenAI provider
if (id.includes("openai")) {
info = {
...info,
excludedTools: [...new Set([...(info.excludedTools || []), "apply_diff", "write_to_file"])],
includedTools: [...new Set([...(info.includedTools || []), "apply_patch"])],
}
}

// For Gemini models via Requesty, include write_file and edit_file
// This matches the behavior of the native Gemini provider
if (id.includes("gemini")) {
info = {
...info,
includedTools: [...new Set([...(info.includedTools || []), "write_file", "edit_file"])],
}
}

const params = getModelParams({
format: "anthropic",
Expand Down
Loading