@@ -49,16 +49,22 @@ class JudgeModelOptions(BaseModel):
49
49
50
50
judge_model : str = Field (
51
51
default = "gemini-2.5-flash" ,
52
- description = """The judge model to use for evaluation. It can be a model name.""" ,
52
+ description = (
53
+ "The judge model to use for evaluation. It can be a model name."
54
+ ),
53
55
)
54
56
55
57
judge_model_config : Optional [genai_types .GenerateContentConfig ] = Field (
56
- default = None , description = """The configuration for the judge model."""
58
+ default = None ,
59
+ description = "The configuration for the judge model." ,
57
60
)
58
61
59
62
num_samples : Optional [int ] = Field (
60
63
default = None ,
61
- description = """The number of times to sample the model for each invocation evaluation.""" ,
64
+ description = (
65
+ "The number of times to sample the model for each invocation"
66
+ " evaluation."
67
+ ),
62
68
)
63
69
64
70
@@ -70,15 +76,20 @@ class EvalMetric(BaseModel):
70
76
populate_by_name = True ,
71
77
)
72
78
73
- metric_name : str
74
- """The name of the metric."""
79
+ metric_name : str = Field (
80
+ description = "The name of the metric." ,
81
+ )
75
82
76
- threshold : float
77
- """A threshold value. Each metric decides how to interpret this threshold."""
83
+ threshold : float = Field (
84
+ description = (
85
+ "A threshold value. Each metric decides how to interpret this"
86
+ " threshold."
87
+ ),
88
+ )
78
89
79
90
judge_model_options : Optional [JudgeModelOptions ] = Field (
80
91
default = None ,
81
- description = """ Options for the judge model."" " ,
92
+ description = "Options for the judge model." ,
82
93
)
83
94
84
95
@@ -90,8 +101,14 @@ class EvalMetricResult(EvalMetric):
90
101
populate_by_name = True ,
91
102
)
92
103
93
- score : Optional [float ] = None
94
- eval_status : EvalStatus
104
+ score : Optional [float ] = Field (
105
+ default = None ,
106
+ description = (
107
+ "Score obtained after evaluating the metric. Optional, as evaluation"
108
+ " might not have happened."
109
+ ),
110
+ )
111
+ eval_status : EvalStatus = Field (description = "The status of this evaluation." )
95
112
96
113
97
114
class EvalMetricResultPerInvocation (BaseModel ):
@@ -102,11 +119,71 @@ class EvalMetricResultPerInvocation(BaseModel):
102
119
populate_by_name = True ,
103
120
)
104
121
105
- actual_invocation : Invocation
106
- """The actual invocation, usually obtained by inferencing the agent."""
122
+ actual_invocation : Invocation = Field (
123
+ description = (
124
+ "The actual invocation, usually obtained by inferencing the agent."
125
+ )
126
+ )
127
+
128
+ expected_invocation : Invocation = Field (
129
+ description = (
130
+ "The expected invocation, usually the reference or golden invocation."
131
+ )
132
+ )
107
133
108
- expected_invocation : Invocation
109
- """The expected invocation, usually the reference or golden invocation."""
134
+ eval_metric_results : list [EvalMetricResult ] = Field (
135
+ default = [],
136
+ description = "Eval resutls for each applicable metric." ,
137
+ )
138
+
139
+
140
+ class Interval (BaseModel ):
141
+ """Represents a range of numeric values, e.g. [0 ,1] or (2,3) or [-1, 6)."""
142
+
143
+ min_value : float = Field (description = "The smaller end of the interval." )
144
+
145
+ open_at_min : bool = Field (
146
+ default = False ,
147
+ description = (
148
+ "The interval is Open on the min end. The default value is False,"
149
+ " which means that we assume that the interval is Closed."
150
+ ),
151
+ )
152
+
153
+ max_value : float = Field (description = "The larger end of the interval." )
154
+
155
+ open_at_max : bool = Field (
156
+ default = False ,
157
+ description = (
158
+ "The interval is Open on the max end. The default value is False,"
159
+ " which means that we assume that the interval is Closed."
160
+ ),
161
+ )
110
162
111
- eval_metric_results : list [EvalMetricResult ] = []
112
- """Eval resutls for each applicable metric."""
163
+
164
+ class MetricValueInfo (BaseModel ):
165
+ """Information about the type of metric value."""
166
+
167
+ interval : Optional [Interval ] = Field (
168
+ default = None ,
169
+ description = "The values represented by the metric are of type interval." ,
170
+ )
171
+
172
+
173
+ class MetricInfo (BaseModel ):
174
+ """Information about the metric that are used for Evals."""
175
+
176
+ model_config = ConfigDict (
177
+ alias_generator = alias_generators .to_camel ,
178
+ populate_by_name = True ,
179
+ )
180
+
181
+ metric_name : str = Field (description = "The name of the metric." )
182
+
183
+ description : str = Field (
184
+ default = None , description = "A 2 to 3 line description of the metric."
185
+ )
186
+
187
+ metric_value_info : MetricValueInfo = Field (
188
+ description = "Information on the nature of values supported by the metric."
189
+ )
0 commit comments