@app.post("/imagecaption/") async def caption_from_frontend(file: UploadFile = File(...)): try: # Process image and generate caption caption = "This would be your generated image caption" audio_path = "/files/caption_audio.mp3" # Generated audio path return { "answer": caption, "audio": audio_path } except Exception as e: return JSONResponse( {"detail": str(e)}, status_code=500 )