Skip to content

Commit

Permalink
fix: build (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom authored Jun 18, 2024
1 parent 6e9528d commit 930430c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/model-config/useAssistantTool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <T,>(tool: Tool<T>) => {
export const useAssistantTool = <T,>(tool: ToolWithName<T>) => {
const { useModelConfig } = useAssistantContext();
const registerModelConfigProvider = useModelConfig(
(s) => s.registerModelConfigProvider,
Expand Down
5 changes: 4 additions & 1 deletion packages/react/src/utils/ModelConfigTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
import type { z } from "zod";

export type Tool<TArgs> = {
name: string;
description: string;
parameters: z.ZodSchema<TArgs>;
execute: (args: TArgs) => Promise<unknown>; // TODO return type
};

export type ToolWithName<TArgs> = Tool<TArgs> & {
name: string;
};

export type ModelConfig = {
priority?: number;
system?: string;
Expand Down

0 comments on commit 930430c

Please sign in to comment.