Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
40 changes: 40 additions & 0 deletions backend/app/services/summary/summary_engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""
Base class for summary generation.
"""

from abc import ABC, abstractmethod
from typing import Any, Dict, List

class SummaryEngine(ABC):
"""
Abstract base class for generating summaries.
"""

@abstractmethod
def generate_scores(self, data: Dict[str, Any]) -> Dict[str, float]:
"""
Generates scores based on input data, preparing for integration with
risk factors and agent confidence levels.

Args:
data: A dictionary containing various data points from agents.

Returns:
A dictionary of scores, where keys are score names and values are
their corresponding float scores.
"""
pass

@abstractmethod
def build_final_summary(self, nlg_outputs: Dict[str, str], scores: Dict[str, float]) -> str:
"""
Builds the final summary using NLG outputs and generated scores.

Args:
nlg_outputs: A dictionary of natural language generation outputs from various agents.
scores: A dictionary of scores generated by the generate_scores method.

Returns:
A string representing the final comprehensive summary.
"""
pass