Remove claude-3.7-sonnet and claude-3.7-sonnet:thinking from vscodelm (#3895)

* Remove claude-3.7-sonnet and claude-3.7-sonnet:thinking from vscodelm provider in api.ts (not supported via API)

* Add static blacklist for unsupported VS Code Language Model IDs

---------

Co-authored-by: Ruakij <ruakij@ruekov.eu>
This commit is contained in:
Shariq Riaz 2025-05-24 01:28:42 +04:00 committed by GitHub
parent be19a49b20
commit 20c7453425
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 28 deletions

View file

@ -555,10 +555,13 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
}
}
// Static blacklist of VS Code Language Model IDs that should be excluded from the model list e.g. because they will never work
const VSCODE_LM_STATIC_BLACKLIST: string[] = ["claude-3.7-sonnet", "claude-3.7-sonnet-thought"]
export async function getVsCodeLmModels() {
try {
const models = await vscode.lm.selectChatModels({})
return models || []
const models = (await vscode.lm.selectChatModels({})) || []
return models.filter((model) => !VSCODE_LM_STATIC_BLACKLIST.includes(model.id))
} catch (error) {
console.error(
`Error fetching VS Code LM models: ${JSON.stringify(error, Object.getOwnPropertyNames(error), 2)}`,

View file

@ -1473,32 +1473,6 @@ export const vscodeLlmModels = {
supportsToolCalling: true,
maxInputTokens: 81638,
},
"claude-3.7-sonnet": {
contextWindow: 89827,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
family: "claude-3.7-sonnet",
version: "claude-3.7-sonnet",
name: "Claude 3.7 Sonnet",
supportsToolCalling: true,
maxInputTokens: 89827,
},
"claude-3.7-sonnet-thought": {
contextWindow: 89827,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
family: "claude-3.7-sonnet-thought",
version: "claude-3.7-sonnet-thought",
name: "Claude 3.7 Sonnet Thinking",
supportsToolCalling: false,
maxInputTokens: 89827,
supportsReasoningBudget: true,
requiredReasoningBudget: true,
},
"gemini-2.0-flash-001": {
contextWindow: 127827,
supportsImages: true,