Add testing results module
This commit is contained in:
33
src/promptforge/testing/results.py
Normal file
33
src/promptforge/testing/results.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
|
||||
@dataclass
|
||||
class TestResult:
|
||||
success: bool
|
||||
response: str
|
||||
metrics: "TestMetrics"
|
||||
error: Optional[str] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
class ComparisonResult:
|
||||
prompt_name: str
|
||||
total_runs: int
|
||||
successful_runs: int
|
||||
failed_runs: int
|
||||
avg_latency_ms: float
|
||||
min_latency_ms: float
|
||||
max_latency_ms: float
|
||||
avg_tokens: float
|
||||
avg_cost: float
|
||||
success_rate: float
|
||||
all_metrics: List["TestMetrics"]
|
||||
|
||||
|
||||
@dataclass
|
||||
class TestReport:
|
||||
test_id: str
|
||||
timestamp: str
|
||||
results: Dict[str, ComparisonResult]
|
||||
summary: Dict[str, float]
|
||||
Reference in New Issue
Block a user