fix: tool call params
This commit is contained in:
parent
6b86baaa2f
commit
ae58c427a5
@ -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',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user