Skip to content

Commit 6c8478d

Browse files
authored
fix token duplication in frontend (#301)
applyPatch modifies the document so every token got added twice to the stream Signed-off-by: Peter Suti <[email protected]>
1 parent 7f32ac5 commit 6c8478d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/app/components/ChatWindow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function ChatWindow(props: { conversationId: string }) {
132132
},
133133
);
134134
for await (const chunk of streamLog) {
135-
streamedResponse = applyPatch(streamedResponse, chunk.ops).newDocument;
135+
streamedResponse = applyPatch(streamedResponse, chunk.ops, undefined, false).newDocument;
136136
if (
137137
Array.isArray(
138138
streamedResponse?.logs?.[sourceStepName]?.final_output?.output,

0 commit comments

Comments
 (0)