@@ -573,6 +573,8 @@ def _create(self, db_object_type, data, extra_params={}):
573
573
db_object_type (type): A DbObjectType subtype.
574
574
data (dict): Keys are attributes or their names (in Python,
575
575
snake-case convention) and values are desired attribute values.
576
+ extra_params (dict): Additional parameters to pass to GraphQL.
577
+ These have to be Field(...): value pairs.
576
578
Returns:
577
579
A new object of the given DB object type.
578
580
Raises:
@@ -763,6 +765,16 @@ def create_model_evalution_project(self,
763
765
append_to_existing_dataset : bool = False ,
764
766
data_row_count : int = 100 ,
765
767
** kwargs ) -> Project :
768
+ """
769
+ Use this method exclusively to create a chat model evaluation project.
770
+ Args:
771
+ dataset_name_or_id: The name or id of the dataset to use for the project
772
+ append_to_existing_dataset: If True, the project will append assets (data rows) to the existing dataset
773
+ data_row_count: The number of data row assets to use for the project
774
+ **kwargs: Additional parameters to pass to the the create_project method
775
+ Returns:
776
+ Project: The created project
777
+ """
766
778
kwargs ["media_type" ] = MediaType .Conversational
767
779
kwargs ["ontology_kind" ] = OntologyKind .ModelEvaluation
768
780
kwargs ["dataset_name_or_id" ] = dataset_name_or_id
@@ -987,7 +999,9 @@ def create_ontology_from_feature_schemas(
987
999
name (str): Name of the ontology
988
1000
feature_schema_ids (List[str]): List of feature schema ids corresponding to
989
1001
top level tools and classifications to include in the ontology
990
- media_type (MediaType or None): Media type of a new ontology
1002
+ media_type (MediaType or None): Media type of a new ontology. NOTE for chat evaluation, we currently foce media_type to Conversational
1003
+ ontology_kind (OntologyKind or None): set to OntologyKind.ModelEvaluation if the ontology is for chat evaluation,
1004
+ leave as None otherwise.
991
1005
Returns:
992
1006
The created Ontology
993
1007
"""
@@ -1018,6 +1032,15 @@ def create_ontology_from_feature_schemas(
1018
1032
)
1019
1033
normalized = {'tools' : tools , 'classifications' : classifications }
1020
1034
1035
+ if ontology_kind and ontology_kind is OntologyKind .ModelEvaluation :
1036
+ if media_type is None :
1037
+ media_type = MediaType .Conversational
1038
+ else :
1039
+ if media_type is not MediaType .Conversational :
1040
+ raise ValueError (
1041
+ "For chat evaluation, media_type must be Conversational."
1042
+ )
1043
+
1021
1044
return self .create_ontology (name = name ,
1022
1045
normalized = normalized ,
1023
1046
media_type = media_type ,
@@ -1230,8 +1253,13 @@ def create_ontology(self,
1230
1253
name (str): Name of the ontology
1231
1254
normalized (dict): A normalized ontology payload. See above for details.
1232
1255
media_type (MediaType or None): Media type of a new ontology
1256
+ ontology_kind (OntologyKind or None): set to OntologyKind.ModelEvaluation if the ontology is for chat evaluation,
1257
+ leave as None otherwise.
1258
+
1233
1259
Returns:
1234
1260
The created Ontology
1261
+
1262
+ NOTE caller of this method is expected to set media_type to Conversational if ontology_kind is ModelEvaluation
1235
1263
"""
1236
1264
1237
1265
if media_type :
0 commit comments