fix: 修复编译错误

This commit is contained in:
Hk-Gosuto 2023-07-22 15:46:28 +08:00
parent 2bb421b8bf
commit 08d53ef0a6

View File

@ -25,7 +25,7 @@ export interface ChatToolMessage {
export type ChatMessage = RequestMessage & { export type ChatMessage = RequestMessage & {
date: string; date: string;
toolMessages: ChatToolMessage[]; toolMessages?: ChatToolMessage[];
streaming?: boolean; streaming?: boolean;
isError?: boolean; isError?: boolean;
id: string; id: string;
@ -299,6 +299,7 @@ export const useChatStore = create<ChatStore>()(
role: "assistant", role: "assistant",
streaming: true, streaming: true,
model: modelConfig.model, model: modelConfig.model,
toolMessages: [],
}); });
// get recent messages // get recent messages
@ -333,7 +334,7 @@ export const useChatStore = create<ChatStore>()(
onToolUpdate(toolName, toolInput) { onToolUpdate(toolName, toolInput) {
botMessage.streaming = true; botMessage.streaming = true;
if (toolName && toolInput) { if (toolName && toolInput) {
botMessage.toolMessages.push({ botMessage.toolMessages!.push({
toolName, toolName,
toolInput, toolInput,
}); });