mathslearn commited on
Commit
080443f
·
verified ·
1 Parent(s): 543a677

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -10,7 +10,17 @@ from streamlit_chat import message
10
  from PIL import Image
11
 
12
  st.title("Nexus TCM Chatbot")
13
- query = st.text_input("Query: ", key="input")
 
 
 
 
 
 
 
 
 
 
14
 
15
  # Set the logo URL
16
  #logo_url = "https://huggingface.co/spaces/mathslearn/chatbot_test_streamlit/blob/main/logo.jpeg"
 
10
  from PIL import Image
11
 
12
  st.title("Nexus TCM Chatbot")
13
+ #query = st.text_input("Query: ", key="input")
14
+
15
+ # Create the search bar with on_change event
16
+ query = st.text_input("Query:", key="input", on_change=clear_query_on_change)
17
+
18
+ # Check if the user has entered a new query
19
+ if query:
20
+ st.session_state.input = query # Save the input to session state
21
+ # Your logic for processing the query and generating a response goes here
22
+ response = f"User entered: {query}"
23
+ st.write(response)
24
 
25
  # Set the logo URL
26
  #logo_url = "https://huggingface.co/spaces/mathslearn/chatbot_test_streamlit/blob/main/logo.jpeg"