Skip to content

Commit 5f9bcc8

Browse files
committed
feat(continue-watsonx-ai-provider): filter out models without native tool support
1 parent 65976a0 commit 5f9bcc8

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

packages/types/src/providers/ibm-watsonx.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,19 @@ export const WATSONX_NON_INFERENCE_MODELS = [
2020
"ibm/granite-guardian-3-2b",
2121
] as const
2222

23+
/**
24+
* Models that don't support tool_calls (native tools).
25+
*/
26+
export const WATSONX_NON_TOOL_CALLS_MODELS = [
27+
"ibm/granite-3-2-8b-instruct",
28+
"ibm/granite-3-3-8b-instruct",
29+
"ibm/granite-3-3-8b-instruct-np",
30+
"ibm/granite-3-8b-instruct",
31+
"mistralai/mistral-medium-2505",
32+
] as const
33+
2334
export type WatsonxAIModelId = keyof typeof watsonxModels
24-
export const watsonxDefaultModelId = "ibm/granite-3-3-8b-instruct"
35+
export const watsonxDefaultModelId = "ibm/granite-4-h-small"
2536

2637
// Common model properties
2738
export const baseModelInfo: ModelInfo = {
@@ -35,7 +46,7 @@ export const baseModelInfo: ModelInfo = {
3546

3647
export const watsonxModels = {
3748
// IBM Granite model
38-
"ibm/granite-3-3-8b-instruct": {
49+
"ibm/granite-4-h-small": {
3950
...baseModelInfo,
4051
},
4152
} as const satisfies Record<string, ModelInfo>

src/api/providers/fetchers/ibm-watsonx.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ModelInfo, REGION_TO_URL, WATSONX_NON_INFERENCE_MODELS } from "@roo-code/types"
1+
import { ModelInfo, REGION_TO_URL, WATSONX_NON_INFERENCE_MODELS, WATSONX_NON_TOOL_CALLS_MODELS } from "@roo-code/types"
22
import { IamAuthenticator, CloudPakForDataAuthenticator, UserOptions } from "ibm-cloud-sdk-core"
33
import { WatsonXAI } from "@ibm-cloud/watsonx-ai"
44
import WatsonxAiMlVml_v1 from "@ibm-cloud/watsonx-ai/dist/watsonx-ai-ml/vml_v1.js"
@@ -99,6 +99,10 @@ export async function getWatsonxModels(
9999
continue
100100
}
101101

102+
if (WATSONX_NON_TOOL_CALLS_MODELS.includes(modelId as any)) {
103+
continue
104+
}
105+
102106
const contextWindow = model.model_limits?.max_sequence_length || 128000
103107
const maxTokens =
104108
model.training_parameters?.max_output_tokens?.max || Math.floor(contextWindow / 16)

0 commit comments

Comments
 (0)