fix: tool call params

This commit is contained in:
Louis 2025-06-23 18:16:17 +07:00
parent 6b86baaa2f
commit ae58c427a5
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2

View File

@ -8,6 +8,7 @@ import {
chatCompletionRequestMessage, chatCompletionRequestMessage,
chatCompletion, chatCompletion,
chatCompletionChunk, chatCompletionChunk,
Tool,
} from '@janhq/core' } from '@janhq/core'
import { invoke } from '@tauri-apps/api/core' import { invoke } from '@tauri-apps/api/core'
import { fetch as fetchTauri } from '@tauri-apps/plugin-http' import { fetch as fetchTauri } from '@tauri-apps/plugin-http'
@ -241,7 +242,7 @@ export const stopModel = async (
*/ */
export const normalizeTools = ( export const normalizeTools = (
tools: MCPTool[] tools: MCPTool[]
): ChatCompletionTool[] | undefined => { ): ChatCompletionTool[] | Tool[] | undefined => {
if (tools.length === 0) return undefined if (tools.length === 0) return undefined
return tools.map((tool) => ({ return tools.map((tool) => ({
type: 'function', type: 'function',