diff --git a/app/store/chat.ts b/app/store/chat.ts index 86de998364b..968d8cb6422 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -615,6 +615,7 @@ export const useChatStore = createPersistStore( providerName, }, onFinish(message) { + if (!isValidMessage(message)) return; get().updateCurrentSession( (session) => (session.topic = @@ -690,6 +691,10 @@ export const useChatStore = createPersistStore( }, }); } + + function isValidMessage(message: any): boolean { + return typeof message === "string" && !message.startsWith("```json"); + } }, updateStat(message: ChatMessage) {