File size: 523 Bytes
2a3c721
9de7e50
2a3c721
 
 
 
9de7e50
2a3c721
 
9de7e50
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import streamlit as st
import httpx

st.title("Kivy Chatbot Backend")

user_input = st.text_input("Ask a question:")

if st.button("Get Response"):
    if user_input:
        # Make a POST request to the FastAPI /predict endpoint
        url = "http://localhost:8000/predict"  # Assuming FastAPI is running locally or use the correct URL
        response = httpx.post(url, json={"input": user_input})
        bot_response = response.json().get("response", "No response found")
        st.write(f"Response: {bot_response}")