We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9bbd7d3 + e8581c8 commit 4c84182Copy full SHA for 4c84182
app/store/chat.ts
@@ -615,6 +615,7 @@ export const useChatStore = createPersistStore(
615
providerName,
616
},
617
onFinish(message) {
618
+ if (!isValidMessage(message)) return;
619
get().updateCurrentSession(
620
(session) =>
621
(session.topic =
@@ -690,6 +691,10 @@ export const useChatStore = createPersistStore(
690
691
692
});
693
}
694
+
695
+ function isValidMessage(message: any): boolean {
696
+ return typeof message === "string" && !message.startsWith("```json");
697
+ }
698
699
700
updateStat(message: ChatMessage) {
0 commit comments