Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -203,16 +203,17 @@ with col2:
|
|
203 |
st.session_state["user_input"] = "How to implement DEI?"
|
204 |
|
205 |
# User input in Streamlit
|
206 |
-
user_input = st.text_input("Describe your policy or project to find relevant Lab Lab projects...")
|
207 |
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
|
213 |
-
|
214 |
|
215 |
# add the submissions as context (only in prompt, not in history)
|
|
|
216 |
prompt = st.session_state["user_input"] + ". For a project share the image as markdown and mention the url as well. The context for the question: " + grounding;
|
217 |
messages = st.session_state.messages.copy()
|
218 |
messages.append({"role": "user", "content": prompt})
|
@@ -223,5 +224,5 @@ if st.session_state["user_input"]:
|
|
223 |
assistant_reply = IBM_chat(messages)
|
224 |
|
225 |
# Display assistant message
|
226 |
-
st.chat_message("assistant").markdown(assistant_reply)
|
227 |
st.session_state.messages.append({"role": "assistant", "content": assistant_reply})
|
|
|
203 |
st.session_state["user_input"] = "How to implement DEI?"
|
204 |
|
205 |
# User input in Streamlit
|
206 |
+
st.session_state["user_input"] = st.text_input("Describe your policy or project to find relevant Lab Lab projects...")
|
207 |
|
208 |
+
# Display chat history
|
209 |
+
#for message in st.session_state.messages:
|
210 |
+
# with st.chat_message(message["role"]):
|
211 |
+
# st.markdown(message["content"])
|
212 |
|
213 |
+
if st.session_state["user_input"]:
|
214 |
|
215 |
# add the submissions as context (only in prompt, not in history)
|
216 |
+
grounding = proximity_search(st.session_state["user_input"])
|
217 |
prompt = st.session_state["user_input"] + ". For a project share the image as markdown and mention the url as well. The context for the question: " + grounding;
|
218 |
messages = st.session_state.messages.copy()
|
219 |
messages.append({"role": "user", "content": prompt})
|
|
|
224 |
assistant_reply = IBM_chat(messages)
|
225 |
|
226 |
# Display assistant message
|
227 |
+
#st.chat_message("assistant").markdown(assistant_reply)
|
228 |
st.session_state.messages.append({"role": "assistant", "content": assistant_reply})
|