@@ -223,7 +223,7 @@ def add_option(self, option: Option) -> None:
223
223
self .options .append (option )
224
224
225
225
@dataclass
226
- class ResponseOption :
226
+ class ResponseOption ( Option ) :
227
227
"""
228
228
An option is a possible answer within a PromptResponseClassification response object in
229
229
a Project's ontology.
@@ -239,45 +239,7 @@ class ResponseOption:
239
239
feature_schema_id: (str)
240
240
options: (list)
241
241
"""
242
- value : Union [str , int ]
243
- label : Optional [Union [str , int ]] = None
244
- schema_id : Optional [str ] = None
245
- feature_schema_id : Optional [FeatureSchemaId ] = None
246
- options : List ["Classification" ] = field (default_factory = list )
247
-
248
- def __post_init__ (self ):
249
- if self .label is None :
250
- self .label = self .value
251
-
252
- @classmethod
253
- def from_dict (
254
- cls ,
255
- dictionary : Dict [str ,
256
- Any ]) -> Dict [Union [str , int ], Union [str , int ]]:
257
- return cls (value = dictionary ["value" ],
258
- label = dictionary ["label" ],
259
- schema_id = dictionary .get ("schemaNodeId" , None ),
260
- feature_schema_id = dictionary .get ("featureSchemaId" , None ),
261
- options = [
262
- PromptResponseClassification .from_dict (o )
263
- for o in dictionary .get ("options" , [])
264
- ])
265
-
266
- def asdict (self ) -> Dict [str , Any ]:
267
- return {
268
- "schemaNodeId" : self .schema_id ,
269
- "featureSchemaId" : self .feature_schema_id ,
270
- "label" : self .label ,
271
- "value" : self .value ,
272
- "options" : [o .asdict (is_subclass = True ) for o in self .options ]
273
- }
274
-
275
- def add_option (self , option : 'Classification' ) -> None :
276
- if option .name in (o .name for o in self .options ):
277
- raise InconsistentOntologyException (
278
- f"Duplicate nested classification '{ option .name } ' "
279
- f"for option '{ self .label } '" )
280
- self .options .append (option )
242
+ pass
281
243
282
244
283
245
@dataclass
0 commit comments