Skip to content

Commit

Permalink
fix token duplication in frontend (#301)
Browse files Browse the repository at this point in the history
applyPatch modifies the document so every token got added twice to the stream

Signed-off-by: Peter Suti <[email protected]>
  • Loading branch information
spatker authored May 22, 2024
1 parent 7f32ac5 commit 6c8478d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/app/components/ChatWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export function ChatWindow(props: { conversationId: string }) {
},
);
for await (const chunk of streamLog) {
streamedResponse = applyPatch(streamedResponse, chunk.ops).newDocument;
streamedResponse = applyPatch(streamedResponse, chunk.ops, undefined, false).newDocument;
if (
Array.isArray(
streamedResponse?.logs?.[sourceStepName]?.final_output?.output,
Expand Down

0 comments on commit 6c8478d

Please sign in to comment.