@@ -204,4 +204,69 @@ class Config:
204204 json_encoders = {dt .datetime : serialize_datetime }
205205
206206
207- Score = typing .Union [Score_Numeric , Score_Categorical , Score_Boolean ]
207+ class Score_Correction (pydantic_v1 .BaseModel ):
208+ value : float
209+ string_value : str = pydantic_v1 .Field (alias = "stringValue" )
210+ id : str
211+ trace_id : typing .Optional [str ] = pydantic_v1 .Field (alias = "traceId" , default = None )
212+ session_id : typing .Optional [str ] = pydantic_v1 .Field (
213+ alias = "sessionId" , default = None
214+ )
215+ observation_id : typing .Optional [str ] = pydantic_v1 .Field (
216+ alias = "observationId" , default = None
217+ )
218+ dataset_run_id : typing .Optional [str ] = pydantic_v1 .Field (
219+ alias = "datasetRunId" , default = None
220+ )
221+ name : str
222+ source : ScoreSource
223+ timestamp : dt .datetime
224+ created_at : dt .datetime = pydantic_v1 .Field (alias = "createdAt" )
225+ updated_at : dt .datetime = pydantic_v1 .Field (alias = "updatedAt" )
226+ author_user_id : typing .Optional [str ] = pydantic_v1 .Field (
227+ alias = "authorUserId" , default = None
228+ )
229+ comment : typing .Optional [str ] = None
230+ metadata : typing .Any
231+ config_id : typing .Optional [str ] = pydantic_v1 .Field (alias = "configId" , default = None )
232+ queue_id : typing .Optional [str ] = pydantic_v1 .Field (alias = "queueId" , default = None )
233+ environment : str
234+ data_type : typing .Literal ["CORRECTION" ] = pydantic_v1 .Field (
235+ alias = "dataType" , default = "CORRECTION"
236+ )
237+
238+ def json (self , ** kwargs : typing .Any ) -> str :
239+ kwargs_with_defaults : typing .Any = {
240+ "by_alias" : True ,
241+ "exclude_unset" : True ,
242+ ** kwargs ,
243+ }
244+ return super ().json (** kwargs_with_defaults )
245+
246+ def dict (self , ** kwargs : typing .Any ) -> typing .Dict [str , typing .Any ]:
247+ kwargs_with_defaults_exclude_unset : typing .Any = {
248+ "by_alias" : True ,
249+ "exclude_unset" : True ,
250+ ** kwargs ,
251+ }
252+ kwargs_with_defaults_exclude_none : typing .Any = {
253+ "by_alias" : True ,
254+ "exclude_none" : True ,
255+ ** kwargs ,
256+ }
257+
258+ return deep_union_pydantic_dicts (
259+ super ().dict (** kwargs_with_defaults_exclude_unset ),
260+ super ().dict (** kwargs_with_defaults_exclude_none ),
261+ )
262+
263+ class Config :
264+ frozen = True
265+ smart_union = True
266+ allow_population_by_field_name = True
267+ populate_by_name = True
268+ extra = pydantic_v1 .Extra .allow
269+ json_encoders = {dt .datetime : serialize_datetime }
270+
271+
272+ Score = typing .Union [Score_Numeric , Score_Categorical , Score_Boolean , Score_Correction ]
0 commit comments