r/madeinpython • u/autosur00 • 42m ago
Built a FastAPI service for B2B lead scoring and outreach generation with Pytest
Hey everyone — I put together autodev-dispatcher, a lightweight FastAPI service for scoring B2B leads and generating personalized outreach messages, backed by a Pytest test suite.
How it works:
- API & Schema Validation: FastAPI endpoints using Pydantic v2 models to validate incoming lead/context payloads and keep request/response shapes predictable.
- Scoring & Template Logic: Separated lead scoring and message/template generation from the HTTP route handlers so rules and templates can be adjusted cleanly.
- Testing: Pytest tests covering valid payloads, validation/error handling, and template/scoring behavior.
Repo:https://github.com/autosur00/autodev-dispatcher
Still iterating on how to keep template/prompt logic and test fixtures clean as the service grows—would love any feedback or thoughts on how you structure similar FastAPI services.