Find answers from the community

Updated 2 months ago

Second question : in order to correct

Second question : in order to correct wrong answers or "I don’t know" answers, I would like to allow my users to enter the correct response in a streamlit text area:

Plain Text
correction = st.text_area("A mistake ? Correct me here.")
  correct_button=st.button('Send')
  if (correct_button==True):
      new_document = Document(
          text=correction,
          metadata={"correction": "True"},
      )
      index.insert(document = new_document)
      index.storage_context.persist()
      query_engine = index.as_query_engine()


This code snippet doesn’t seem to work though. The index is updated, I can see the new document in it. But the chatbot keeps saying it doesn’t know the answer to the question.
L
1 comment
Probably, either the new document is not being retrieved when the user asks a question again, or the LLM is just not interpreting the correction well

I might be good to store these as a Q&A kind of format

text="Q: ...\nA: ...."
Add a reply
Sign up and join the conversation on Discord