Skip to content

feat: Evaluate and enhance evaluation framework refactor #1245

Description

@MervinPraison

Summary

The eval/ module already has 15 files with a comprehensive evaluation framework. Audit what exists, identify gaps, and enhance — do NOT replace.

Current State (DO NOT modify these unless fixing bugs)

eval/__init__.py    (177 lines) — exports
eval/accuracy.py    (199 lines) — AccuracyEval
eval/base.py        (115 lines) — BaseEval
eval/criteria.py    (238 lines) — EvalCriteria
eval/grader.py      (326 lines) — Grader
eval/judge.py       (781 lines) — JudgeEval
eval/loop.py        (239 lines) — EvalLoop
eval/media.py       (479 lines) — MediaEval
eval/package.py     (168 lines) — packaging
eval/performance.py (158 lines) — PerformanceEval
eval/protocols.py   (300 lines) — EvalProtocol
eval/reliability.py (196 lines) — ReliabilityEval
eval/results.py     (735 lines) — EvalResult
eval/tokens.py      (299 lines) — TokenEval
eval/utils.py       (100 lines) — utilities

Requirements

Step 1: Audit

  • Review ALL existing eval/ files
  • Document what each evaluator does and its API
  • Identify gaps: what eval capabilities are missing?

Step 2: Fill Gaps (likely needed)

  • EvalSuite — orchestrator that runs multiple evals and aggregates results
  • CLI integrationpraisonai eval run command support
  • Comparison eval — compare two agent outputs side-by-side
  • Safety eval — detect harmful/biased outputs
  • Unit tests — comprehensive tests for existing evaluators

Step 3: Add Tests

Create tests/unit/eval/ directory with tests for:

  • Each evaluator class (accuracy, reliability, performance, judge, media)
  • EvalSuite orchestration
  • EvalResult aggregation
  • Protocol compliance

Architecture Rules

  1. Use from praisonaiagents._logging import get_logger for logging
  2. Follow existing EvalProtocol in eval/protocols.py for new evaluators
  3. All optional deps (if any) must be lazy-imported
  4. Naming: XEval for evaluator classes, EvalX for infrastructure
  5. Do NOT rewrite existing files — only ADD new files or fix bugs in existing ones

Verification

# All existing tests must pass
pytest tests/unit/ -q --timeout=30

# Import test
python -c "
from praisonaiagents.eval import AccuracyEval, ReliabilityEval, PerformanceEval
print('Eval imports OK')
"

# Real agentic test
python -c "
from praisonaiagents import Agent
from praisonaiagents.eval import AccuracyEval
agent = Agent(name='test', instructions='Answer factual questions')
result = agent.start('What is the capital of France?')
print('Agent result:', result)
"

Success Criteria

  • Audit document of existing eval capabilities
  • Any identified gaps filled with new files (not replacing existing)
  • Unit tests for eval module created
  • All existing 4473+ tests pass
  • Import time stays <200ms
  • Real agentic eval test works

Replaces stale PR #976.

Metadata

Metadata

Assignees

No one assigned

    Labels

    claudeAuto-trigger Claude analysis

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions