Skip to content

Commit 4def447

Browse files
Update toolSupport.ts
1 parent 82ac684 commit 4def447

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

core/llm/toolSupport.ts

+29-24
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export const PROVIDER_TOOL_SUPPORT: Record<
3535
if (
3636
model.toLowerCase().startsWith("gpt-4") ||
3737
model.toLowerCase().startsWith("o3")
38-
) return true;
38+
)
39+
return true;
3940
return false;
4041
},
4142
openai: (model) => {
@@ -66,7 +67,10 @@ export const PROVIDER_TOOL_SUPPORT: Record<
6667
},
6768
vertexai: (model) => {
6869
// All gemini models except flash 2.0 lite support function calling
69-
return model.toLowerCase().includes("gemini") && !model.toLowerCase().includes("lite");;
70+
return (
71+
model.toLowerCase().includes("gemini") &&
72+
!model.toLowerCase().includes("lite")
73+
);
7074
},
7175
bedrock: (model) => {
7276
// For Bedrock, only support Claude Sonnet models with versions 3.5/3-5 and 3.7/3-7
@@ -81,22 +85,24 @@ export const PROVIDER_TOOL_SUPPORT: Record<
8185
},
8286
mistral: (model) => {
8387
// https://docs.mistral.ai/capabilities/function_calling/
84-
return !model.toLowerCase().includes("mamba") &&
85-
[
86-
"codestral",
87-
"mistral-large",
88-
"mistral-small",
89-
"pixtral",
90-
"ministral",
91-
"mistral-nemo"
92-
].some((part) => model.toLowerCase().includes(part));
88+
return (
89+
!model.toLowerCase().includes("mamba") &&
90+
[
91+
"codestral",
92+
"mistral-large",
93+
"mistral-small",
94+
"pixtral",
95+
"ministral",
96+
"mistral-nemo",
97+
].some((part) => model.toLowerCase().includes(part))
98+
);
9399
},
94100
// https://ollama.com/search?c=tools
95101
ollama: (model) => {
96102
let modelName = "";
97103
// Extract the model name after the last slash to support other registries
98-
if(model.includes("/")) {
99-
let parts = model.split('/');
104+
if (model.includes("/")) {
105+
let parts = model.split("/");
100106
modelName = parts[parts.length - 1];
101107
} else {
102108
modelName = model;
@@ -117,6 +123,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<
117123
"llama3.2",
118124
"llama3.1",
119125
"qwen2",
126+
"qwen3",
120127
"mixtral",
121128
"command-r",
122129
"smollm2",
@@ -145,19 +152,17 @@ export const PROVIDER_TOOL_SUPPORT: Record<
145152
}
146153
},
147154
deepseek: (model) => {
148-
if(model !== "deepseek-reasoner") {
155+
if (model !== "deepseek-reasoner") {
149156
return true;
150157
}
151158
},
152159
watsonx: (model) => {
153-
if (model.toLowerCase().includes("guard")) return false;
154-
if ([
155-
"llama-3",
156-
"llama-4",
157-
"mistral",
158-
"codestral",
159-
"granite-3"
160-
].some((part) => model.toLowerCase().includes(part)))
161-
return true;
162-
}
160+
if (model.toLowerCase().includes("guard")) return false;
161+
if (
162+
["llama-3", "llama-4", "mistral", "codestral", "granite-3"].some((part) =>
163+
model.toLowerCase().includes(part),
164+
)
165+
)
166+
return true;
167+
},
163168
};

0 commit comments

Comments
 (0)