From 8a858a2a307d3448939363f5e2fa7245de1ff67c Mon Sep 17 00:00:00 2001 From: Zan Horvat Date: Tue, 9 Apr 2024 11:43:41 +0200 Subject: [PATCH] feat: export more types --- src/index.ts | 4 ++++ src/openai/chat-completion.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index ce687fe..449dea6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,7 @@ export * from './hooks/use-chat'; export * from './openai/openai'; +export { + ChatCompletionMessageOrReactElement, + Tool, +} from './openai/chat-completion'; export { isReactElement } from './openai/utils'; diff --git a/src/openai/chat-completion.ts b/src/openai/chat-completion.ts index a213665..f1d3742 100644 --- a/src/openai/chat-completion.ts +++ b/src/openai/chat-completion.ts @@ -19,7 +19,7 @@ export type ChatCompletionMessageOrReactElement = // Takes a description (visible to model) // Parameters (zod schema), that are converted to json schema and then sent to the model // Render function that takes the parameters and returns a generator that yields components, then returns both data and a component to display -interface Tool { +export interface Tool { description: string; parameters: Z; render: (args: z.infer) => ToolRenderReturnType;