You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
input_prompt=f"This is user asking : {user_input}\n\n based on what user asked, this is the sleep data: {str(sleep_data)}\n\n Give me short quantified answer in 1 to 5 lines only based on the sleep data: "
39
+
returnmodel.generate_content(input_prompt).text
40
+
41
+
defmain():
42
+
"""Main function to run the app."""
43
+
st.title('The Quantified Self Chat')
44
+
model=configure_model()
45
+
sleep_data=load_data()
46
+
47
+
ifsleep_dataisnotNone:
48
+
49
+
st.subheader('Sleep dataset')
50
+
st.write(pd.DataFrame.from_dict(sleep_data))
51
+
52
+
# Initialize session state for chat history
53
+
if'chat_history'notinst.session_state:
54
+
st.session_state['chat_history'] = []
55
+
56
+
user_input=st.text_input("Ask Questions", "")
57
+
58
+
ifst.button("Submit"): # Check if user input is not empty
0 commit comments