Spaces:
Sleeping
Sleeping
John Graham Reynolds
commited on
Commit
Β·
7e2c9a0
1
Parent(s):
8f87ab7
move location of container
Browse files
app.py
CHANGED
@@ -72,19 +72,19 @@ def clear_chat_history():
|
|
72 |
st.button('Clear Chat', on_click=clear_chat_history)
|
73 |
|
74 |
def feedback():
|
75 |
-
with st.container():
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
# # Save the feedback data
|
89 |
# if st.button("Submit"):
|
90 |
# with open("feedback.json", "a") as f:
|
@@ -254,7 +254,8 @@ with main:
|
|
254 |
if prompt := st.chat_input("Type a message!", max_chars=5000):
|
255 |
handle_user_input(prompt)
|
256 |
st.markdown("\n") #add some space for iphone users
|
257 |
-
st.
|
|
|
258 |
|
259 |
with st.sidebar:
|
260 |
with st.container():
|
|
|
72 |
st.button('Clear Chat', on_click=clear_chat_history)
|
73 |
|
74 |
def feedback():
|
75 |
+
# with st.container():
|
76 |
+
sentiment_mapping = [":material/thumb_down:", ":material/thumb_up:"]
|
77 |
+
rating = st.feedback()
|
78 |
+
# feedback = ""
|
79 |
+
review = {}
|
80 |
+
if rating is not None:
|
81 |
+
# st.markdown(f"You selected: {sentiment_mapping[rating]}")
|
82 |
+
feedback = st.text_input(f"Please detail your rationale for choosing {sentiment_mapping[rating]}: ", "")
|
83 |
+
# rating = st.radio("Rate your experience:", ["π", "Neutral", "π"])
|
84 |
+
review = {"rating": {rating}, "feedback": {feedback}}
|
85 |
+
|
86 |
+
st.markdown(review)
|
87 |
+
time.sleep(5)
|
88 |
# # Save the feedback data
|
89 |
# if st.button("Submit"):
|
90 |
# with open("feedback.json", "a") as f:
|
|
|
254 |
if prompt := st.chat_input("Type a message!", max_chars=5000):
|
255 |
handle_user_input(prompt)
|
256 |
st.markdown("\n") #add some space for iphone users
|
257 |
+
with st.container:
|
258 |
+
st.button('Give Feedback on Last Response', on_click=feedback)
|
259 |
|
260 |
with st.sidebar:
|
261 |
with st.container():
|