Make a change to test neo4j
This commit is contained in:
parent
523f893c5b
commit
98383b74ad
1 changed files with 12 additions and 2 deletions
14
api.py
14
api.py
|
|
@ -63,8 +63,6 @@ def health_check():
|
||||||
return {"status": "OK"}
|
return {"status": "OK"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Payload(BaseModel):
|
class Payload(BaseModel):
|
||||||
payload: Dict[str, Any]
|
payload: Dict[str, Any]
|
||||||
|
|
||||||
|
|
@ -159,6 +157,18 @@ async def user_query_classfier(payload: Payload):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise HTTPException(status_code=500, detail=str(e))
|
raise HTTPException(status_code=500, detail=str(e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@app.post("/drop-db")
|
||||||
|
async def drop_db(payload: Payload):
|
||||||
|
try:
|
||||||
|
decoded_payload = payload.payload
|
||||||
|
return JSONResponse(content={"response": "dropped"}, status_code=200)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
return HTTPException(status_code=500, detail=str(e))
|
||||||
|
|
||||||
|
|
||||||
def start_api_server(host: str = "0.0.0.0", port: int = 8000):
|
def start_api_server(host: str = "0.0.0.0", port: int = 8000):
|
||||||
"""
|
"""
|
||||||
Start the API server using uvicorn.
|
Start the API server using uvicorn.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue