diff --git a/packages/react/src/model-config/useAssistantTool.tsx b/packages/react/src/model-config/useAssistantTool.tsx index f2f878c36..2ff4cdfdb 100644 --- a/packages/react/src/model-config/useAssistantTool.tsx +++ b/packages/react/src/model-config/useAssistantTool.tsx @@ -2,9 +2,9 @@ import { useEffect } from "react"; import { useAssistantContext } from "../context/AssistantContext"; -import type { Tool } from "../utils/ModelConfigTypes"; +import type { ToolWithName } from "../utils/ModelConfigTypes"; -export const useAssistantTool = (tool: Tool) => { +export const useAssistantTool = (tool: ToolWithName) => { const { useModelConfig } = useAssistantContext(); const registerModelConfigProvider = useModelConfig( (s) => s.registerModelConfigProvider, diff --git a/packages/react/src/utils/ModelConfigTypes.ts b/packages/react/src/utils/ModelConfigTypes.ts index e34e8c714..4097b9204 100644 --- a/packages/react/src/utils/ModelConfigTypes.ts +++ b/packages/react/src/utils/ModelConfigTypes.ts @@ -2,12 +2,15 @@ import type { z } from "zod"; export type Tool = { - name: string; description: string; parameters: z.ZodSchema; execute: (args: TArgs) => Promise; // TODO return type }; +export type ToolWithName = Tool & { + name: string; +}; + export type ModelConfig = { priority?: number; system?: string;