@@ -912,6 +912,18 @@ export function embedContentConfigToMldev(
912912 throw new Error ( 'autoTruncate parameter is not supported in Gemini API.' ) ;
913913 }
914914
915+ if ( common . getValueByPath ( fromObject , [ 'documentOcr' ] ) !== undefined ) {
916+ throw new Error ( 'documentOcr parameter is not supported in Gemini API.' ) ;
917+ }
918+
919+ if (
920+ common . getValueByPath ( fromObject , [ 'audioTrackExtraction' ] ) !== undefined
921+ ) {
922+ throw new Error (
923+ 'audioTrackExtraction parameter is not supported in Gemini API.' ,
924+ ) ;
925+ }
926+
915927 return toObject ;
916928}
917929
@@ -940,7 +952,11 @@ export function embedContentConfigToVertex(
940952 } else if ( discriminatorTaskType === 'EMBED_CONTENT' ) {
941953 const fromTaskType = common . getValueByPath ( fromObject , [ 'taskType' ] ) ;
942954 if ( parentObject !== undefined && fromTaskType != null ) {
943- common . setValueByPath ( parentObject , [ 'taskType' ] , fromTaskType ) ;
955+ common . setValueByPath (
956+ parentObject ,
957+ [ 'embedContentConfig' , 'taskType' ] ,
958+ fromTaskType ,
959+ ) ;
944960 }
945961 }
946962
@@ -958,7 +974,11 @@ export function embedContentConfigToVertex(
958974 } else if ( discriminatorTitle === 'EMBED_CONTENT' ) {
959975 const fromTitle = common . getValueByPath ( fromObject , [ 'title' ] ) ;
960976 if ( parentObject !== undefined && fromTitle != null ) {
961- common . setValueByPath ( parentObject , [ 'title' ] , fromTitle ) ;
977+ common . setValueByPath (
978+ parentObject ,
979+ [ 'embedContentConfig' , 'title' ] ,
980+ fromTitle ,
981+ ) ;
962982 }
963983 }
964984
@@ -986,7 +1006,7 @@ export function embedContentConfigToVertex(
9861006 if ( parentObject !== undefined && fromOutputDimensionality != null ) {
9871007 common . setValueByPath (
9881008 parentObject ,
989- [ 'outputDimensionality' ] ,
1009+ [ 'embedContentConfig' , ' outputDimensionality'] ,
9901010 fromOutputDimensionality ,
9911011 ) ;
9921012 }
@@ -1031,7 +1051,47 @@ export function embedContentConfigToVertex(
10311051 'autoTruncate' ,
10321052 ] ) ;
10331053 if ( parentObject !== undefined && fromAutoTruncate != null ) {
1034- common . setValueByPath ( parentObject , [ 'autoTruncate' ] , fromAutoTruncate ) ;
1054+ common . setValueByPath (
1055+ parentObject ,
1056+ [ 'embedContentConfig' , 'autoTruncate' ] ,
1057+ fromAutoTruncate ,
1058+ ) ;
1059+ }
1060+ }
1061+
1062+ let discriminatorDocumentOcr = common . getValueByPath ( rootObject , [
1063+ 'embeddingApiType' ,
1064+ ] ) ;
1065+ if ( discriminatorDocumentOcr === undefined ) {
1066+ discriminatorDocumentOcr = 'PREDICT' ;
1067+ }
1068+ if ( discriminatorDocumentOcr === 'EMBED_CONTENT' ) {
1069+ const fromDocumentOcr = common . getValueByPath ( fromObject , [ 'documentOcr' ] ) ;
1070+ if ( parentObject !== undefined && fromDocumentOcr != null ) {
1071+ common . setValueByPath (
1072+ parentObject ,
1073+ [ 'embedContentConfig' , 'documentOcr' ] ,
1074+ fromDocumentOcr ,
1075+ ) ;
1076+ }
1077+ }
1078+
1079+ let discriminatorAudioTrackExtraction = common . getValueByPath ( rootObject , [
1080+ 'embeddingApiType' ,
1081+ ] ) ;
1082+ if ( discriminatorAudioTrackExtraction === undefined ) {
1083+ discriminatorAudioTrackExtraction = 'PREDICT' ;
1084+ }
1085+ if ( discriminatorAudioTrackExtraction === 'EMBED_CONTENT' ) {
1086+ const fromAudioTrackExtraction = common . getValueByPath ( fromObject , [
1087+ 'audioTrackExtraction' ,
1088+ ] ) ;
1089+ if ( parentObject !== undefined && fromAudioTrackExtraction != null ) {
1090+ common . setValueByPath (
1091+ parentObject ,
1092+ [ 'embedContentConfig' , 'audioTrackExtraction' ] ,
1093+ fromAudioTrackExtraction ,
1094+ ) ;
10351095 }
10361096 }
10371097
0 commit comments