@@ -351,17 +351,17 @@ internal JsonNode FunctionCallToMldev(JsonNode fromObject, JsonObject parentObje
351351 internal JsonNode FunctionCallingConfigToMldev ( JsonNode fromObject , JsonObject parentObject ) {
352352 JsonObject toObject = new JsonObject ( ) ;
353353
354- if ( Common . GetValueByPath ( fromObject , new string [ ] { "mode" } ) != null ) {
355- Common . SetValueByPath ( toObject , new string [ ] { "mode" } ,
356- Common . GetValueByPath ( fromObject , new string [ ] { "mode" } ) ) ;
357- }
358-
359354 if ( Common . GetValueByPath ( fromObject , new string [ ] { "allowedFunctionNames" } ) != null ) {
360355 Common . SetValueByPath (
361356 toObject , new string [ ] { "allowedFunctionNames" } ,
362357 Common . GetValueByPath ( fromObject , new string [ ] { "allowedFunctionNames" } ) ) ;
363358 }
364359
360+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "mode" } ) != null ) {
361+ Common . SetValueByPath ( toObject , new string [ ] { "mode" } ,
362+ Common . GetValueByPath ( fromObject , new string [ ] { "mode" } ) ) ;
363+ }
364+
365365 if ( ! Common . IsZero (
366366 Common . GetValueByPath ( fromObject , new string [ ] { "streamFunctionCallArguments" } ) ) ) {
367367 throw new NotSupportedException (
@@ -374,10 +374,6 @@ internal JsonNode FunctionCallingConfigToMldev(JsonNode fromObject, JsonObject p
374374 internal JsonNode FunctionDeclarationToVertex ( JsonNode fromObject , JsonObject parentObject ) {
375375 JsonObject toObject = new JsonObject ( ) ;
376376
377- if ( ! Common . IsZero ( Common . GetValueByPath ( fromObject , new string [ ] { "behavior" } ) ) ) {
378- throw new NotSupportedException ( "behavior parameter is not supported in Vertex AI." ) ;
379- }
380-
381377 if ( Common . GetValueByPath ( fromObject , new string [ ] { "description" } ) != null ) {
382378 Common . SetValueByPath ( toObject , new string [ ] { "description" } ,
383379 Common . GetValueByPath ( fromObject , new string [ ] { "description" } ) ) ;
@@ -410,6 +406,10 @@ internal JsonNode FunctionDeclarationToVertex(JsonNode fromObject, JsonObject pa
410406 Common . GetValueByPath ( fromObject , new string [ ] { "responseJsonSchema" } ) ) ;
411407 }
412408
409+ if ( ! Common . IsZero ( Common . GetValueByPath ( fromObject , new string [ ] { "behavior" } ) ) ) {
410+ throw new NotSupportedException ( "behavior parameter is not supported in Vertex AI." ) ;
411+ }
412+
413413 return toObject ;
414414 }
415415
@@ -663,6 +663,12 @@ internal JsonNode PartToMldev(JsonNode fromObject, JsonObject parentObject) {
663663 internal JsonNode ToolConfigToMldev ( JsonNode fromObject , JsonObject parentObject ) {
664664 JsonObject toObject = new JsonObject ( ) ;
665665
666+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "retrievalConfig" } ) != null ) {
667+ Common . SetValueByPath (
668+ toObject , new string [ ] { "retrievalConfig" } ,
669+ Common . GetValueByPath ( fromObject , new string [ ] { "retrievalConfig" } ) ) ;
670+ }
671+
666672 if ( Common . GetValueByPath ( fromObject , new string [ ] { "functionCallingConfig" } ) != null ) {
667673 Common . SetValueByPath ( toObject , new string [ ] { "functionCallingConfig" } ,
668674 FunctionCallingConfigToMldev (
@@ -671,34 +677,16 @@ internal JsonNode ToolConfigToMldev(JsonNode fromObject, JsonObject parentObject
671677 toObject ) ) ;
672678 }
673679
674- if ( Common . GetValueByPath ( fromObject , new string [ ] { "retrievalConfig" } ) != null ) {
675- Common . SetValueByPath (
676- toObject , new string [ ] { "retrievalConfig" } ,
677- Common . GetValueByPath ( fromObject , new string [ ] { "retrievalConfig" } ) ) ;
678- }
679-
680680 return toObject ;
681681 }
682682
683683 internal JsonNode ToolToMldev ( JsonNode fromObject , JsonObject parentObject ) {
684684 JsonObject toObject = new JsonObject ( ) ;
685685
686- if ( Common . GetValueByPath ( fromObject , new string [ ] { "functionDeclarations" } ) != null ) {
687- Common . SetValueByPath (
688- toObject , new string [ ] { "functionDeclarations" } ,
689- Common . GetValueByPath ( fromObject , new string [ ] { "functionDeclarations" } ) ) ;
690- }
691-
692686 if ( ! Common . IsZero ( Common . GetValueByPath ( fromObject , new string [ ] { "retrieval" } ) ) ) {
693687 throw new NotSupportedException ( "retrieval parameter is not supported in Gemini API." ) ;
694688 }
695689
696- if ( Common . GetValueByPath ( fromObject , new string [ ] { "googleSearchRetrieval" } ) != null ) {
697- Common . SetValueByPath (
698- toObject , new string [ ] { "googleSearchRetrieval" } ,
699- Common . GetValueByPath ( fromObject , new string [ ] { "googleSearchRetrieval" } ) ) ;
700- }
701-
702690 if ( Common . GetValueByPath ( fromObject , new string [ ] { "computerUse" } ) != null ) {
703691 Common . SetValueByPath ( toObject , new string [ ] { "computerUse" } ,
704692 Common . GetValueByPath ( fromObject , new string [ ] { "computerUse" } ) ) ;
@@ -715,6 +703,12 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
715703 "enterpriseWebSearch parameter is not supported in Gemini API." ) ;
716704 }
717705
706+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "functionDeclarations" } ) != null ) {
707+ Common . SetValueByPath (
708+ toObject , new string [ ] { "functionDeclarations" } ,
709+ Common . GetValueByPath ( fromObject , new string [ ] { "functionDeclarations" } ) ) ;
710+ }
711+
718712 if ( Common . GetValueByPath ( fromObject , new string [ ] { "googleMaps" } ) != null ) {
719713 Common . SetValueByPath (
720714 toObject , new string [ ] { "googleMaps" } ,
@@ -731,6 +725,12 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
731725 toObject ) ) ;
732726 }
733727
728+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "googleSearchRetrieval" } ) != null ) {
729+ Common . SetValueByPath (
730+ toObject , new string [ ] { "googleSearchRetrieval" } ,
731+ Common . GetValueByPath ( fromObject , new string [ ] { "googleSearchRetrieval" } ) ) ;
732+ }
733+
734734 if ( Common . GetValueByPath ( fromObject , new string [ ] { "urlContext" } ) != null ) {
735735 Common . SetValueByPath ( toObject , new string [ ] { "urlContext" } ,
736736 Common . GetValueByPath ( fromObject , new string [ ] { "urlContext" } ) ) ;
@@ -742,29 +742,11 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
742742 internal JsonNode ToolToVertex ( JsonNode fromObject , JsonObject parentObject ) {
743743 JsonObject toObject = new JsonObject ( ) ;
744744
745- if ( Common . GetValueByPath ( fromObject , new string [ ] { "functionDeclarations" } ) != null ) {
746- JsonArray keyArray =
747- ( JsonArray ) Common . GetValueByPath ( fromObject , new string [ ] { "functionDeclarations" } ) ;
748- JsonArray result = new JsonArray ( ) ;
749-
750- foreach ( var record in keyArray ) {
751- result . Add ( FunctionDeclarationToVertex ( JsonNode . Parse ( JsonSerializer . Serialize ( record ) ) ,
752- toObject ) ) ;
753- }
754- Common . SetValueByPath ( toObject , new string [ ] { "functionDeclarations" } , result ) ;
755- }
756-
757745 if ( Common . GetValueByPath ( fromObject , new string [ ] { "retrieval" } ) != null ) {
758746 Common . SetValueByPath ( toObject , new string [ ] { "retrieval" } ,
759747 Common . GetValueByPath ( fromObject , new string [ ] { "retrieval" } ) ) ;
760748 }
761749
762- if ( Common . GetValueByPath ( fromObject , new string [ ] { "googleSearchRetrieval" } ) != null ) {
763- Common . SetValueByPath (
764- toObject , new string [ ] { "googleSearchRetrieval" } ,
765- Common . GetValueByPath ( fromObject , new string [ ] { "googleSearchRetrieval" } ) ) ;
766- }
767-
768750 if ( Common . GetValueByPath ( fromObject , new string [ ] { "computerUse" } ) != null ) {
769751 Common . SetValueByPath ( toObject , new string [ ] { "computerUse" } ,
770752 Common . GetValueByPath ( fromObject , new string [ ] { "computerUse" } ) ) ;
@@ -781,6 +763,18 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) {
781763 Common . GetValueByPath ( fromObject , new string [ ] { "enterpriseWebSearch" } ) ) ;
782764 }
783765
766+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "functionDeclarations" } ) != null ) {
767+ JsonArray keyArray =
768+ ( JsonArray ) Common . GetValueByPath ( fromObject , new string [ ] { "functionDeclarations" } ) ;
769+ JsonArray result = new JsonArray ( ) ;
770+
771+ foreach ( var record in keyArray ) {
772+ result . Add ( FunctionDeclarationToVertex ( JsonNode . Parse ( JsonSerializer . Serialize ( record ) ) ,
773+ toObject ) ) ;
774+ }
775+ Common . SetValueByPath ( toObject , new string [ ] { "functionDeclarations" } , result ) ;
776+ }
777+
784778 if ( Common . GetValueByPath ( fromObject , new string [ ] { "googleMaps" } ) != null ) {
785779 Common . SetValueByPath ( toObject , new string [ ] { "googleMaps" } ,
786780 Common . GetValueByPath ( fromObject , new string [ ] { "googleMaps" } ) ) ;
@@ -791,6 +785,12 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) {
791785 Common . GetValueByPath ( fromObject , new string [ ] { "googleSearch" } ) ) ;
792786 }
793787
788+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "googleSearchRetrieval" } ) != null ) {
789+ Common . SetValueByPath (
790+ toObject , new string [ ] { "googleSearchRetrieval" } ,
791+ Common . GetValueByPath ( fromObject , new string [ ] { "googleSearchRetrieval" } ) ) ;
792+ }
793+
794794 if ( Common . GetValueByPath ( fromObject , new string [ ] { "urlContext" } ) != null ) {
795795 Common . SetValueByPath ( toObject , new string [ ] { "urlContext" } ,
796796 Common . GetValueByPath ( fromObject , new string [ ] { "urlContext" } ) ) ;
0 commit comments