@@ -573,6 +573,8 @@ def _create(self, db_object_type, data, extra_params={}):
573573 db_object_type (type): A DbObjectType subtype.
574574 data (dict): Keys are attributes or their names (in Python,
575575 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.
576578 Returns:
577579 A new object of the given DB object type.
578580 Raises:
@@ -763,6 +765,16 @@ def create_model_evalution_project(self,
763765 append_to_existing_dataset : bool = False ,
764766 data_row_count : int = 100 ,
765767 ** 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+ """
766778 kwargs ["media_type" ] = MediaType .Conversational
767779 kwargs ["ontology_kind" ] = OntologyKind .ModelEvaluation
768780 kwargs ["dataset_name_or_id" ] = dataset_name_or_id
@@ -987,7 +999,9 @@ def create_ontology_from_feature_schemas(
987999 name (str): Name of the ontology
9881000 feature_schema_ids (List[str]): List of feature schema ids corresponding to
9891001 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.
9911005 Returns:
9921006 The created Ontology
9931007 """
@@ -1018,6 +1032,15 @@ def create_ontology_from_feature_schemas(
10181032 )
10191033 normalized = {'tools' : tools , 'classifications' : classifications }
10201034
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+
10211044 return self .create_ontology (name = name ,
10221045 normalized = normalized ,
10231046 media_type = media_type ,
@@ -1230,8 +1253,13 @@ def create_ontology(self,
12301253 name (str): Name of the ontology
12311254 normalized (dict): A normalized ontology payload. See above for details.
12321255 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+
12331259 Returns:
12341260 The created Ontology
1261+
1262+ NOTE caller of this method is expected to set media_type to Conversational if ontology_kind is ModelEvaluation
12351263 """
12361264
12371265 if media_type :
0 commit comments