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