Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -334,27 +334,25 @@ def main():
|
|
334 |
|
335 |
s1, s2, s3 = st.columns([1, 1, 1])
|
336 |
|
337 |
-
|
338 |
|
339 |
with s1:
|
340 |
if st.button(choice1, use_container_width=True):
|
341 |
-
|
342 |
|
343 |
with s2:
|
344 |
if st.button(choice2, use_container_width=True):
|
345 |
-
|
346 |
|
347 |
with s3:
|
348 |
if st.button(choice3, use_container_width=True):
|
349 |
-
|
350 |
|
351 |
-
|
352 |
-
if not user_input:
|
353 |
-
user_input = st.chat_input("Ask me anything")
|
354 |
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
|
359 |
|
360 |
if __name__ == "__main__":
|
|
|
334 |
|
335 |
s1, s2, s3 = st.columns([1, 1, 1])
|
336 |
|
337 |
+
user_suggested_input = None
|
338 |
|
339 |
with s1:
|
340 |
if st.button(choice1, use_container_width=True):
|
341 |
+
user_suggested_input = choice1
|
342 |
|
343 |
with s2:
|
344 |
if st.button(choice2, use_container_width=True):
|
345 |
+
user_suggested_input = choice2
|
346 |
|
347 |
with s3:
|
348 |
if st.button(choice3, use_container_width=True):
|
349 |
+
user_suggested_input = choice3
|
350 |
|
351 |
+
user_input = st.chat_input("Ask me anything")
|
|
|
|
|
352 |
|
353 |
+
|
354 |
+
with st.spinner('Generating Response...'):
|
355 |
+
response = handle_chat(user_prompt, user_suggested_input or user_input, teapot_ai)
|
356 |
|
357 |
|
358 |
if __name__ == "__main__":
|