@@ -649,6 +649,13 @@ def _EvaluateInstancesRequestParameters_to_vertex(
649649 ),
650650 )
651651
652+ if getv (from_object , ["rubric_based_metric_input" ]) is not None :
653+ setv (
654+ to_object ,
655+ ["rubricBasedMetricInput" ],
656+ getv (from_object , ["rubric_based_metric_input" ]),
657+ )
658+
652659 if getv (from_object , ["autorater_config" ]) is not None :
653660 setv (
654661 to_object ,
@@ -729,6 +736,13 @@ def _EvaluateInstancesResponse_from_vertex(
729736) -> dict [str , Any ]:
730737 to_object : dict [str , Any ] = {}
731738
739+ if getv (from_object , ["rubricBasedMetricResult" ]) is not None :
740+ setv (
741+ to_object ,
742+ ["rubric_based_metric_result" ],
743+ getv (from_object , ["rubricBasedMetricResult" ]),
744+ )
745+
732746 if getv (from_object , ["bleuResults" ]) is not None :
733747 setv (to_object , ["bleu_results" ], getv (from_object , ["bleuResults" ]))
734748
@@ -762,20 +776,6 @@ def _EvaluateInstancesResponse_from_vertex(
762776 if getv (from_object , ["rougeResults" ]) is not None :
763777 setv (to_object , ["rouge_results" ], getv (from_object , ["rougeResults" ]))
764778
765- if getv (from_object , ["rubricBasedInstructionFollowingResult" ]) is not None :
766- setv (
767- to_object ,
768- ["rubric_based_instruction_following_result" ],
769- getv (from_object , ["rubricBasedInstructionFollowingResult" ]),
770- )
771-
772- if getv (from_object , ["summarizationVerbosityResult" ]) is not None :
773- setv (
774- to_object ,
775- ["summarization_verbosity_result" ],
776- getv (from_object , ["summarizationVerbosityResult" ]),
777- )
778-
779779 if getv (from_object , ["toolCallValidResults" ]) is not None :
780780 setv (
781781 to_object ,
@@ -804,48 +804,58 @@ def _EvaluateInstancesResponse_from_vertex(
804804 getv (from_object , ["toolParameterKvMatchResults" ]),
805805 )
806806
807- if getv (from_object , ["trajectoryAnyOrderMatchResults" ]) is not None :
808- setv (
809- to_object ,
810- ["trajectory_any_order_match_results" ],
811- getv (from_object , ["trajectoryAnyOrderMatchResults" ]),
812- )
807+ return to_object
813808
814- if getv (from_object , ["trajectoryExactMatchResults" ]) is not None :
815- setv (
816- to_object ,
817- ["trajectory_exact_match_results" ],
818- getv (from_object , ["trajectoryExactMatchResults" ]),
819- )
820809
821- if getv (from_object , ["trajectoryInOrderMatchResults" ]) is not None :
822- setv (
823- to_object ,
824- ["trajectory_in_order_match_results" ],
825- getv (from_object , ["trajectoryInOrderMatchResults" ]),
826- )
810+ def _RubricContentProperty_from_vertex (
811+ from_object : Union [dict [str , Any ], object ],
812+ parent_object : Optional [dict [str , Any ]] = None ,
813+ ) -> dict [str , Any ]:
814+ to_object : dict [str , Any ] = {}
815+ if getv (from_object , ["description" ]) is not None :
816+ setv (to_object , ["description" ], getv (from_object , ["description" ]))
817+
818+ return to_object
827819
828- if getv (from_object , ["trajectoryPrecisionResults" ]) is not None :
829- setv (
830- to_object ,
831- ["trajectory_precision_results" ],
832- getv (from_object , ["trajectoryPrecisionResults" ]),
833- )
834820
835- if getv (from_object , ["trajectoryRecallResults" ]) is not None :
821+ def _RubricContent_from_vertex (
822+ from_object : Union [dict [str , Any ], object ],
823+ parent_object : Optional [dict [str , Any ]] = None ,
824+ ) -> dict [str , Any ]:
825+ to_object : dict [str , Any ] = {}
826+ if getv (from_object , ["property" ]) is not None :
836827 setv (
837828 to_object ,
838- ["trajectory_recall_results" ],
839- getv (from_object , ["trajectoryRecallResults" ]),
829+ ["property" ],
830+ _RubricContentProperty_from_vertex (
831+ getv (from_object , ["property" ]), to_object
832+ ),
840833 )
841834
842- if getv (from_object , ["trajectorySingleToolUseResults" ]) is not None :
835+ return to_object
836+
837+
838+ def _Rubric_from_vertex (
839+ from_object : Union [dict [str , Any ], object ],
840+ parent_object : Optional [dict [str , Any ]] = None ,
841+ ) -> dict [str , Any ]:
842+ to_object : dict [str , Any ] = {}
843+ if getv (from_object , ["rubricId" ]) is not None :
844+ setv (to_object , ["rubric_id" ], getv (from_object , ["rubricId" ]))
845+
846+ if getv (from_object , ["content" ]) is not None :
843847 setv (
844848 to_object ,
845- ["trajectory_single_tool_use_results " ],
846- getv (from_object , ["trajectorySingleToolUseResults" ] ),
849+ ["content " ],
850+ _RubricContent_from_vertex ( getv (from_object , ["content" ]), to_object ),
847851 )
848852
853+ if getv (from_object , ["type" ]) is not None :
854+ setv (to_object , ["type" ], getv (from_object , ["type" ]))
855+
856+ if getv (from_object , ["importance" ]) is not None :
857+ setv (to_object , ["importance" ], getv (from_object , ["importance" ]))
858+
849859 return to_object
850860
851861
@@ -858,7 +868,10 @@ def _GenerateInstanceRubricsResponse_from_vertex(
858868 setv (
859869 to_object ,
860870 ["generated_rubrics" ],
861- getv (from_object , ["generatedRubrics" ]),
871+ [
872+ _Rubric_from_vertex (item , to_object )
873+ for item in getv (from_object , ["generatedRubrics" ])
874+ ],
862875 )
863876
864877 return to_object
@@ -881,6 +894,7 @@ def _evaluate_instances(
881894 tool_parameter_kv_match_input : Optional [
882895 types .ToolParameterKVMatchInputOrDict
883896 ] = None ,
897+ rubric_based_metric_input : Optional [types .RubricBasedMetricInputOrDict ] = None ,
884898 autorater_config : Optional [types .AutoraterConfigOrDict ] = None ,
885899 config : Optional [types .EvaluateInstancesConfigOrDict ] = None ,
886900 ) -> types .EvaluateInstancesResponse :
@@ -896,6 +910,7 @@ def _evaluate_instances(
896910 tool_name_match_input = tool_name_match_input ,
897911 tool_parameter_key_match_input = tool_parameter_key_match_input ,
898912 tool_parameter_kv_match_input = tool_parameter_kv_match_input ,
913+ rubric_based_metric_input = rubric_based_metric_input ,
899914 autorater_config = autorater_config ,
900915 config = config ,
901916 )
@@ -1199,6 +1214,7 @@ async def _evaluate_instances(
11991214 tool_parameter_kv_match_input : Optional [
12001215 types .ToolParameterKVMatchInputOrDict
12011216 ] = None ,
1217+ rubric_based_metric_input : Optional [types .RubricBasedMetricInputOrDict ] = None ,
12021218 autorater_config : Optional [types .AutoraterConfigOrDict ] = None ,
12031219 config : Optional [types .EvaluateInstancesConfigOrDict ] = None ,
12041220 ) -> types .EvaluateInstancesResponse :
@@ -1214,6 +1230,7 @@ async def _evaluate_instances(
12141230 tool_name_match_input = tool_name_match_input ,
12151231 tool_parameter_key_match_input = tool_parameter_key_match_input ,
12161232 tool_parameter_kv_match_input = tool_parameter_kv_match_input ,
1233+ rubric_based_metric_input = rubric_based_metric_input ,
12171234 autorater_config = autorater_config ,
12181235 config = config ,
12191236 )
0 commit comments