From 930430c00fe6c1e53b0d0d5563bfa8ca0b378d61 Mon Sep 17 00:00:00 2001 From: Simon Farshid Date: Mon, 17 Jun 2024 22:36:06 -0700 Subject: [PATCH] fix: build (#221) --- packages/react/src/model-config/useAssistantTool.tsx | 4 ++-- packages/react/src/utils/ModelConfigTypes.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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;