File size: 511 Bytes
2a3c721 48792c7 2a3c721 48792c7 2a3c721 48792c7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import streamlit as st
from chatbot import process_query # Import your chatbot function
# Use st.query_params instead of st.experimental_get_query_params
user_input = st.query_params.get("user_input", [""])[0]
if user_input:
response = process_query(user_input)
# Display as JSON for HTTP GET request
st.json({"response": response})
else:
# Default UI if no query is passed
st.title("Chatbot")
st.write("Enter a query in the URL as ?user_input=your_question to get a JSON response.")
|