Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -37,14 +37,16 @@ if st.session_state.stage == "crawl-input":
|
|
37 |
st.session_state.stage = "remove-crawl-input-widgets"
|
38 |
|
39 |
if st.session_state.stage == "prompt-input":
|
40 |
-
for message in st.session_state.messages:
|
41 |
-
with st.chat_message(message["role"]):
|
42 |
-
st.markdown(message)
|
43 |
prompt = st.chat_input("Ask the documentation a question!")
|
44 |
|
45 |
if prompt:
|
|
|
|
|
|
|
|
|
46 |
with st.chat_message("user"):
|
47 |
st.markdown(prompt)
|
|
|
48 |
st.session_state.messages.append({"role":"user","message":prompt})
|
49 |
results = st.session_state.collection.query(query_texts=[prompt],n_results=5)
|
50 |
infos = results["documents"][0]
|
|
|
37 |
st.session_state.stage = "remove-crawl-input-widgets"
|
38 |
|
39 |
if st.session_state.stage == "prompt-input":
|
|
|
|
|
|
|
40 |
prompt = st.chat_input("Ask the documentation a question!")
|
41 |
|
42 |
if prompt:
|
43 |
+
for message in st.session_state.messages:
|
44 |
+
with st.chat_message(message["role"]):
|
45 |
+
st.markdown(message)
|
46 |
+
|
47 |
with st.chat_message("user"):
|
48 |
st.markdown(prompt)
|
49 |
+
|
50 |
st.session_state.messages.append({"role":"user","message":prompt})
|
51 |
results = st.session_state.collection.query(query_texts=[prompt],n_results=5)
|
52 |
infos = results["documents"][0]
|