Skip to content
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

Streaming Issues: Duplicate Values Displayed #30

Open
shamuiscoding opened this issue Jul 7, 2024 · 1 comment
Open

Streaming Issues: Duplicate Values Displayed #30

shamuiscoding opened this issue Jul 7, 2024 · 1 comment

Comments

@shamuiscoding
Copy link

shamuiscoding commented Jul 7, 2024

image
image

I'm using this repo to build a RAG chatbot for my docs.
from the LangSmith monitor I see the generation is doing fine.
but when i stream to the frontend, it has a weird error of duplicating values.
i'm trying to fix it and would love some help.

I'm on the most recent deployment of the repo.
followed all instructions, so i have a weaviate vector db setup

@shamuiscoding
Copy link
Author

shamuiscoding commented Jul 7, 2024

I did end up filtering out the duplicated values.

if (Array.isArray(streamedResponse?.streamed_output)) {
          const uniqueList = streamedResponse.streamed_output.reduce((acc, item) => {
            if (!acc.includes(item)) {
              acc.push(item);
            }
            return acc;
          }, []);

          accumulatedMessage = uniqueList.join("");
        }

but I'm curious if this is the best way to handle this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant