Chainlit / cookbook

Chainlit's cookbook repo
https://github.com/Chainlit/chainlit
726 stars 270 forks source link

`chain_type_kwargs` not used in chroma-qa-chat #28

Closed Uranium2 closed 11 months ago

Uranium2 commented 11 months ago

Hello,

In the file chroma-qa-chat/app.py, all the block with the system_template/messages/prompt/chain_type_kwargs are not used in RetrievalQAWithSourcesChain.from_chain_type

    # Create a chain that uses the Chroma vector store
    chain = RetrievalQAWithSourcesChain.from_chain_type(
        ChatOpenAI(temperature=0, streaming=True),
        chain_type="stuff",
        retriever=docsearch.as_retriever(),
    )

Needs to change to :

    # Create a chain that uses the Chroma vector store
    chain = RetrievalQAWithSourcesChain.from_chain_type(
        ChatOpenAI(temperature=0, streaming=True),
        chain_type="stuff",
        retriever=docsearch.as_retriever(),
       chain_type_kwargs=chain_type_kwargs,
    )

Else it is taking the default prompts with no history messages.

willydouhard commented 11 months ago

Nice catch, just fixed it!