@@ -692,16 +692,20 @@ def _EvaluationDataset_to_vertex(
692
692
) -> dict [str , Any ]:
693
693
to_object : dict [str , Any ] = {}
694
694
695
+ if getv (from_object , ["gcs_source" ]) is not None :
696
+ setv (
697
+ to_object ,
698
+ ["dataset" , "gcs_source" ],
699
+ getv (from_object , ["gcs_source" ]),
700
+ )
701
+
695
702
if getv (from_object , ["bigquery_source" ]) is not None :
696
703
setv (
697
704
to_object ,
698
- ["bigquerySource " ],
705
+ ["dataset" , "bigquery_source " ],
699
706
getv (from_object , ["bigquery_source" ]),
700
707
)
701
708
702
- if getv (from_object , ["gcs_source" ]) is not None :
703
- setv (to_object , ["gcsSource" ], getv (from_object , ["gcs_source" ]))
704
-
705
709
return to_object
706
710
707
711
@@ -711,6 +715,44 @@ def _Metric_to_vertex(
711
715
parent_object : Optional [dict [str , Any ]] = None ,
712
716
) -> dict [str , Any ]:
713
717
to_object : dict [str , Any ] = {}
718
+ if getv (from_object , ["prompt_template" ]) is not None :
719
+ setv (
720
+ to_object ,
721
+ ["pointwise_metric_spec" , "prompt_template" ],
722
+ getv (from_object , ["prompt_template" ]),
723
+ )
724
+
725
+ if getv (from_object , ["judge_model" ]) is not None :
726
+ setv (
727
+ parent_object ,
728
+ ["autorater_config" , "autorater_model" ],
729
+ getv (from_object , ["judge_model" ]),
730
+ )
731
+
732
+ if getv (from_object , ["judge_model_sampling_count" ]) is not None :
733
+ setv (
734
+ parent_object ,
735
+ ["autorater_config" , "sampling_count" ],
736
+ getv (from_object , ["judge_model_sampling_count" ]),
737
+ )
738
+
739
+ if getv (from_object , ["judge_model_system_instruction" ]) is not None :
740
+ setv (
741
+ to_object ,
742
+ ["pointwise_metric_spec" , "system_instruction" ],
743
+ getv (from_object , ["judge_model_system_instruction" ]),
744
+ )
745
+
746
+ if getv (from_object , ["return_raw_output" ]) is not None :
747
+ setv (
748
+ to_object ,
749
+ [
750
+ "pointwise_metric_spec" ,
751
+ "custom_output_format_config" ,
752
+ "return_raw_output" ,
753
+ ],
754
+ getv (from_object , ["return_raw_output" ]),
755
+ )
714
756
715
757
return to_object
716
758
@@ -936,15 +978,19 @@ def _EvaluationDataset_from_vertex(
936
978
) -> dict [str , Any ]:
937
979
to_object : dict [str , Any ] = {}
938
980
939
- if getv (from_object , ["bigquerySource " ]) is not None :
981
+ if getv (from_object , ["dataset" , "gcs_source " ]) is not None :
940
982
setv (
941
983
to_object ,
942
- ["bigquery_source " ],
943
- getv (from_object , ["bigquerySource " ]),
984
+ ["gcs_source " ],
985
+ getv (from_object , ["dataset" , "gcs_source " ]),
944
986
)
945
987
946
- if getv (from_object , ["gcsSource" ]) is not None :
947
- setv (to_object , ["gcs_source" ], getv (from_object , ["gcsSource" ]))
988
+ if getv (from_object , ["dataset" , "bigquery_source" ]) is not None :
989
+ setv (
990
+ to_object ,
991
+ ["bigquery_source" ],
992
+ getv (from_object , ["dataset" , "bigquery_source" ]),
993
+ )
948
994
949
995
return to_object
950
996
0 commit comments