Elffuss BraidHub

kikocis/continue public

Merge pull request #5598 from continuedev/tomasz/add-qwen3-tool-support

Update Qwen3 tool support
Changeset62812fc1f22babe13a96b93447f576ab809688535e7aa8624c651875e051d4fd
AuthorNate Sesti <33237525+sestinj@users.noreply.github.com> · 2025-05-09 17:00 -07:00
CommitterGitHub <noreply@github.com> · 2025-05-09 17:00 -07:00
Parents0cf7a8c776e5, 8903f843f098

Browse the files at this changeset

2 files changed

modified core/llm/llms/Ollama.ts +1 −1
@@ -44,7 +44,7 @@
4444 min_p?: number;
4545 num_gpu?: number;
4646
47- // deprecated or not directly supported here:
47+ // Deprecated or not directly supported here:
4848 num_thread?: number;
4949 use_mmap?: boolean;
5050 num_gqa?: number;
modified core/llm/toolSupport.ts +29 −24
@@ -35,7 +35,8 @@
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 @@
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 @@
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 @@
117123 "llama3.2",
118124 "llama3.1",
119125 "qwen2",
126+ "qwen3",
120127 "mixtral",
121128 "command-r",
122129 "smollm2",
@@ -145,19 +152,17 @@
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 };