@@ -49,16 +49,22 @@ class JudgeModelOptions(BaseModel):
4949
5050 judge_model : str = Field (
5151 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+ ),
5355 )
5456
5557 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." ,
5760 )
5861
5962 num_samples : Optional [int ] = Field (
6063 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+ ),
6268 )
6369
6470
@@ -70,15 +76,20 @@ class EvalMetric(BaseModel):
7076 populate_by_name = True ,
7177 )
7278
73- metric_name : str
74- """The name of the metric."""
79+ metric_name : str = Field (
80+ description = "The name of the metric." ,
81+ )
7582
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+ )
7889
7990 judge_model_options : Optional [JudgeModelOptions ] = Field (
8091 default = None ,
81- description = """ Options for the judge model."" " ,
92+ description = "Options for the judge model." ,
8293 )
8394
8495
@@ -90,8 +101,14 @@ class EvalMetricResult(EvalMetric):
90101 populate_by_name = True ,
91102 )
92103
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." )
95112
96113
97114class EvalMetricResultPerInvocation (BaseModel ):
@@ -102,11 +119,71 @@ class EvalMetricResultPerInvocation(BaseModel):
102119 populate_by_name = True ,
103120 )
104121
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+ )
107133
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+ )
110162
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