-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: Add Summary Engine Base Class #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughIntroduces a new abstract base class Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
backend/app/services/summary/summary_engine.py (2)
8-27: Good abstraction; consider tightening input typing for future extensibilityThe base class shape and docstring are clear and give a good extension point. Given you already anticipate “risk factors” and “agent confidence levels,” you might soon outgrow
data: Dict[str, Any]. Consider introducing a typed structure (e.g., aTypedDictor dataclass that the engine consumes) so concrete implementations share a stable contract instead of relying on ad‑hoc dict keys.
28-40: Clarify expectations around key alignment and error handling inbuild_final_summaryThe method signature looks good, but the docstring doesn’t say what happens if
nlg_outputsandscoreshave mismatched or missing keys, or whether implementations should assume alignment. Adding a brief note about expected invariants (e.g., keys must match; implementations should handle missing entries gracefully) will make subclass behavior more consistent.
|
The abstract methods in |
This PR introduces the foundational
SummaryEnginebase class, preparing the system for advanced report summarization.Changes
app/services/summary/to house summarization logic.summary_engine.pywith theSummaryEnginebase class.generate_scores(data)andbuild_final_summary(nlg_outputs, scores).Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.