Spaces:
Running
Running
Yara Kyrychenko
commited on
Commit
·
721a5e3
1
Parent(s):
448fd59
pymonog upd
Browse files- app.py +3 -2
- requirements.txt +1 -1
app.py
CHANGED
@@ -212,13 +212,14 @@ def submit():
|
|
212 |
|
213 |
st.session_state.user_data["convo_end_time"] = datetime.now()
|
214 |
|
215 |
-
|
216 |
from pymongo.mongo_client import MongoClient
|
217 |
from pymongo.server_api import ServerApi
|
218 |
with MongoClient(st.secrets["mongo"],server_api=ServerApi('1')) as client:
|
219 |
db = client.chat
|
220 |
collection = db.app
|
221 |
-
|
|
|
222 |
st.session_state.inserted += 1
|
223 |
|
224 |
st.success('**Your conversation has been submitted! Please proceed with the survey.**', icon="✅")
|
|
|
212 |
|
213 |
st.session_state.user_data["convo_end_time"] = datetime.now()
|
214 |
|
215 |
+
st.write(st.session_state.user_data)
|
216 |
from pymongo.mongo_client import MongoClient
|
217 |
from pymongo.server_api import ServerApi
|
218 |
with MongoClient(st.secrets["mongo"],server_api=ServerApi('1')) as client:
|
219 |
db = client.chat
|
220 |
collection = db.app
|
221 |
+
data = st.session_state.user_data
|
222 |
+
collection.insert_one(data)
|
223 |
st.session_state.inserted += 1
|
224 |
|
225 |
st.success('**Your conversation has been submitted! Please proceed with the survey.**', icon="✅")
|
requirements.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
streamlit==1.40.0
|
2 |
-
pymongo[srv]==3.12
|
3 |
datetime==5.5
|
4 |
openai==1.55.3
|
5 |
together==1.4.1
|
|
|
1 |
streamlit==1.40.0
|
2 |
+
pymongo[srv]==4.11 #3.12
|
3 |
datetime==5.5
|
4 |
openai==1.55.3
|
5 |
together==1.4.1
|