chore: tool type
This commit is contained in:
parent
72a7157509
commit
cc90c1e86e
@ -58,6 +58,7 @@ import {
|
|||||||
updateThreadAtom,
|
updateThreadAtom,
|
||||||
updateThreadWaitingForResponseAtom,
|
updateThreadWaitingForResponseAtom,
|
||||||
} from '@/helpers/atoms/Thread.atom'
|
} from '@/helpers/atoms/Thread.atom'
|
||||||
|
import { ModelTool } from '@/types/model'
|
||||||
|
|
||||||
export const reloadModelAtom = atom(false)
|
export const reloadModelAtom = atom(false)
|
||||||
|
|
||||||
@ -185,7 +186,7 @@ export default function useSendChatMessage() {
|
|||||||
},
|
},
|
||||||
activeThreadRef.current,
|
activeThreadRef.current,
|
||||||
messages ?? currentMessages,
|
messages ?? currentMessages,
|
||||||
(await window.core.api.getTools())?.map((tool) => ({
|
(await window.core.api.getTools())?.map((tool: ModelTool) => ({
|
||||||
type: 'function' as const,
|
type: 'function' as const,
|
||||||
function: {
|
function: {
|
||||||
name: tool.name,
|
name: tool.name,
|
||||||
@ -311,7 +312,7 @@ export default function useSendChatMessage() {
|
|||||||
{
|
{
|
||||||
type: ContentType.Text,
|
type: ContentType.Text,
|
||||||
text: {
|
text: {
|
||||||
value: `<think>Executing Tool ${toolCall.function.name} with arguments ${toolCall.function.arguments}</think>`,
|
value: `<think>Executing Tool ${toolCall.function.name} with arguments ${toolCall.function.arguments}`,
|
||||||
annotations: [],
|
annotations: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
6
web/types/model.d.ts
vendored
6
web/types/model.d.ts
vendored
@ -2,3 +2,9 @@
|
|||||||
* ModelParams types
|
* ModelParams types
|
||||||
*/
|
*/
|
||||||
export type ModelParams = ModelRuntimeParams | ModelSettingParams
|
export type ModelParams = ModelRuntimeParams | ModelSettingParams
|
||||||
|
|
||||||
|
export type ModelTool = {
|
||||||
|
name: string
|
||||||
|
description: string
|
||||||
|
inputSchema: string
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user