Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,7 @@ from itertools import combinations
|
|
| 9 |
import sqlite3
|
| 10 |
import pandas as pd
|
| 11 |
import os
|
|
|
|
| 12 |
|
| 13 |
# Define FastAPI app
|
| 14 |
app = FastAPI()
|
|
@@ -254,6 +255,16 @@ def pass2llm(query: DiseaseDetail):
|
|
| 254 |
else:
|
| 255 |
return {"message": "Failed to get public URL from Ngrok!", "error": response.text}
|
| 256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 257 |
# To run the FastAPI app with Uvicorn
|
| 258 |
# if __name__ == "__main__":
|
| 259 |
# uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
|
|
| 9 |
import sqlite3
|
| 10 |
import pandas as pd
|
| 11 |
import os
|
| 12 |
+
import time
|
| 13 |
|
| 14 |
# Define FastAPI app
|
| 15 |
app = FastAPI()
|
|
|
|
| 255 |
else:
|
| 256 |
return {"message": "Failed to get public URL from Ngrok!", "error": response.text}
|
| 257 |
|
| 258 |
+
|
| 259 |
+
|
| 260 |
+
|
| 261 |
+
@app.post("/trigger-reload")
|
| 262 |
+
async def trigger_reload():
|
| 263 |
+
# Update the timestamp of a dummy file to trigger reload
|
| 264 |
+
with open("reload_trigger.txt", "w") as f:
|
| 265 |
+
f.write(f"Trigger reload at {time.time()}")
|
| 266 |
+
return {"message": "Reload triggered."}
|
| 267 |
+
|
| 268 |
# To run the FastAPI app with Uvicorn
|
| 269 |
# if __name__ == "__main__":
|
| 270 |
# uvicorn.run(app, host="0.0.0.0", port=8000)
|