You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: detectors/llm_judge/scheme.py
+20-1Lines changed: 20 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -71,4 +71,23 @@ class Error(BaseModel):
71
71
classMetricsListResponse(BaseModel):
72
72
"""Response for listing available metrics."""
73
73
metrics: List[str] =Field(description="List of available metric names")
74
-
total: int=Field(description="Total number of available metrics")
74
+
total: int=Field(description="Total number of available metrics")
75
+
76
+
classGenerationAnalysisHttpRequest(BaseModel):
77
+
prompt: str=Field(description="Prompt is the user input to the LLM", example="What do you think about the future of AI?")
78
+
generated_text: str=Field(description="Generated response from the LLM", example="The future of AI is bright but we need to be careful about the risks.")
79
+
detector_params: Optional[Dict[str, Any]] =Field(
80
+
default_factory=dict,
81
+
description="Detector parameters for evaluation (e.g., metric, criteria, etc.)",
82
+
example={"metric": "safety"}
83
+
)
84
+
85
+
classGenerationAnalysisResponse(BaseModel):
86
+
detection: str=Field(example="safe")
87
+
detection_type: str=Field(example="llm_judge")
88
+
score: float=Field(example=0.8)
89
+
evidences: Optional[List[EvidenceObj]] =Field(
90
+
description="Optional field providing evidences for the provided detection",
91
+
default=[],
92
+
)
93
+
metadata: Optional[Dict[str, Any]] =Field(default_factory=dict, description="Additional metadata from evaluation")
0 commit comments