π Introducing PDFLyzer β an AI-powered PDF assistant!
Upload your PDFs, ask questions, and get contextual answers with RAG.
Built with Python, FastAPI, MongoDB, and Sentence Transformers.
Here's a quick look at it in action! π
#BuildInPublic#AI#RAG#Python
Not every task belongs inside an API request π
For long-running work, a queue and separate workers can be a better approach:
API β Queue β Worker β Processing
Also, FastAPI BackgroundTasks isn't a replacement for a proper job queue when you need retries and durability.
And it's not just for auth.
You can inject services, repositories, DB connections, config, etc.
Coming from Express, it's a different way of handling dependencies, but I'm starting to really like it.
Been getting into FastAPI's dependency injection lately π
Coming from Express, Depends() feels pretty neat:
@router.get("/me")
async def get_me(
current_user: User = Depends(get_current_user)
):
...
FastAPI handles resolving it before the endpoint runs.
This becomes especially relevant with FastAPI.
@app.get("/users")
async def get_users():
users = await fetch_users()
return users
Understanding what happens behind that async/await is much more useful than simply knowing the syntax.