Spaces:
Runtime error
Runtime error
File size: 438 Bytes
d57b505 6afa36a 0433163 cdc5783 0433163 cdc5783 6afa36a a680719 6afa36a d57b505 cdc5783 d57b505 0433163 a680719 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
from fastapi import FastAPI
from pydantic import BaseModel
from summary import summarize
KEY = 'J9l#K4wP5h@2'
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
class SummaryReq(BaseModel):
key: str
id: str
text: str
@app.post("/summary/")
async def summary(request: SummaryReq):
if request.key != KEY:
return 'Unauthorized'
return summarize(request.id, request.text)
|