Git Product home page Git Product logo

Comments (5)

rogalvil avatar rogalvil commented on August 23, 2024 2

Yes of course, let me try to implement this issue

from lanarky.

ajndkr avatar ajndkr commented on August 23, 2024

Hi! do you maybe have an example of the output?

note that I have recently added a new response class for RetrievalQA. I haven't tested if it works with RetrievalQAWithSourcesChain yet.

from fastapi_async_langchain.responses import RetrievalQAStreamingResponse

AFAIK, the sources are added in the end by the LLM so it should be accessible by the on_llm_new_token method of the callback class.

from lanarky.

rogalvil avatar rogalvil commented on August 23, 2024

My output is this, I get sources on last part of message but I would like get page content as is get when return_source_documents is true.

Captura de pantalla 2023-04-25 a la(s) 13 21 10

Captura de pantalla 2023-04-25 a la(s) 13 20 15

from lanarky.

ajndkr avatar ajndkr commented on August 23, 2024

gotcha! one idea I have is to update the on_chain_end method of the AsyncFastApiStreamingCallback class and stream the source documents using the send attribute. Similar to what the on_llm_new_token method does.

Since this is an interesting feature, would you like to contribute?

from lanarky.

ajndkr avatar ajndkr commented on August 23, 2024

@rogalvil your changes have been published in 0.3.2. Please check if everything is working as expected. If all good, please close this issue. cheers!

from lanarky.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.