ignis-evaluation-test 1.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ignis_evaluation/__init__.py +7 -0
- ignis_evaluation/api/__init__.py +1 -0
- ignis_evaluation/api/config_paths.py +12 -0
- ignis_evaluation/api/main.py +100 -0
- ignis_evaluation/api/models.py +1091 -0
- ignis_evaluation/api/routers/__init__.py +5 -0
- ignis_evaluation/api/routers/analytics.py +346 -0
- ignis_evaluation/api/routers/bundles.py +113 -0
- ignis_evaluation/api/routers/chat.py +259 -0
- ignis_evaluation/api/routers/evaluate.py +781 -0
- ignis_evaluation/api/routers/health.py +39 -0
- ignis_evaluation/api/routers/metrics.py +30 -0
- ignis_evaluation/api/routers/projects.py +243 -0
- ignis_evaluation/api/routers/results.py +106 -0
- ignis_evaluation/bundle_registry/__init__.py +182 -0
- ignis_evaluation/bundle_registry/brand_voice.yaml +14 -0
- ignis_evaluation/bundle_registry/chatbot_quality.yaml +26 -0
- ignis_evaluation/bundle_registry/compliance_finance.yaml +11 -0
- ignis_evaluation/bundle_registry/core_quality.yaml +21 -0
- ignis_evaluation/bundle_registry/customer_support.yaml +21 -0
- ignis_evaluation/bundle_registry/production_monitor.yaml +7 -0
- ignis_evaluation/bundle_registry/rag_standard.yaml +38 -0
- ignis_evaluation/bundle_registry/safety_guard.yaml +14 -0
- ignis_evaluation/bundle_registry/summarization.yaml +11 -0
- ignis_evaluation/bundle_registry/validator.py +344 -0
- ignis_evaluation/configs/agent_config.yaml +14 -0
- ignis_evaluation/configs/answer_relevancy_config.yaml +12 -0
- ignis_evaluation/configs/boilerplate_config.yaml +203 -0
- ignis_evaluation/configs/bundle_config.yaml +23 -0
- ignis_evaluation/configs/chatapp_config.yaml +405 -0
- ignis_evaluation/configs/chatbot_config.yaml +15 -0
- ignis_evaluation/configs/code_generation_config.yaml +23 -0
- ignis_evaluation/configs/compliance_bundle_config.yaml +41 -0
- ignis_evaluation/configs/domain_config.yaml +35 -0
- ignis_evaluation/configs/eval_config.yaml +22 -0
- ignis_evaluation/configs/geval_bundle_config.yaml +207 -0
- ignis_evaluation/configs/geval_config.yaml +76 -0
- ignis_evaluation/configs/healthcare_config.yaml +35 -0
- ignis_evaluation/configs/pybot_config.yaml +27 -0
- ignis_evaluation/configs/rag_config.json +26 -0
- ignis_evaluation/configs/rag_config.yaml +32 -0
- ignis_evaluation/configs/rag_full_config.yaml +66 -0
- ignis_evaluation/configs/rag_hyperparams_config.yaml +51 -0
- ignis_evaluation/configs/summarization_config.yaml +35 -0
- ignis_evaluation/db/__init__.py +13 -0
- ignis_evaluation/db/analytics.py +1426 -0
- ignis_evaluation/db/connection.py +98 -0
- ignis_evaluation/db/reader.py +232 -0
- ignis_evaluation/db/writer.py +409 -0
- ignis_evaluation/eval_library/__init__.py +21 -0
- ignis_evaluation/eval_library/bundle_resolver.py +136 -0
- ignis_evaluation/eval_library/config_loader.py +243 -0
- ignis_evaluation/eval_library/conversational_runner.py +485 -0
- ignis_evaluation/eval_library/custom_deepeval_metrics.py +430 -0
- ignis_evaluation/eval_library/dataset_generator.py +335 -0
- ignis_evaluation/eval_library/decorator.py +520 -0
- ignis_evaluation/eval_library/metric_registry.py +755 -0
- ignis_evaluation/eval_library/paths.py +13 -0
- ignis_evaluation/eval_library/reporter.py +110 -0
- ignis_evaluation/eval_library/runner.py +892 -0
- ignis_evaluation/eval_library/scorer.py +60 -0
- ignis_evaluation/eval_library/test_case_schema.py +168 -0
- ignis_evaluation/main.py +47 -0
- ignis_evaluation/services/__init__.py +56 -0
- ignis_evaluation/services/dashboard_service.py +248 -0
- ignis_evaluation/services/evaluate_service.py +339 -0
- ignis_evaluation/services/health_service.py +69 -0
- ignis_evaluation/services/projects_service.py +259 -0
- ignis_evaluation/workers/__init__.py +1 -0
- ignis_evaluation/workers/eval_worker.py +650 -0
- ignis_evaluation_test-1.0.2.dist-info/METADATA +1149 -0
- ignis_evaluation_test-1.0.2.dist-info/RECORD +75 -0
- ignis_evaluation_test-1.0.2.dist-info/WHEEL +5 -0
- ignis_evaluation_test-1.0.2.dist-info/licenses/LICENSE +21 -0
- ignis_evaluation_test-1.0.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"""ignis_evaluation — Config-driven LLM evaluation framework powered by DeepEval."""
|
|
2
|
+
|
|
3
|
+
from ignis_evaluation.eval_library.decorator import ignis_eval # noqa: F401
|
|
4
|
+
from ignis_evaluation.eval_library.paths import PACKAGE_CONFIGS_DIR # noqa: F401
|
|
5
|
+
|
|
6
|
+
__version__ = "1.0.0"
|
|
7
|
+
__all__ = ["eval_library", "api", "db", "ignis_eval", "PACKAGE_CONFIGS_DIR"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""FastAPI evaluation service — Story 3."""
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""Shared config path helpers for API runtime.
|
|
4
|
+
|
|
5
|
+
Re-exports PACKAGE_CONFIGS_DIR from eval_library.paths so the api layer
|
|
6
|
+
has no independent path logic — single source of truth lives in eval_library.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from ignis_evaluation.eval_library.paths import PACKAGE_CONFIGS_DIR
|
|
10
|
+
|
|
11
|
+
# Alias kept so existing api router imports continue to work unchanged.
|
|
12
|
+
DEFAULT_CONFIGS_DIR = PACKAGE_CONFIGS_DIR
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
"""DeepEval Evaluation Service — FastAPI entry point.
|
|
4
|
+
|
|
5
|
+
Story 3: FastAPI Evaluation Service
|
|
6
|
+
|
|
7
|
+
Start the server:
|
|
8
|
+
cd C:\\deepeval_demo\\project
|
|
9
|
+
uvicorn api.main:app --reload --port 8000
|
|
10
|
+
|
|
11
|
+
Interactive docs:
|
|
12
|
+
http://localhost:8000/docs (Swagger UI)
|
|
13
|
+
http://localhost:8000/redoc (ReDoc)
|
|
14
|
+
|
|
15
|
+
Endpoints:
|
|
16
|
+
GET / root / service info
|
|
17
|
+
GET /health liveness + readiness (Task 4)
|
|
18
|
+
GET /metrics list available metrics (Task 3)
|
|
19
|
+
POST /evaluate single evaluation (Task 1)
|
|
20
|
+
POST /evaluate/batch batch evaluation (Task 2)
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
import logging
|
|
24
|
+
import os
|
|
25
|
+
import sys
|
|
26
|
+
from pathlib import Path
|
|
27
|
+
|
|
28
|
+
from dotenv import load_dotenv
|
|
29
|
+
|
|
30
|
+
# Load env files from repo root before any module imports.
|
|
31
|
+
# Priority: .env.local overrides .env when the same key exists.
|
|
32
|
+
_repo_root = Path(__file__).resolve().parents[3]
|
|
33
|
+
load_dotenv(_repo_root / ".env", override=False)
|
|
34
|
+
load_dotenv(_repo_root / ".env.local", override=True)
|
|
35
|
+
|
|
36
|
+
from fastapi import FastAPI
|
|
37
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
38
|
+
|
|
39
|
+
from .routers import analytics, bundles, chat, evaluate, health, metrics, projects, results
|
|
40
|
+
|
|
41
|
+
logging.basicConfig(
|
|
42
|
+
level=logging.INFO,
|
|
43
|
+
format="%(asctime)s %(levelname)s %(name)s: %(message)s",
|
|
44
|
+
)
|
|
45
|
+
logger = logging.getLogger(__name__)
|
|
46
|
+
|
|
47
|
+
# ── App ───────────────────────────────────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
app = FastAPI(
|
|
50
|
+
title="DeepEval Evaluation Service",
|
|
51
|
+
description=(
|
|
52
|
+
"Config-driven LLM evaluation API powered by [DeepEval](https://docs.confident-ai.com/).\n\n"
|
|
53
|
+
"Supports single and batch evaluation, metric listing, and health checks.\n\n"
|
|
54
|
+
"Set `use_deepeval: true` in your config file and provide `OPENAI_API_KEY` "
|
|
55
|
+
"to get real LLM-powered metric scores."
|
|
56
|
+
),
|
|
57
|
+
version="1.0.0",
|
|
58
|
+
contact={"name": "DeepEval Demo"},
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
_cors_raw = os.getenv("CORS_ALLOWED_ORIGINS", "")
|
|
62
|
+
_cors_origins = [o.strip() for o in _cors_raw.split(",") if o.strip()]
|
|
63
|
+
|
|
64
|
+
app.add_middleware(
|
|
65
|
+
CORSMiddleware,
|
|
66
|
+
allow_origins=_cors_origins,
|
|
67
|
+
allow_credentials=True,
|
|
68
|
+
allow_methods=["GET", "POST"],
|
|
69
|
+
allow_headers=["Content-Type", "Authorization"],
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
# ── Routers ───────────────────────────────────────────────────────────────────
|
|
73
|
+
|
|
74
|
+
app.include_router(evaluate.router, prefix="/evaluate", tags=["Evaluation"])
|
|
75
|
+
app.include_router(chat.router, prefix="/chat", tags=["Chat"])
|
|
76
|
+
app.include_router(metrics.router, prefix="/metrics", tags=["Metrics"])
|
|
77
|
+
app.include_router(health.router, prefix="/health", tags=["Health"])
|
|
78
|
+
app.include_router(results.router, prefix="/results", tags=["Results"])
|
|
79
|
+
app.include_router(bundles.router, prefix="/bundles", tags=["Bundles"])
|
|
80
|
+
app.include_router(analytics.router, prefix="/eval", tags=["Eval Dashboard"])
|
|
81
|
+
app.include_router(projects.router, prefix="/projects", tags=["Projects"])
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# ── Root ──────────────────────────────────────────────────────────────────────
|
|
85
|
+
|
|
86
|
+
@app.get("/", tags=["Root"], summary="Service information")
|
|
87
|
+
def root():
|
|
88
|
+
"""Return service name, version, and useful links."""
|
|
89
|
+
return {
|
|
90
|
+
"service": "DeepEval Evaluation Service",
|
|
91
|
+
"version": "1.0.0",
|
|
92
|
+
"docs": "/docs",
|
|
93
|
+
"redoc": "/redoc",
|
|
94
|
+
"health": "/health",
|
|
95
|
+
"metrics": "/metrics",
|
|
96
|
+
"evaluate": "/evaluate",
|
|
97
|
+
"chat": "/chat",
|
|
98
|
+
"results": "/results",
|
|
99
|
+
"eval": "/eval",
|
|
100
|
+
}
|