Parcourir la source

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 <[email protected]>
Shariq Riaz il y a 9 mois
Parent
commit
20c7453425
2 fichiers modifiés avec 5 ajouts et 28 suppressions
  1. 5 2
      src/api/providers/vscode-lm.ts
  2. 0 26
      src/shared/api.ts

+ 5 - 2
src/api/providers/vscode-lm.ts

@@ -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)}`,

+ 0 - 26
src/shared/api.ts

@@ -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,