Git Product home page Git Product logo

Comments (8)

marella avatar marella commented on June 5, 2024 3

I will look into this. If the performance is good, I will make it as default, otherwise will add a config option to enable this.
It will also solve #22

from chatdocs.

Ananderz avatar Ananderz commented on June 5, 2024 2

Looking forward to this @marella . Is this still on your to do?

from chatdocs.

marella avatar marella commented on June 5, 2024 1

Hi, yes. I was out of station with a slow internet for the past few days, so the progress has slowed down. I will start looking into the pending issues next week.

from chatdocs.

Ananderz avatar Ananderz commented on June 5, 2024

Hi, yes. I was out of station with a slow internet for the past few days, so the progress has slowed down. I will start looking into the pending issues next week.

Great to have you back @marella

from chatdocs.

Ananderz avatar Ananderz commented on June 5, 2024

@marella been trying to implement this function on my own. I think I might almost be there and have it functional. The problem is that I can't get it to remember the prompt, only the answer of the prompt so far. Let me know if you want to see my changes.

from chatdocs.

marella avatar marella commented on June 5, 2024

Great! Please share link to your repo/branch.

from chatdocs.

Ananderz avatar Ananderz commented on June 5, 2024

I did this @marella

Here is my chains.py:

from typing import Any, Callable, Dict, Optional

from langchain.chains import ConversationalRetrievalChain
from langchain.memory import ConversationBufferMemory

from .llms import get_llm
from .vectorstores import get_vectorstore

def get_retrieval_qa(
    config: Dict[str, Any],
    *,
    callback: Optional[Callable[[str], None]] = None,
) -> ConversationalRetrievalChain:
    db = get_vectorstore(config)
    retriever = db.as_retriever(**config["retriever"])
    llm = get_llm(config, callback=callback)
    memory=ConversationBufferMemory(memory_key="chat_history", return_messages=True, input_key="question", output_key="answer")
    return ConversationalRetrievalChain.from_llm(
        llm=llm,
        retriever=retriever,
        return_source_documents=True,
        memory=memory,
    )

In Index.html I changed this:

answer.innerText = res.result; --> answer.innerText = res.answer;

In ui.py I changed this:
res["result"] = data["result"] --> res["answer"] = data["answer"]

from chatdocs.

Ananderz avatar Ananderz commented on June 5, 2024

It repeats the question before it gives an answer and then the repeated question is just removed

from chatdocs.

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.