@@ -1034,6 +1034,91 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer,
10341034 }
10351035}
10361036
1037+ internal sealed partial class TaskTypeAlibabaCloudAIConverter : System . Text . Json . Serialization . JsonConverter < Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI >
1038+ {
1039+ private static readonly System . Text . Json . JsonEncodedText MemberCompletion = System . Text . Json . JsonEncodedText . Encode ( "completion" ) ;
1040+ private static readonly System . Text . Json . JsonEncodedText MemberRerank = System . Text . Json . JsonEncodedText . Encode ( "rerank" ) ;
1041+ private static readonly System . Text . Json . JsonEncodedText MemberSparseEmbedding = System . Text . Json . JsonEncodedText . Encode ( "sparse_embedding" ) ;
1042+ private static readonly System . Text . Json . JsonEncodedText MemberTextEmbedding = System . Text . Json . JsonEncodedText . Encode ( "text_embedding" ) ;
1043+
1044+ public override Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI Read ( ref System . Text . Json . Utf8JsonReader reader , System . Type typeToConvert , System . Text . Json . JsonSerializerOptions options )
1045+ {
1046+ if ( reader . ValueTextEquals ( MemberCompletion ) )
1047+ {
1048+ return Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . Completion ;
1049+ }
1050+
1051+ if ( reader . ValueTextEquals ( MemberRerank ) )
1052+ {
1053+ return Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . Rerank ;
1054+ }
1055+
1056+ if ( reader . ValueTextEquals ( MemberSparseEmbedding ) )
1057+ {
1058+ return Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . SparseEmbedding ;
1059+ }
1060+
1061+ if ( reader . ValueTextEquals ( MemberTextEmbedding ) )
1062+ {
1063+ return Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . TextEmbedding ;
1064+ }
1065+
1066+ var value = reader . GetString ( ) ! ;
1067+ if ( string . Equals ( value , MemberCompletion . Value , System . StringComparison . OrdinalIgnoreCase ) )
1068+ {
1069+ return Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . Completion ;
1070+ }
1071+
1072+ if ( string . Equals ( value , MemberRerank . Value , System . StringComparison . OrdinalIgnoreCase ) )
1073+ {
1074+ return Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . Rerank ;
1075+ }
1076+
1077+ if ( string . Equals ( value , MemberSparseEmbedding . Value , System . StringComparison . OrdinalIgnoreCase ) )
1078+ {
1079+ return Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . SparseEmbedding ;
1080+ }
1081+
1082+ if ( string . Equals ( value , MemberTextEmbedding . Value , System . StringComparison . OrdinalIgnoreCase ) )
1083+ {
1084+ return Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . TextEmbedding ;
1085+ }
1086+
1087+ throw new System . Text . Json . JsonException ( $ "Unknown member '{ value } ' for enum '{ nameof ( Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI ) } '.") ;
1088+ }
1089+
1090+ public override void Write ( System . Text . Json . Utf8JsonWriter writer , Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI value , System . Text . Json . JsonSerializerOptions options )
1091+ {
1092+ switch ( value )
1093+ {
1094+ case Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . Completion :
1095+ writer . WriteStringValue ( MemberCompletion ) ;
1096+ break ;
1097+ case Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . Rerank :
1098+ writer . WriteStringValue ( MemberRerank ) ;
1099+ break ;
1100+ case Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . SparseEmbedding :
1101+ writer . WriteStringValue ( MemberSparseEmbedding ) ;
1102+ break ;
1103+ case Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI . TextEmbedding :
1104+ writer . WriteStringValue ( MemberTextEmbedding ) ;
1105+ break ;
1106+ default :
1107+ throw new System . Text . Json . JsonException ( $ "Invalid value '{ value } ' for enum '{ nameof ( Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI ) } '.") ;
1108+ }
1109+ }
1110+
1111+ public override Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI ReadAsPropertyName ( ref System . Text . Json . Utf8JsonReader reader , System . Type typeToConvert , System . Text . Json . JsonSerializerOptions options )
1112+ {
1113+ return Read ( ref reader , typeToConvert , options ) ;
1114+ }
1115+
1116+ public override void WriteAsPropertyName ( System . Text . Json . Utf8JsonWriter writer , Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAI value , System . Text . Json . JsonSerializerOptions options )
1117+ {
1118+ Write ( writer , value , options ) ;
1119+ }
1120+ }
1121+
10371122internal sealed partial class TaskTypeJinaAiConverter : System . Text . Json . Serialization . JsonConverter < Elastic . Clients . Elasticsearch . Inference . TaskTypeJinaAi >
10381123{
10391124 private static readonly System . Text . Json . JsonEncodedText MemberRerank = System . Text . Json . JsonEncodedText . Encode ( "rerank" ) ;
@@ -1093,12 +1178,24 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer,
10931178
10941179internal sealed partial class CohereEmbeddingTypeConverter : System . Text . Json . Serialization . JsonConverter < Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType >
10951180{
1181+ private static readonly System . Text . Json . JsonEncodedText MemberBinary = System . Text . Json . JsonEncodedText . Encode ( "binary" ) ;
1182+ private static readonly System . Text . Json . JsonEncodedText MemberBit = System . Text . Json . JsonEncodedText . Encode ( "bit" ) ;
10961183 private static readonly System . Text . Json . JsonEncodedText MemberByte = System . Text . Json . JsonEncodedText . Encode ( "byte" ) ;
10971184 private static readonly System . Text . Json . JsonEncodedText MemberFloat = System . Text . Json . JsonEncodedText . Encode ( "float" ) ;
10981185 private static readonly System . Text . Json . JsonEncodedText MemberInt8 = System . Text . Json . JsonEncodedText . Encode ( "int8" ) ;
10991186
11001187 public override Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType Read ( ref System . Text . Json . Utf8JsonReader reader , System . Type typeToConvert , System . Text . Json . JsonSerializerOptions options )
11011188 {
1189+ if ( reader . ValueTextEquals ( MemberBinary ) )
1190+ {
1191+ return Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Binary ;
1192+ }
1193+
1194+ if ( reader . ValueTextEquals ( MemberBit ) )
1195+ {
1196+ return Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Bit ;
1197+ }
1198+
11021199 if ( reader . ValueTextEquals ( MemberByte ) )
11031200 {
11041201 return Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Byte ;
@@ -1115,6 +1212,16 @@ public override Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType Read
11151212 }
11161213
11171214 var value = reader . GetString ( ) ! ;
1215+ if ( string . Equals ( value , MemberBinary . Value , System . StringComparison . OrdinalIgnoreCase ) )
1216+ {
1217+ return Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Binary ;
1218+ }
1219+
1220+ if ( string . Equals ( value , MemberBit . Value , System . StringComparison . OrdinalIgnoreCase ) )
1221+ {
1222+ return Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Bit ;
1223+ }
1224+
11181225 if ( string . Equals ( value , MemberByte . Value , System . StringComparison . OrdinalIgnoreCase ) )
11191226 {
11201227 return Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Byte ;
@@ -1137,6 +1244,12 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
11371244 {
11381245 switch ( value )
11391246 {
1247+ case Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Binary :
1248+ writer . WriteStringValue ( MemberBinary ) ;
1249+ break ;
1250+ case Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Bit :
1251+ writer . WriteStringValue ( MemberBit ) ;
1252+ break ;
11401253 case Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Byte :
11411254 writer . WriteStringValue ( MemberByte ) ;
11421255 break ;
@@ -1704,6 +1817,19 @@ public enum WatsonxTaskType
17041817 TextEmbedding
17051818}
17061819
1820+ [ System . Text . Json . Serialization . JsonConverter ( typeof ( Elastic . Clients . Elasticsearch . Inference . TaskTypeAlibabaCloudAIConverter ) ) ]
1821+ public enum TaskTypeAlibabaCloudAI
1822+ {
1823+ [ System . Runtime . Serialization . EnumMember ( Value = "completion" ) ]
1824+ Completion ,
1825+ [ System . Runtime . Serialization . EnumMember ( Value = "rerank" ) ]
1826+ Rerank ,
1827+ [ System . Runtime . Serialization . EnumMember ( Value = "sparse_embedding" ) ]
1828+ SparseEmbedding ,
1829+ [ System . Runtime . Serialization . EnumMember ( Value = "text_embedding" ) ]
1830+ TextEmbedding
1831+ }
1832+
17071833[ System . Text . Json . Serialization . JsonConverter ( typeof ( Elastic . Clients . Elasticsearch . Inference . TaskTypeJinaAiConverter ) ) ]
17081834public enum TaskTypeJinaAi
17091835{
@@ -1716,6 +1842,10 @@ public enum TaskTypeJinaAi
17161842[ System . Text . Json . Serialization . JsonConverter ( typeof ( Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingTypeConverter ) ) ]
17171843public enum CohereEmbeddingType
17181844{
1845+ [ System . Runtime . Serialization . EnumMember ( Value = "binary" ) ]
1846+ Binary ,
1847+ [ System . Runtime . Serialization . EnumMember ( Value = "bit" ) ]
1848+ Bit ,
17191849 [ System . Runtime . Serialization . EnumMember ( Value = "byte" ) ]
17201850 Byte ,
17211851 [ System . Runtime . Serialization . EnumMember ( Value = "float" ) ]
0 commit comments