|
|
@@ -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) {
|