@@ -96,16 +96,16 @@ def _Candidate_from_mldev(
9696 if getv (from_object , ['finishReason' ]) is not None :
9797 setv (to_object , ['finish_reason' ], getv (from_object , ['finishReason' ]))
9898
99- if getv (from_object , ['avgLogprobs' ]) is not None :
100- setv (to_object , ['avg_logprobs' ], getv (from_object , ['avgLogprobs' ]))
101-
10299 if getv (from_object , ['groundingMetadata' ]) is not None :
103100 setv (
104101 to_object ,
105102 ['grounding_metadata' ],
106103 getv (from_object , ['groundingMetadata' ]),
107104 )
108105
106+ if getv (from_object , ['avgLogprobs' ]) is not None :
107+ setv (to_object , ['avg_logprobs' ], getv (from_object , ['avgLogprobs' ]))
108+
109109 if getv (from_object , ['index' ]) is not None :
110110 setv (to_object , ['index' ], getv (from_object , ['index' ]))
111111
@@ -2724,6 +2724,9 @@ def _GoogleSearch_to_mldev(
27242724 root_object : Optional [Union [dict [str , Any ], object ]] = None ,
27252725) -> dict [str , Any ]:
27262726 to_object : dict [str , Any ] = {}
2727+ if getv (from_object , ['search_types' ]) is not None :
2728+ setv (to_object , ['searchTypes' ], getv (from_object , ['search_types' ]))
2729+
27272730 if getv (from_object , ['exclude_domains' ]) is not None :
27282731 raise ValueError (
27292732 'exclude_domains parameter is not supported in Gemini API.'
@@ -2759,6 +2762,11 @@ def _ImageConfig_to_mldev(
27592762 'person_generation parameter is not supported in Gemini API.'
27602763 )
27612764
2765+ if getv (from_object , ['prominent_people' ]) is not None :
2766+ raise ValueError (
2767+ 'prominent_people parameter is not supported in Gemini API.'
2768+ )
2769+
27622770 if getv (from_object , ['output_mime_type' ]) is not None :
27632771 raise ValueError (
27642772 'output_mime_type parameter is not supported in Gemini API.'
@@ -2791,6 +2799,11 @@ def _ImageConfig_to_vertex(
27912799 getv (from_object , ['person_generation' ]),
27922800 )
27932801
2802+ if getv (from_object , ['prominent_people' ]) is not None :
2803+ setv (
2804+ to_object , ['prominentPeople' ], getv (from_object , ['prominent_people' ])
2805+ )
2806+
27942807 if getv (from_object , ['output_mime_type' ]) is not None :
27952808 setv (
27962809 to_object ,
@@ -3727,6 +3740,15 @@ def _Tool_to_mldev(
37273740 if getv (from_object , ['file_search' ]) is not None :
37283741 setv (to_object , ['fileSearch' ], getv (from_object , ['file_search' ]))
37293742
3743+ if getv (from_object , ['google_search' ]) is not None :
3744+ setv (
3745+ to_object ,
3746+ ['googleSearch' ],
3747+ _GoogleSearch_to_mldev (
3748+ getv (from_object , ['google_search' ]), to_object , root_object
3749+ ),
3750+ )
3751+
37303752 if getv (from_object , ['code_execution' ]) is not None :
37313753 setv (to_object , ['codeExecution' ], getv (from_object , ['code_execution' ]))
37323754
@@ -3751,15 +3773,6 @@ def _Tool_to_mldev(
37513773 ),
37523774 )
37533775
3754- if getv (from_object , ['google_search' ]) is not None :
3755- setv (
3756- to_object ,
3757- ['googleSearch' ],
3758- _GoogleSearch_to_mldev (
3759- getv (from_object , ['google_search' ]), to_object , root_object
3760- ),
3761- )
3762-
37633776 if getv (from_object , ['google_search_retrieval' ]) is not None :
37643777 setv (
37653778 to_object ,
@@ -3795,6 +3808,9 @@ def _Tool_to_vertex(
37953808 if getv (from_object , ['file_search' ]) is not None :
37963809 raise ValueError ('file_search parameter is not supported in Vertex AI.' )
37973810
3811+ if getv (from_object , ['google_search' ]) is not None :
3812+ setv (to_object , ['googleSearch' ], getv (from_object , ['google_search' ]))
3813+
37983814 if getv (from_object , ['code_execution' ]) is not None :
37993815 setv (to_object , ['codeExecution' ], getv (from_object , ['code_execution' ]))
38003816
@@ -3818,9 +3834,6 @@ def _Tool_to_vertex(
38183834 if getv (from_object , ['google_maps' ]) is not None :
38193835 setv (to_object , ['googleMaps' ], getv (from_object , ['google_maps' ]))
38203836
3821- if getv (from_object , ['google_search' ]) is not None :
3822- setv (to_object , ['googleSearch' ], getv (from_object , ['google_search' ]))
3823-
38243837 if getv (from_object , ['google_search_retrieval' ]) is not None :
38253838 setv (
38263839 to_object ,
0 commit comments