Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -653,6 +653,15 @@ def summarize_text(text):
|
|
653 |
print(f"Error in summarization: {str(e)}")
|
654 |
return "Summarization failed. Please try again later."
|
655 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
656 |
@app.post("/analyze_legal_document")
|
657 |
async def analyze_legal_document(
|
658 |
file: UploadFile = File(...),
|
@@ -964,10 +973,7 @@ async def api_login(email: str, password: str):
|
|
964 |
)
|
965 |
return result
|
966 |
|
967 |
-
|
968 |
-
def health_check():
|
969 |
-
"""Simple health check endpoint to verify the API is running"""
|
970 |
-
return {"status": "ok", "message": "API is running"}
|
971 |
|
972 |
@app.get("/users/me", response_model=User)
|
973 |
async def read_users_me(current_user: User = Depends(get_current_active_user)):
|
@@ -1383,9 +1389,7 @@ async def verify_subscription(
|
|
1383 |
print(f"Subscription verification error: {str(e)}")
|
1384 |
raise HTTPException(status_code=500, detail=f"Subscription verification failed: {str(e)}")
|
1385 |
|
1386 |
-
|
1387 |
-
def health_check():
|
1388 |
-
return {"status": "ok", "message": "API is running"}
|
1389 |
|
1390 |
@app.post("/webhook/paypal")
|
1391 |
async def paypal_webhook(request: Request):
|
|
|
653 |
print(f"Error in summarization: {str(e)}")
|
654 |
return "Summarization failed. Please try again later."
|
655 |
|
656 |
+
from fastapi import FastAPI
|
657 |
+
|
658 |
+
app = FastAPI()
|
659 |
+
|
660 |
+
@app.get("/health")
|
661 |
+
def health_check():
|
662 |
+
return {"status": "ok", "message": "API is running"}
|
663 |
+
|
664 |
+
|
665 |
@app.post("/analyze_legal_document")
|
666 |
async def analyze_legal_document(
|
667 |
file: UploadFile = File(...),
|
|
|
973 |
)
|
974 |
return result
|
975 |
|
976 |
+
|
|
|
|
|
|
|
977 |
|
978 |
@app.get("/users/me", response_model=User)
|
979 |
async def read_users_me(current_user: User = Depends(get_current_active_user)):
|
|
|
1389 |
print(f"Subscription verification error: {str(e)}")
|
1390 |
raise HTTPException(status_code=500, detail=f"Subscription verification failed: {str(e)}")
|
1391 |
|
1392 |
+
|
|
|
|
|
1393 |
|
1394 |
@app.post("/webhook/paypal")
|
1395 |
async def paypal_webhook(request: Request):
|