Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- app/streamlit_app.py +1 -1
- main.py +8 -0
app/streamlit_app.py
CHANGED
|
@@ -2,7 +2,7 @@ import streamlit as st
|
|
| 2 |
import requests
|
| 3 |
import datetime
|
| 4 |
|
| 5 |
-
BASE_URL = "https://mishrabp-trip-advisor-api.hf.space/
|
| 6 |
|
| 7 |
# Set up Streamlit page configuration
|
| 8 |
st.set_page_config(
|
|
|
|
| 2 |
import requests
|
| 3 |
import datetime
|
| 4 |
|
| 5 |
+
BASE_URL = "https://mishrabp-trip-advisor-api.hf.space/" # Backend endpoint
|
| 6 |
|
| 7 |
# Set up Streamlit page configuration
|
| 8 |
st.set_page_config(
|
main.py
CHANGED
|
@@ -23,6 +23,14 @@ app.add_middleware(
|
|
| 23 |
class QueryRequest(BaseModel):
|
| 24 |
question: str
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
@app.post("/query")
|
| 27 |
async def query_travel_agent(query: QueryRequest):
|
| 28 |
try:
|
|
|
|
| 23 |
class QueryRequest(BaseModel):
|
| 24 |
question: str
|
| 25 |
|
| 26 |
+
@app.get("/")
|
| 27 |
+
async def health_check():
|
| 28 |
+
return {
|
| 29 |
+
"status": "healthy",
|
| 30 |
+
"timestamp": datetime.datetime.now().isoformat(),
|
| 31 |
+
"service": "ai-trip-planner-api"
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
@app.post("/query")
|
| 35 |
async def query_travel_agent(query: QueryRequest):
|
| 36 |
try:
|