LightRAG/lightrag/evaluation/__init__.py
clssck dd1413f3eb test(lightrag,examples): add prompt accuracy and quality tests
Add comprehensive test suites for prompt evaluation:
- test_prompt_accuracy.py: 365 lines testing prompt extraction accuracy
- test_prompt_quality_deep.py: 672 lines for deep quality analysis
- Refactor prompt.py to consolidate optimized variants (removed prompt_optimized.py)
- Apply ruff formatting and type hints across 30 files
- Update pyrightconfig.json for static type checking
- Modernize reproduce scripts and examples with improved type annotations
- Sync uv.lock dependencies
2025-12-05 16:39:52 +01:00

27 lines
682 B
Python

"""
LightRAG Evaluation Module
RAGAS-based evaluation framework for assessing RAG system quality.
Usage:
from lightrag.evaluation import RAGEvaluator
evaluator = RAGEvaluator()
results = await evaluator.run()
Note: RAGEvaluator is imported lazily to avoid import errors
when ragas/datasets are not installed.
"""
from typing import Any
__all__ = ['RAGEvaluator']
def __getattr__(name: str) -> Any:
"""Lazy import to avoid dependency errors when ragas is not installed."""
if name == 'RAGEvaluator':
from .eval_rag_quality import RAGEvaluator
return RAGEvaluator
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')