Update app.py
Browse files
app.py
CHANGED
@@ -118,9 +118,12 @@ if prompt := st.chat_input("What are you looking to learn?"):
|
|
118 |
with st.chat_message("user"):
|
119 |
st.markdown(prompt)
|
120 |
|
|
|
|
|
|
|
121 |
# Assistant response generator with streaming effect
|
122 |
with st.chat_message("assistant"):
|
123 |
-
response = qa_chain({"question": prompt})
|
124 |
response_text = response["answer"]
|
125 |
|
126 |
# Simulate streaming response
|
|
|
118 |
with st.chat_message("user"):
|
119 |
st.markdown(prompt)
|
120 |
|
121 |
+
# Retrieve relevant context from the vector store based on user input
|
122 |
+
context = retriever.retrieve(prompt)
|
123 |
+
|
124 |
# Assistant response generator with streaming effect
|
125 |
with st.chat_message("assistant"):
|
126 |
+
response = qa_chain({"question": prompt, "context": context})
|
127 |
response_text = response["answer"]
|
128 |
|
129 |
# Simulate streaming response
|