@@ -1034,6 +1034,91 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer,
1034
1034
}
1035
1035
}
1036
1036
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
+
1037
1122
internal sealed partial class TaskTypeJinaAiConverter : System . Text . Json . Serialization . JsonConverter < Elastic . Clients . Elasticsearch . Inference . TaskTypeJinaAi >
1038
1123
{
1039
1124
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,
1093
1178
1094
1179
internal sealed partial class CohereEmbeddingTypeConverter : System . Text . Json . Serialization . JsonConverter < Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType >
1095
1180
{
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" ) ;
1096
1183
private static readonly System . Text . Json . JsonEncodedText MemberByte = System . Text . Json . JsonEncodedText . Encode ( "byte" ) ;
1097
1184
private static readonly System . Text . Json . JsonEncodedText MemberFloat = System . Text . Json . JsonEncodedText . Encode ( "float" ) ;
1098
1185
private static readonly System . Text . Json . JsonEncodedText MemberInt8 = System . Text . Json . JsonEncodedText . Encode ( "int8" ) ;
1099
1186
1100
1187
public override Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType Read ( ref System . Text . Json . Utf8JsonReader reader , System . Type typeToConvert , System . Text . Json . JsonSerializerOptions options )
1101
1188
{
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
+
1102
1199
if ( reader . ValueTextEquals ( MemberByte ) )
1103
1200
{
1104
1201
return Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Byte ;
@@ -1115,6 +1212,16 @@ public override Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType Read
1115
1212
}
1116
1213
1117
1214
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
+
1118
1225
if ( string . Equals ( value , MemberByte . Value , System . StringComparison . OrdinalIgnoreCase ) )
1119
1226
{
1120
1227
return Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Byte ;
@@ -1137,6 +1244,12 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
1137
1244
{
1138
1245
switch ( value )
1139
1246
{
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 ;
1140
1253
case Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingType . Byte :
1141
1254
writer . WriteStringValue ( MemberByte ) ;
1142
1255
break ;
@@ -1704,6 +1817,19 @@ public enum WatsonxTaskType
1704
1817
TextEmbedding
1705
1818
}
1706
1819
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
+
1707
1833
[ System . Text . Json . Serialization . JsonConverter ( typeof ( Elastic . Clients . Elasticsearch . Inference . TaskTypeJinaAiConverter ) ) ]
1708
1834
public enum TaskTypeJinaAi
1709
1835
{
@@ -1716,6 +1842,10 @@ public enum TaskTypeJinaAi
1716
1842
[ System . Text . Json . Serialization . JsonConverter ( typeof ( Elastic . Clients . Elasticsearch . Inference . CohereEmbeddingTypeConverter ) ) ]
1717
1843
public enum CohereEmbeddingType
1718
1844
{
1845
+ [ System . Runtime . Serialization . EnumMember ( Value = "binary" ) ]
1846
+ Binary ,
1847
+ [ System . Runtime . Serialization . EnumMember ( Value = "bit" ) ]
1848
+ Bit ,
1719
1849
[ System . Runtime . Serialization . EnumMember ( Value = "byte" ) ]
1720
1850
Byte ,
1721
1851
[ System . Runtime . Serialization . EnumMember ( Value = "float" ) ]
0 commit comments