From 01e855c1bb859c67fe632ba9f4f6ea2b5265c968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Tranta?= Date: Fri, 20 Sep 2024 12:18:07 +0200 Subject: [PATCH] add tool_calls ChatMessage --- src/react/useChatStream.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/react/useChatStream.ts b/src/react/useChatStream.ts index 2b2d19d..48ab7fd 100644 --- a/src/react/useChatStream.ts +++ b/src/react/useChatStream.ts @@ -17,11 +17,13 @@ export type ChatMessage = | { role: "user" | "assistant" | "system" content: string | null + tool_calls?: ChatCompletionMessageToolCall[] } | { role: "tool" tool_call_id: string content: string | null + tool_calls?: ChatCompletionMessageToolCall[] } | { role: "assistant" | "user" | "system" | "tool" content: [ @@ -45,6 +47,7 @@ export type ChatMessage = text: string, }, ] + tool_calls?: ChatCompletionMessageToolCall[] } export function mapAIMessagesToChatCompletions(