RaghulDevaraj's picture
Create app.py
901b312 verified
raw
history blame
451 Bytes
from fastapi import FastAPI, File, UploadFile
from typing import List, Optional
import uvicorn
from pydantic import BaseModel
from uuid import uuid4
# App definition
app = FastAPI()
# Base model
class Options(BaseModel):
request_id: str
@app.post("/upload-files/")
async def _file_upload(request_id: str = str(uuid4()), files: List[UploadFile] = File(...)):
return {"request_id": request_id, "file_names": [file.filename for file in files]}