New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix token duplication in frontend #301
Conversation
applyPatch modifies the document so every token got added twice to the stream Signed-off-by: Peter Suti <spatker@gmail.com>
@spatker is attempting to deploy a commit to the LangChain Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍😘✌️
streamedResponse = applyPatch(streamedResponse, chunk.ops).newDocument; | ||
streamedResponse = applyPatch(streamedResponse, chunk.ops, undefined, false).newDocument; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traducción
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@😘
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traidora
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traidora
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traducción
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thank you @spatker! |
applyPatch modifies the document so every token got added twice to the stream
Fixes: #300