File size: 628 Bytes
0d83986
 
6be72e5
 
 
 
 
094c949
6be72e5
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@app.post("/summarize/")
async def summarize_api(file: UploadFile = File(...), length: str = Form("medium")):
    try:
        # Process document and generate summary
        summary = "This would be your generated summary text"
        audio_url = "/files/summary_audio.mp3"  # Generated audio path
        pdf_url = "/files/summary.pdf"         # Generated PDF path
        
        return {
            "summary": summary,
            "audio_url": audio_url,
            "pdf_url": pdf_url
        }
    except Exception as e:
        return JSONResponse(
            {"detail": str(e)},
            status_code=500
        )