mirror of
https://github.com/benitomartin/scale-gke-qdrant-llama.git
synced 2025-12-17 02:54:25 +01:00
25 lines
577 B
Python
25 lines
577 B
Python
import streamlit as st
|
|
import requests
|
|
|
|
# Set the FastAPI endpoint
|
|
FASTAPI_ENDPOINT = "http://34.65.157.134:8000/query/"
|
|
|
|
# Streamlit app title
|
|
st.title("Find Your Code")
|
|
|
|
# Input field for the query
|
|
query = st.text_input("Query:")
|
|
|
|
# Button to submit the query
|
|
if st.button("Get Response"):
|
|
if query:
|
|
response = requests.post(FASTAPI_ENDPOINT, json={"query": query})
|
|
if response.status_code == 200:
|
|
st.write(response.text)
|
|
else:
|
|
st.write("Error:", response.status_code)
|
|
else:
|
|
st.write("Please enter a query.")
|
|
|
|
|