File tree Expand file tree Collapse file tree
packages/types/src/providers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ export const lMStudioDefaultModelInfo: ModelInfo = {
1010 contextWindow : 200_000 ,
1111 supportsImages : true ,
1212 supportsPromptCache : true ,
13+ supportsNativeTools : true ,
14+ defaultToolProtocol : "native" ,
1315 inputPrice : 0 ,
1416 outputPrice : 0 ,
1517 cacheWritesPrice : 0 ,
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ export const qwenCodeModels = {
1010 contextWindow : 1_000_000 ,
1111 supportsImages : false ,
1212 supportsPromptCache : false ,
13+ supportsNativeTools : true ,
14+ defaultToolProtocol : "native" ,
1315 inputPrice : 0 ,
1416 outputPrice : 0 ,
1517 cacheWritesPrice : 0 ,
@@ -21,6 +23,8 @@ export const qwenCodeModels = {
2123 contextWindow : 1_000_000 ,
2224 supportsImages : false ,
2325 supportsPromptCache : false ,
26+ supportsNativeTools : true ,
27+ defaultToolProtocol : "native" ,
2428 inputPrice : 0 ,
2529 outputPrice : 0 ,
2630 cacheWritesPrice : 0 ,
Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ export class LmStudioHandler extends BaseProvider implements SingleCompletionHan
4747 ...convertToOpenAiMessages ( messages ) ,
4848 ]
4949
50+ // LM Studio always supports native tools (https://lmstudio.ai/docs/developer/core/tools)
51+ const useNativeTools = metadata ?. tools && metadata . tools . length > 0 && metadata ?. toolProtocol !== "xml"
52+
5053 // -------------------------
5154 // Track token usage
5255 // -------------------------
Original file line number Diff line number Diff line change @@ -212,6 +212,11 @@ export class QwenCodeHandler extends BaseProvider implements SingleCompletionHan
212212 const client = this . ensureClient ( )
213213 const model = this . getModel ( )
214214
215+ // Check if model supports native tools and tools are provided with native protocol
216+ const supportsNativeTools = model . info . supportsNativeTools ?? false
217+ const useNativeTools =
218+ supportsNativeTools && metadata ?. tools && metadata . tools . length > 0 && metadata ?. toolProtocol !== "xml"
219+
215220 const systemMessage : OpenAI . Chat . ChatCompletionSystemMessageParam = {
216221 role : "system" ,
217222 content : systemPrompt ,
You can’t perform that action at this time.
0 commit comments