Skip to content
Open
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
9 changes: 3 additions & 6 deletions backend/src/agent/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from agent.models import GEMINI_PRO

# Module-level cache for the judge model instance
_judge_model_cache: Optional[ChatGoogleGenerativeAI] = None
_judge_model_cache: ChatGoogleGenerativeAI | None = None


def _get_judge_model() -> ChatGoogleGenerativeAI:
Expand Down Expand Up @@ -74,8 +74,7 @@ class GroundednessScore(BaseModel):


def eval_quality(request: str, report: str) -> Dict[str, Any]:
"""
Evaluates the overall quality of a research report.
"""Evaluates the overall quality of a research report.

Args:
request: The original user research request.
Expand Down Expand Up @@ -106,9 +105,7 @@ def eval_quality(request: str, report: str) -> Dict[str, Any]:


def eval_groundedness(report: str, sources: List[str]) -> Dict[str, Any]:
"""
Evaluates how well the report is grounded in the provided sources.
"""
"""Evaluates how well the report is grounded in the provided sources."""
# Simplified placeholder for groundedness logic
# In a real scenario, this would involve extracting claims and checking them against summaries
prompt = ChatPromptTemplate.from_messages(
Expand Down