diff --git a/src/helpers/FixOpenApiSpec/Program.cs b/src/helpers/FixOpenApiSpec/Program.cs index ce5ec88..5c77b08 100644 --- a/src/helpers/FixOpenApiSpec/Program.cs +++ b/src/helpers/FixOpenApiSpec/Program.cs @@ -14,10 +14,6 @@ var openApiDocument = new OpenApiStringReader().Read(yamlOrJson, out var diagnostics); -openApiDocument.Components.Schemas["ImageDoc"]!.Properties["id"].Example = null; -openApiDocument.Components.Schemas["api_schemas__embedding__TextDoc"]!.Properties["id"].Example = null; -openApiDocument.Components.Schemas["api_schemas__rank__TextDoc"]!.Properties["id"].Example = null; - openApiDocument.Components.Schemas["ModelEmbeddingOutput"]!.Properties["data"].Items = new OpenApiSchema { Type = "object", diff --git a/src/libs/Jina/Generated/Jina.ClassificationClient.Classify.g.cs b/src/libs/Jina/Generated/Jina.ClassificationClient.Classify.g.cs new file mode 100644 index 0000000..e9d1093 --- /dev/null +++ b/src/libs/Jina/Generated/Jina.ClassificationClient.Classify.g.cs @@ -0,0 +1,166 @@ + +#nullable enable + +namespace Jina +{ + public partial class ClassificationClient + { + partial void PrepareClassifyArguments( + global::System.Net.Http.HttpClient httpClient, + global::Jina.ClassificationAPIInput request); + partial void PrepareClassifyRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Jina.ClassificationAPIInput request); + partial void ProcessClassifyResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessClassifyResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Classify
+ /// Classify. + ///
+ /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ClassifyAsync( + global::Jina.ClassificationAPIInput request, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: _httpClient); + PrepareClassifyArguments( + httpClient: _httpClient, + request: request); + + var __pathBuilder = new PathBuilder( + path: "/v1/classify", + baseUri: _httpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using var httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + + foreach (var _authorization in _authorizations) + { + if (_authorization.Type == "Http" || + _authorization.Type == "OAuth2") + { + httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: _authorization.Name, + parameter: _authorization.Value); + } + else if (_authorization.Type == "ApiKey" && + _authorization.Location == "Header") + { + httpRequest.Headers.Add(_authorization.Name, _authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + httpRequest.Content = __httpRequestContent; + + PrepareRequest( + client: _httpClient, + request: httpRequest); + PrepareClassifyRequest( + httpClient: _httpClient, + httpRequestMessage: httpRequest, + request: request); + + using var response = await _httpClient.SendAsync( + request: httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: _httpClient, + response: response); + ProcessClassifyResponse( + httpClient: _httpClient, + httpResponseMessage: response); + + var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: _httpClient, + response: response, + content: ref __content); + ProcessClassifyResponseContent( + httpClient: _httpClient, + httpResponseMessage: response, + content: ref __content); + + try + { + response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException ex) + { + throw new global::System.InvalidOperationException(__content, ex); + } + + return + global::Jina.ClassificationOutput.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + + /// + /// Classify
+ /// Classify. + ///
+ /// + /// The identifier of the model.
+ /// Available models and corresponding param size and dimension:
+ /// - `jina-clip-v1`, 223M, 768
+ /// - `jina-embeddings-v2-base-en`, 137M, 768
+ /// - `jina-embeddings-v2-base-es`, 161M, 768
+ /// - `jina-embeddings-v2-base-de`, 161M, 768
+ /// - `jina-embeddings-v2-base-zh`, 161M, 768
+ /// - `jina-embeddings-v2-base-code`, 137M, 768
+ /// - `jina-embeddings-v3`, 570M, 1024
+ /// For more information, please checkout our [technical blog](https://arxiv.org/abs/2307.11224). + /// + /// + /// The identifier of the classifier. If not provided, a new classifier will be created.
+ /// You can provide only either `model` or `classifier_id` + /// + /// + /// List of text and images or a single text and image for classification + /// + /// + /// List of labels used for classification + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ClassifyAsync( + global::Jina.AnyOf>, global::Jina.ApiSchemasClassificationTextDoc, global::Jina.ApiSchemasClassificationImageDoc, string> input, + string? model = default, + string? classifierId = default, + global::System.Collections.Generic.IList? labels = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var request = new global::Jina.ClassificationAPIInput + { + Model = model, + ClassifierId = classifierId, + Input = input, + Labels = labels, + }; + + return await ClassifyAsync( + request: request, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.ClassificationClient.Train.g.cs b/src/libs/Jina/Generated/Jina.ClassificationClient.Train.g.cs new file mode 100644 index 0000000..2afc41e --- /dev/null +++ b/src/libs/Jina/Generated/Jina.ClassificationClient.Train.g.cs @@ -0,0 +1,167 @@ + +#nullable enable + +namespace Jina +{ + public partial class ClassificationClient + { + partial void PrepareTrainArguments( + global::System.Net.Http.HttpClient httpClient, + global::Jina.TrainingAPIInput request); + partial void PrepareTrainRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Jina.TrainingAPIInput request); + partial void ProcessTrainResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessTrainResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Train
+ /// Rank pairs. + ///
+ /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task TrainAsync( + global::Jina.TrainingAPIInput request, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: _httpClient); + PrepareTrainArguments( + httpClient: _httpClient, + request: request); + + var __pathBuilder = new PathBuilder( + path: "/v1/train", + baseUri: _httpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using var httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + + foreach (var _authorization in _authorizations) + { + if (_authorization.Type == "Http" || + _authorization.Type == "OAuth2") + { + httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: _authorization.Name, + parameter: _authorization.Value); + } + else if (_authorization.Type == "ApiKey" && + _authorization.Location == "Header") + { + httpRequest.Headers.Add(_authorization.Name, _authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + httpRequest.Content = __httpRequestContent; + + PrepareRequest( + client: _httpClient, + request: httpRequest); + PrepareTrainRequest( + httpClient: _httpClient, + httpRequestMessage: httpRequest, + request: request); + + using var response = await _httpClient.SendAsync( + request: httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: _httpClient, + response: response); + ProcessTrainResponse( + httpClient: _httpClient, + httpResponseMessage: response); + + var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: _httpClient, + response: response, + content: ref __content); + ProcessTrainResponseContent( + httpClient: _httpClient, + httpResponseMessage: response, + content: ref __content); + + try + { + response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException ex) + { + throw new global::System.InvalidOperationException(__content, ex); + } + + return + global::Jina.TrainingOutput.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + + /// + /// Train
+ /// Rank pairs. + ///
+ /// + /// The identifier of the model.
+ /// Available models and corresponding param size and dimension:
+ /// - `jina-clip-v1`, 223M, 768
+ /// - `jina-embeddings-v2-base-en`, 137M, 768
+ /// - `jina-embeddings-v2-base-es`, 161M, 768
+ /// - `jina-embeddings-v2-base-de`, 161M, 768
+ /// - `jina-embeddings-v2-base-zh`, 161M, 768
+ /// - `jina-embeddings-v2-base-code`, 137M, 768
+ /// For more information, please checkout our [technical blog](https://arxiv.org/abs/2307.11224).
+ /// You can provide only either `model` or `classifier_id` + /// + /// + /// The identifier of the classifier. If not provided, a new classifier will be created.
+ /// You can provide only either `model` or `classifier_id` + /// + /// + /// The visibility of the classifier when created. Will be ignored if `classifier_id` is provided
+ /// Default Value: public + /// + /// + /// List of text and images and labels or a single text and image and label to train the classifier + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task TrainAsync( + global::Jina.AnyOf>, global::Jina.TextExampleDoc, global::Jina.ImageExampleDoc> input, + string? model = default, + string? classifierId = default, + global::Jina.TrainingAPIInputVisibility? visibility = global::Jina.TrainingAPIInputVisibility.Public, + global::System.Threading.CancellationToken cancellationToken = default) + { + var request = new global::Jina.TrainingAPIInput + { + Model = model, + ClassifierId = classifierId, + Visibility = visibility, + Input = input, + }; + + return await TrainAsync( + request: request, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.ClassificationClient.g.cs b/src/libs/Jina/Generated/Jina.ClassificationClient.g.cs new file mode 100644 index 0000000..252cfa9 --- /dev/null +++ b/src/libs/Jina/Generated/Jina.ClassificationClient.g.cs @@ -0,0 +1,67 @@ + +#nullable enable + +namespace Jina +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ClassificationClient : global::Jina.IClassificationClient, global::System.IDisposable + { + /// + /// + /// + public const string BaseUrl = "https://api.jina.ai/"; + + private readonly global::System.Net.Http.HttpClient _httpClient; + private global::System.Collections.Generic.List _authorizations; + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Jina.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ClassificationClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// + /// + /// + public ClassificationClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null) + { + _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); + + Initialized(_httpClient); + } + + /// + public void Dispose() + { + _httpClient.Dispose(); + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.IClassificationClient.Classify.g.cs b/src/libs/Jina/Generated/Jina.IClassificationClient.Classify.g.cs new file mode 100644 index 0000000..933a2c1 --- /dev/null +++ b/src/libs/Jina/Generated/Jina.IClassificationClient.Classify.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Jina +{ + public partial interface IClassificationClient + { + /// + /// Classify
+ /// Classify. + ///
+ /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ClassifyAsync( + global::Jina.ClassificationAPIInput request, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Classify
+ /// Classify. + ///
+ /// + /// The identifier of the model.
+ /// Available models and corresponding param size and dimension:
+ /// - `jina-clip-v1`, 223M, 768
+ /// - `jina-embeddings-v2-base-en`, 137M, 768
+ /// - `jina-embeddings-v2-base-es`, 161M, 768
+ /// - `jina-embeddings-v2-base-de`, 161M, 768
+ /// - `jina-embeddings-v2-base-zh`, 161M, 768
+ /// - `jina-embeddings-v2-base-code`, 137M, 768
+ /// - `jina-embeddings-v3`, 570M, 1024
+ /// For more information, please checkout our [technical blog](https://arxiv.org/abs/2307.11224). + /// + /// + /// The identifier of the classifier. If not provided, a new classifier will be created.
+ /// You can provide only either `model` or `classifier_id` + /// + /// + /// List of text and images or a single text and image for classification + /// + /// + /// List of labels used for classification + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ClassifyAsync( + global::Jina.AnyOf>, global::Jina.ApiSchemasClassificationTextDoc, global::Jina.ApiSchemasClassificationImageDoc, string> input, + string? model = default, + string? classifierId = default, + global::System.Collections.Generic.IList? labels = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.IClassificationClient.Train.g.cs b/src/libs/Jina/Generated/Jina.IClassificationClient.Train.g.cs new file mode 100644 index 0000000..38c0431 --- /dev/null +++ b/src/libs/Jina/Generated/Jina.IClassificationClient.Train.g.cs @@ -0,0 +1,54 @@ +#nullable enable + +namespace Jina +{ + public partial interface IClassificationClient + { + /// + /// Train
+ /// Rank pairs. + ///
+ /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task TrainAsync( + global::Jina.TrainingAPIInput request, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Train
+ /// Rank pairs. + ///
+ /// + /// The identifier of the model.
+ /// Available models and corresponding param size and dimension:
+ /// - `jina-clip-v1`, 223M, 768
+ /// - `jina-embeddings-v2-base-en`, 137M, 768
+ /// - `jina-embeddings-v2-base-es`, 161M, 768
+ /// - `jina-embeddings-v2-base-de`, 161M, 768
+ /// - `jina-embeddings-v2-base-zh`, 161M, 768
+ /// - `jina-embeddings-v2-base-code`, 137M, 768
+ /// For more information, please checkout our [technical blog](https://arxiv.org/abs/2307.11224).
+ /// You can provide only either `model` or `classifier_id` + /// + /// + /// The identifier of the classifier. If not provided, a new classifier will be created.
+ /// You can provide only either `model` or `classifier_id` + /// + /// + /// The visibility of the classifier when created. Will be ignored if `classifier_id` is provided
+ /// Default Value: public + /// + /// + /// List of text and images and labels or a single text and image and label to train the classifier + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task TrainAsync( + global::Jina.AnyOf>, global::Jina.TextExampleDoc, global::Jina.ImageExampleDoc> input, + string? model = default, + string? classifierId = default, + global::Jina.TrainingAPIInputVisibility? visibility = global::Jina.TrainingAPIInputVisibility.Public, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.IClassificationClient.g.cs b/src/libs/Jina/Generated/Jina.IClassificationClient.g.cs new file mode 100644 index 0000000..13fce7f --- /dev/null +++ b/src/libs/Jina/Generated/Jina.IClassificationClient.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Jina +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IClassificationClient : global::System.IDisposable + { + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.IJinaApi.g.cs b/src/libs/Jina/Generated/Jina.IJinaApi.g.cs index ebda4fb..eab65ce 100644 --- a/src/libs/Jina/Generated/Jina.IJinaApi.g.cs +++ b/src/libs/Jina/Generated/Jina.IJinaApi.g.cs @@ -31,6 +31,11 @@ public partial interface IJinaApi : global::System.IDisposable /// public RerankClient Rerank { get; } + /// + /// + /// + public ClassificationClient Classification { get; } + /// /// /// diff --git a/src/libs/Jina/Generated/Jina.JinaApi.g.cs b/src/libs/Jina/Generated/Jina.JinaApi.g.cs index a54dd80..63482af 100644 --- a/src/libs/Jina/Generated/Jina.JinaApi.g.cs +++ b/src/libs/Jina/Generated/Jina.JinaApi.g.cs @@ -48,6 +48,14 @@ public sealed partial class JinaApi : global::Jina.IJinaApi, global::System.IDis JsonSerializerContext = JsonSerializerContext, }; + /// + /// + /// + public ClassificationClient Classification => new ClassificationClient(_httpClient, authorizations: _authorizations) + { + JsonSerializerContext = JsonSerializerContext, + }; + /// /// /// diff --git a/src/libs/Jina/Generated/Jina.Models.ApiSchemasClassificationImageDoc.g.cs b/src/libs/Jina/Generated/Jina.Models.ApiSchemasClassificationImageDoc.g.cs new file mode 100644 index 0000000..6c4a76c --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.ApiSchemasClassificationImageDoc.g.cs @@ -0,0 +1,109 @@ + +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Jina +{ + /// + /// ImageDoc with fields + /// + public sealed partial class ApiSchemasClassificationImageDoc + { + /// + /// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value
+ /// Example: e10b550cf99e2e072e22420af5c6eb47 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// URL of an image file + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// base64 representation of the Image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("bytes")] + public byte[]? Bytes { get; set; } + + /// + /// base64 representation of the Image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("bytesname")] + public string? Bytesname { get; set; } + + /// + /// Image representation that can hold URL of an image or a base64 representation + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Jina.JsonConverters.AnyOfJsonConverterFactory2))] + public global::Jina.AnyOf? Image { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Jina.ApiSchemasClassificationImageDoc? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Jina.ApiSchemasClassificationImageDoc), + jsonSerializerContext) as global::Jina.ApiSchemasClassificationImageDoc; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Jina.ApiSchemasClassificationImageDoc? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.Models.ApiSchemasClassificationTextDoc.g.cs b/src/libs/Jina/Generated/Jina.Models.ApiSchemasClassificationTextDoc.g.cs new file mode 100644 index 0000000..6fde9e4 --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.ApiSchemasClassificationTextDoc.g.cs @@ -0,0 +1,89 @@ + +#nullable enable + +namespace Jina +{ + /// + /// Document containing a text field + /// + public sealed partial class ApiSchemasClassificationTextDoc + { + /// + /// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value
+ /// Example: e10b550cf99e2e072e22420af5c6eb47 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Text { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Jina.ApiSchemasClassificationTextDoc? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Jina.ApiSchemasClassificationTextDoc), + jsonSerializerContext) as global::Jina.ApiSchemasClassificationTextDoc; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Jina.ApiSchemasClassificationTextDoc? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.Models.ApiSchemasClassificationUsage.g.cs b/src/libs/Jina/Generated/Jina.Models.ApiSchemasClassificationUsage.g.cs new file mode 100644 index 0000000..643f482 --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.ApiSchemasClassificationUsage.g.cs @@ -0,0 +1,89 @@ + +#nullable enable + +namespace Jina +{ + /// + /// + /// + public sealed partial class ApiSchemasClassificationUsage + { + /// + /// The number of tokens used by all the texts in the input + /// + [global::System.Text.Json.Serialization.JsonPropertyName("total_tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int TotalTokens { get; set; } + + /// + /// Same as total_tokens + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt_tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int PromptTokens { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Jina.ApiSchemasClassificationUsage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Jina.ApiSchemasClassificationUsage), + jsonSerializerContext) as global::Jina.ApiSchemasClassificationUsage; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Jina.ApiSchemasClassificationUsage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.Models.ImageDoc.g.cs b/src/libs/Jina/Generated/Jina.Models.ApiSchemasEmbeddingImageDoc.g.cs similarity index 90% rename from src/libs/Jina/Generated/Jina.Models.ImageDoc.g.cs rename to src/libs/Jina/Generated/Jina.Models.ApiSchemasEmbeddingImageDoc.g.cs index 4cb1917..4970e55 100644 --- a/src/libs/Jina/Generated/Jina.Models.ImageDoc.g.cs +++ b/src/libs/Jina/Generated/Jina.Models.ApiSchemasEmbeddingImageDoc.g.cs @@ -8,10 +8,11 @@ namespace Jina /// /// ImageDoc with fields /// - public sealed partial class ImageDoc + public sealed partial class ApiSchemasEmbeddingImageDoc { /// - /// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value + /// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value
+ /// Example: e10b550cf99e2e072e22420af5c6eb47 ///
[global::System.Text.Json.Serialization.JsonPropertyName("id")] public string? Id { get; set; } @@ -78,14 +79,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Jina.ImageDoc? FromJson( + public static global::Jina.ApiSchemasEmbeddingImageDoc? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Jina.ImageDoc), - jsonSerializerContext) as global::Jina.ImageDoc; + typeof(global::Jina.ApiSchemasEmbeddingImageDoc), + jsonSerializerContext) as global::Jina.ApiSchemasEmbeddingImageDoc; } /// @@ -95,11 +96,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Jina.ImageDoc? FromJson( + public static global::Jina.ApiSchemasEmbeddingImageDoc? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } diff --git a/src/libs/Jina/Generated/Jina.Models.ApiSchemasEmbeddingTextDoc.g.cs b/src/libs/Jina/Generated/Jina.Models.ApiSchemasEmbeddingTextDoc.g.cs index 7aaf0a8..3ad0b6d 100644 --- a/src/libs/Jina/Generated/Jina.Models.ApiSchemasEmbeddingTextDoc.g.cs +++ b/src/libs/Jina/Generated/Jina.Models.ApiSchemasEmbeddingTextDoc.g.cs @@ -9,7 +9,8 @@ namespace Jina public sealed partial class ApiSchemasEmbeddingTextDoc { /// - /// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value + /// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value
+ /// Example: e10b550cf99e2e072e22420af5c6eb47 ///
[global::System.Text.Json.Serialization.JsonPropertyName("id")] public string? Id { get; set; } diff --git a/src/libs/Jina/Generated/Jina.Models.ApiSchemasRankTextDoc.g.cs b/src/libs/Jina/Generated/Jina.Models.ApiSchemasRankTextDoc.g.cs index 76718cb..d6fedde 100644 --- a/src/libs/Jina/Generated/Jina.Models.ApiSchemasRankTextDoc.g.cs +++ b/src/libs/Jina/Generated/Jina.Models.ApiSchemasRankTextDoc.g.cs @@ -9,7 +9,8 @@ namespace Jina public sealed partial class ApiSchemasRankTextDoc { /// - /// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value + /// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value
+ /// Example: e10b550cf99e2e072e22420af5c6eb47 ///
[global::System.Text.Json.Serialization.JsonPropertyName("id")] public string? Id { get; set; } diff --git a/src/libs/Jina/Generated/Jina.Models.ApiSchemasTrainingUsage.g.cs b/src/libs/Jina/Generated/Jina.Models.ApiSchemasTrainingUsage.g.cs new file mode 100644 index 0000000..83be03f --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.ApiSchemasTrainingUsage.g.cs @@ -0,0 +1,89 @@ + +#nullable enable + +namespace Jina +{ + /// + /// + /// + public sealed partial class ApiSchemasTrainingUsage + { + /// + /// The number of tokens used by all the texts in the input + /// + [global::System.Text.Json.Serialization.JsonPropertyName("total_tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int TotalTokens { get; set; } + + /// + /// Same as total_tokens + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt_tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int PromptTokens { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Jina.ApiSchemasTrainingUsage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Jina.ApiSchemasTrainingUsage), + jsonSerializerContext) as global::Jina.ApiSchemasTrainingUsage; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Jina.ApiSchemasTrainingUsage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.Models.ClassificationAPIInput.g.cs b/src/libs/Jina/Generated/Jina.Models.ClassificationAPIInput.g.cs new file mode 100644 index 0000000..a190cb1 --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.ClassificationAPIInput.g.cs @@ -0,0 +1,113 @@ + +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Jina +{ + /// + /// The input to the API for classify endpoint. OpenAI compatible + /// + public sealed partial class ClassificationAPIInput + { + /// + /// The identifier of the model.
+ /// Available models and corresponding param size and dimension:
+ /// - `jina-clip-v1`, 223M, 768
+ /// - `jina-embeddings-v2-base-en`, 137M, 768
+ /// - `jina-embeddings-v2-base-es`, 161M, 768
+ /// - `jina-embeddings-v2-base-de`, 161M, 768
+ /// - `jina-embeddings-v2-base-zh`, 161M, 768
+ /// - `jina-embeddings-v2-base-code`, 137M, 768
+ /// - `jina-embeddings-v3`, 570M, 1024
+ /// For more information, please checkout our [technical blog](https://arxiv.org/abs/2307.11224). + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// The identifier of the classifier. If not provided, a new classifier will be created.
+ /// You can provide only either `model` or `classifier_id` + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("classifier_id")] + public string? ClassifierId { get; set; } + + /// + /// List of text and images or a single text and image for classification + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Jina.JsonConverters.AnyOfJsonConverterFactory4))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Jina.AnyOf>, global::Jina.ApiSchemasClassificationTextDoc, global::Jina.ApiSchemasClassificationImageDoc, string> Input { get; set; } + + /// + /// List of labels used for classification + /// + [global::System.Text.Json.Serialization.JsonPropertyName("labels")] + public global::System.Collections.Generic.IList? Labels { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Jina.ClassificationAPIInput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Jina.ClassificationAPIInput), + jsonSerializerContext) as global::Jina.ClassificationAPIInput; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Jina.ClassificationAPIInput? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.Models.ClassificationOutput.g.cs b/src/libs/Jina/Generated/Jina.Models.ClassificationOutput.g.cs new file mode 100644 index 0000000..c827c99 --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.ClassificationOutput.g.cs @@ -0,0 +1,89 @@ + +#nullable enable + +namespace Jina +{ + /// + /// Output of the classification service + /// + public sealed partial class ClassificationOutput + { + /// + /// A list of Classification Objects returned by the classification service + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Total usage of the request. Sums up the usage from each individual input + /// + [global::System.Text.Json.Serialization.JsonPropertyName("usage")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Jina.ApiSchemasClassificationUsage Usage { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Jina.ClassificationOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Jina.ClassificationOutput), + jsonSerializerContext) as global::Jina.ClassificationOutput; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Jina.ClassificationOutput? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.Models.ClassificationOutputDataItem.g.cs b/src/libs/Jina/Generated/Jina.Models.ClassificationOutputDataItem.g.cs new file mode 100644 index 0000000..5227776 --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.ClassificationOutputDataItem.g.cs @@ -0,0 +1,76 @@ + +#nullable enable + +namespace Jina +{ + /// + /// + /// + public sealed partial class ClassificationOutputDataItem + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Jina.ClassificationOutputDataItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Jina.ClassificationOutputDataItem), + jsonSerializerContext) as global::Jina.ClassificationOutputDataItem; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Jina.ClassificationOutputDataItem? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.Models.ImageEmbeddingInput.g.cs b/src/libs/Jina/Generated/Jina.Models.ImageEmbeddingInput.g.cs index b0dedd5..2eb2e9a 100644 --- a/src/libs/Jina/Generated/Jina.Models.ImageEmbeddingInput.g.cs +++ b/src/libs/Jina/Generated/Jina.Models.ImageEmbeddingInput.g.cs @@ -26,7 +26,7 @@ public sealed partial class ImageEmbeddingInput [global::System.Text.Json.Serialization.JsonPropertyName("input")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Jina.JsonConverters.AnyOfJsonConverterFactory2))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Jina.AnyOf> Input { get; set; } + public required global::Jina.AnyOf> Input { get; set; } /// /// The format in which you want the embeddings to be returned.Possible value are `float`, `base64`, `binary`, `ubinary` or a list containing any of them. Defaults to `float` diff --git a/src/libs/Jina/Generated/Jina.Models.ImageExampleDoc.g.cs b/src/libs/Jina/Generated/Jina.Models.ImageExampleDoc.g.cs new file mode 100644 index 0000000..c8d595a --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.ImageExampleDoc.g.cs @@ -0,0 +1,117 @@ + +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Jina +{ + /// + /// ImageDoc with fields and a label + /// + public sealed partial class ImageExampleDoc + { + /// + /// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value
+ /// Example: e10b550cf99e2e072e22420af5c6eb47 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// URL of an image file + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// base64 representation of the Image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("bytes")] + public byte[]? Bytes { get; set; } + + /// + /// base64 representation of the Image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("bytesname")] + public string? Bytesname { get; set; } + + /// + /// Image representation that can hold URL of an image or a base64 representation + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Jina.JsonConverters.AnyOfJsonConverterFactory2))] + public global::Jina.AnyOf? Image { get; set; } + + /// + /// The label of the image + /// + [global::System.Text.Json.Serialization.JsonPropertyName("label")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Jina.JsonConverters.AnyOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Jina.AnyOf Label { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Jina.ImageExampleDoc? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Jina.ImageExampleDoc), + jsonSerializerContext) as global::Jina.ImageExampleDoc; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Jina.ImageExampleDoc? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.Models.MixedEmbeddingInput.g.cs b/src/libs/Jina/Generated/Jina.Models.MixedEmbeddingInput.g.cs index 8639f0e..a8f061d 100644 --- a/src/libs/Jina/Generated/Jina.Models.MixedEmbeddingInput.g.cs +++ b/src/libs/Jina/Generated/Jina.Models.MixedEmbeddingInput.g.cs @@ -25,7 +25,7 @@ public sealed partial class MixedEmbeddingInput ///
[global::System.Text.Json.Serialization.JsonPropertyName("input")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList> Input { get; set; } + public required global::System.Collections.Generic.IList> Input { get; set; } /// /// The format in which you want the embeddings to be returned.Possible value are `float`, `base64`, `binary`, `ubinary` or a list containing any of them. Defaults to `float` diff --git a/src/libs/Jina/Generated/Jina.Models.TextExampleDoc.g.cs b/src/libs/Jina/Generated/Jina.Models.TextExampleDoc.g.cs new file mode 100644 index 0000000..bff5699 --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.TextExampleDoc.g.cs @@ -0,0 +1,99 @@ + +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Jina +{ + /// + /// Document containing a text field and a label + /// + public sealed partial class TextExampleDoc + { + /// + /// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value
+ /// Example: e10b550cf99e2e072e22420af5c6eb47 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// The example text + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Text { get; set; } + + /// + /// The label of the text + /// + [global::System.Text.Json.Serialization.JsonPropertyName("label")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Jina.JsonConverters.AnyOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Jina.AnyOf Label { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Jina.TextExampleDoc? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Jina.TextExampleDoc), + jsonSerializerContext) as global::Jina.TextExampleDoc; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Jina.TextExampleDoc? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.Models.TrainingAPIInput.g.cs b/src/libs/Jina/Generated/Jina.Models.TrainingAPIInput.g.cs new file mode 100644 index 0000000..d19793f --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.TrainingAPIInput.g.cs @@ -0,0 +1,115 @@ + +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Jina +{ + /// + /// The input to the API for train the classifier. OpenAI compatible + /// + public sealed partial class TrainingAPIInput + { + /// + /// The identifier of the model.
+ /// Available models and corresponding param size and dimension:
+ /// - `jina-clip-v1`, 223M, 768
+ /// - `jina-embeddings-v2-base-en`, 137M, 768
+ /// - `jina-embeddings-v2-base-es`, 161M, 768
+ /// - `jina-embeddings-v2-base-de`, 161M, 768
+ /// - `jina-embeddings-v2-base-zh`, 161M, 768
+ /// - `jina-embeddings-v2-base-code`, 137M, 768
+ /// For more information, please checkout our [technical blog](https://arxiv.org/abs/2307.11224).
+ /// You can provide only either `model` or `classifier_id` + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// The identifier of the classifier. If not provided, a new classifier will be created.
+ /// You can provide only either `model` or `classifier_id` + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("classifier_id")] + public string? ClassifierId { get; set; } + + /// + /// The visibility of the classifier when created. Will be ignored if `classifier_id` is provided
+ /// Default Value: public + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("visibility")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Jina.JsonConverters.TrainingAPIInputVisibilityJsonConverter))] + public global::Jina.TrainingAPIInputVisibility? Visibility { get; set; } = global::Jina.TrainingAPIInputVisibility.Public; + + /// + /// List of text and images and labels or a single text and image and label to train the classifier + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Jina.JsonConverters.AnyOfJsonConverterFactory3))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Jina.AnyOf>, global::Jina.TextExampleDoc, global::Jina.ImageExampleDoc> Input { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Jina.TrainingAPIInput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Jina.TrainingAPIInput), + jsonSerializerContext) as global::Jina.TrainingAPIInput; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Jina.TrainingAPIInput? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.Models.TrainingAPIInputVisibility.g.cs b/src/libs/Jina/Generated/Jina.Models.TrainingAPIInputVisibility.g.cs new file mode 100644 index 0000000..457a14a --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.TrainingAPIInputVisibility.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Jina +{ + /// + /// The visibility of the classifier when created. Will be ignored if `classifier_id` is provided
+ /// Default Value: public + ///
+ public enum TrainingAPIInputVisibility + { + /// + /// + /// + Public, + /// + /// + /// + Private, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class TrainingAPIInputVisibilityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this TrainingAPIInputVisibility value) + { + return value switch + { + TrainingAPIInputVisibility.Public => "public", + TrainingAPIInputVisibility.Private => "private", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static TrainingAPIInputVisibility? ToEnum(string value) + { + return value switch + { + "public" => TrainingAPIInputVisibility.Public, + "private" => TrainingAPIInputVisibility.Private, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/Jina.Models.TrainingOutput.g.cs b/src/libs/Jina/Generated/Jina.Models.TrainingOutput.g.cs new file mode 100644 index 0000000..fb93952 --- /dev/null +++ b/src/libs/Jina/Generated/Jina.Models.TrainingOutput.g.cs @@ -0,0 +1,96 @@ + +#nullable enable + +namespace Jina +{ + /// + /// Output of the training service + /// + public sealed partial class TrainingOutput + { + /// + /// The identifier of the classifier that was trained + /// + [global::System.Text.Json.Serialization.JsonPropertyName("classifier_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ClassifierId { get; set; } + + /// + /// The number of samples that were used to train the classifier + /// + [global::System.Text.Json.Serialization.JsonPropertyName("num_samples")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int NumSamples { get; set; } + + /// + /// Total usage of the request. Sums up the usage from each individual input + /// + [global::System.Text.Json.Serialization.JsonPropertyName("usage")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Jina.ApiSchemasTrainingUsage Usage { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Jina.TrainingOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Jina.TrainingOutput), + jsonSerializerContext) as global::Jina.TrainingOutput; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Jina.TrainingOutput? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Jina/Generated/JsonConverters.TrainingAPIInputVisibility.g.cs b/src/libs/Jina/Generated/JsonConverters.TrainingAPIInputVisibility.g.cs new file mode 100644 index 0000000..6404298 --- /dev/null +++ b/src/libs/Jina/Generated/JsonConverters.TrainingAPIInputVisibility.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace Jina.JsonConverters +{ + /// + public sealed class TrainingAPIInputVisibilityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Jina.TrainingAPIInputVisibility Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Jina.TrainingAPIInputVisibilityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Jina.TrainingAPIInputVisibility)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Jina.TrainingAPIInputVisibility value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Jina.TrainingAPIInputVisibilityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Jina/Generated/JsonConverters.TrainingAPIInputVisibilityNullable.g.cs b/src/libs/Jina/Generated/JsonConverters.TrainingAPIInputVisibilityNullable.g.cs new file mode 100644 index 0000000..fb30220 --- /dev/null +++ b/src/libs/Jina/Generated/JsonConverters.TrainingAPIInputVisibilityNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Jina.JsonConverters +{ + /// + public sealed class TrainingAPIInputVisibilityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Jina.TrainingAPIInputVisibility? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Jina.TrainingAPIInputVisibilityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Jina.TrainingAPIInputVisibility)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Jina.TrainingAPIInputVisibility? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Jina.TrainingAPIInputVisibilityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Jina/Generated/JsonSerializerContext.g.cs b/src/libs/Jina/Generated/JsonSerializerContext.g.cs index 51006c9..f33dc2b 100644 --- a/src/libs/Jina/Generated/JsonSerializerContext.g.cs +++ b/src/libs/Jina/Generated/JsonSerializerContext.g.cs @@ -35,10 +35,12 @@ namespace Jina typeof(global::Jina.JsonConverters.TextEmbeddingAPIInputEmbeddingTypeNullableJsonConverter), typeof(global::Jina.JsonConverters.TextEmbeddingAPIInputEmbeddingTypeItemJsonConverter), typeof(global::Jina.JsonConverters.TextEmbeddingAPIInputEmbeddingTypeItemNullableJsonConverter), - typeof(global::Jina.JsonConverters.EmbeddingInputJsonConverter), + typeof(global::Jina.JsonConverters.TrainingAPIInputVisibilityJsonConverter), + typeof(global::Jina.JsonConverters.TrainingAPIInputVisibilityNullableJsonConverter), typeof(global::Jina.JsonConverters.AnyOfJsonConverterFactory4), - typeof(global::Jina.JsonConverters.AnyOfJsonConverterFactory2), typeof(global::Jina.JsonConverters.AnyOfJsonConverterFactory3), + typeof(global::Jina.JsonConverters.AnyOfJsonConverterFactory2), + typeof(global::Jina.JsonConverters.EmbeddingInputJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Jina.JsonSerializerContextTypes))] diff --git a/src/libs/Jina/Generated/JsonSerializerContextTypes.g.cs b/src/libs/Jina/Generated/JsonSerializerContextTypes.g.cs index 4b9a199..e2fcd31 100644 --- a/src/libs/Jina/Generated/JsonSerializerContextTypes.g.cs +++ b/src/libs/Jina/Generated/JsonSerializerContextTypes.g.cs @@ -46,246 +46,318 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Jina.ColbertModelEmbeddingsOutput? Type7 { get; set; } + public global::Jina.ClassificationAPIInput? Type7 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type8 { get; set; } + public global::Jina.AnyOf>, global::Jina.ApiSchemasClassificationTextDoc, global::Jina.ApiSchemasClassificationImageDoc, string>? Type8 { get; set; } /// /// /// - public object? Type9 { get; set; } + public global::System.Collections.Generic.IList>? Type9 { get; set; } /// /// /// - public global::Jina.ApiSchemasEmbeddingUsage? Type10 { get; set; } + public global::Jina.AnyOf? Type10 { get; set; } /// /// /// - public global::Jina.DownloadResultResponse? Type11 { get; set; } + public global::Jina.ApiSchemasClassificationTextDoc? Type11 { get; set; } /// /// /// - public global::Jina.EmbeddingInput? Type12 { get; set; } + public global::Jina.ApiSchemasClassificationImageDoc? Type12 { get; set; } /// /// /// - public global::Jina.TextEmbeddingInput? Type13 { get; set; } + public global::Jina.AnyOf? Type13 { get; set; } /// /// /// - public global::Jina.AnyOf, string, global::System.Collections.Generic.IList, global::Jina.ApiSchemasEmbeddingTextDoc>? Type14 { get; set; } + public global::System.Collections.Generic.IList? Type14 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type15 { get; set; } + public global::Jina.ClassificationOutput? Type15 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type16 { get; set; } + public global::System.Collections.Generic.IList? Type16 { get; set; } /// /// /// - public global::Jina.ApiSchemasEmbeddingTextDoc? Type17 { get; set; } + public object? Type17 { get; set; } /// /// /// - public global::Jina.AnyOf>? Type18 { get; set; } + public global::Jina.ApiSchemasClassificationUsage? Type18 { get; set; } /// /// /// - public global::Jina.TextEmbeddingInputEmbeddingType? Type19 { get; set; } + public global::Jina.ColbertModelEmbeddingsOutput? Type19 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type20 { get; set; } + public global::Jina.ApiSchemasEmbeddingUsage? Type20 { get; set; } /// /// /// - public global::Jina.TextEmbeddingInputEmbeddingTypeItem? Type21 { get; set; } + public global::Jina.DownloadResultResponse? Type21 { get; set; } /// /// /// - public global::Jina.TextEmbeddingInputTask? Type22 { get; set; } + public global::Jina.EmbeddingInput? Type22 { get; set; } /// /// /// - public bool? Type23 { get; set; } + public global::Jina.TextEmbeddingInput? Type23 { get; set; } /// /// /// - public global::Jina.ImageEmbeddingInput? Type24 { get; set; } + public global::Jina.AnyOf, string, global::System.Collections.Generic.IList, global::Jina.ApiSchemasEmbeddingTextDoc>? Type24 { get; set; } /// /// /// - public global::Jina.AnyOf>? Type25 { get; set; } + public global::System.Collections.Generic.IList? Type25 { get; set; } /// /// /// - public global::Jina.ImageDoc? Type26 { get; set; } + public global::Jina.ApiSchemasEmbeddingTextDoc? Type26 { get; set; } /// /// /// - public global::Jina.AnyOf? Type27 { get; set; } + public global::Jina.AnyOf>? Type27 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type28 { get; set; } + public global::Jina.TextEmbeddingInputEmbeddingType? Type28 { get; set; } /// /// /// - public global::Jina.AnyOf>? Type29 { get; set; } + public global::System.Collections.Generic.IList? Type29 { get; set; } /// /// /// - public global::Jina.ImageEmbeddingInputEmbeddingType? Type30 { get; set; } + public global::Jina.TextEmbeddingInputEmbeddingTypeItem? Type30 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type31 { get; set; } + public global::Jina.TextEmbeddingInputTask? Type31 { get; set; } /// /// /// - public global::Jina.ImageEmbeddingInputEmbeddingTypeItem? Type32 { get; set; } + public bool? Type32 { get; set; } /// /// /// - public global::Jina.MixedEmbeddingInput? Type33 { get; set; } + public global::Jina.ImageEmbeddingInput? Type33 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type34 { get; set; } + public global::Jina.AnyOf>? Type34 { get; set; } /// /// /// - public global::Jina.AnyOf? Type35 { get; set; } + public global::Jina.ApiSchemasEmbeddingImageDoc? Type35 { get; set; } /// /// /// - public global::Jina.AnyOf>? Type36 { get; set; } + public global::System.Collections.Generic.IList? Type36 { get; set; } /// /// /// - public global::Jina.MixedEmbeddingInputEmbeddingType? Type37 { get; set; } + public global::Jina.AnyOf>? Type37 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type38 { get; set; } + public global::Jina.ImageEmbeddingInputEmbeddingType? Type38 { get; set; } /// /// /// - public global::Jina.MixedEmbeddingInputEmbeddingTypeItem? Type39 { get; set; } + public global::System.Collections.Generic.IList? Type39 { get; set; } /// /// /// - public global::Jina.HTTPValidationError? Type40 { get; set; } + public global::Jina.ImageEmbeddingInputEmbeddingTypeItem? Type40 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type41 { get; set; } + public global::Jina.MixedEmbeddingInput? Type41 { get; set; } /// /// /// - public global::Jina.ValidationError? Type42 { get; set; } + public global::System.Collections.Generic.IList>? Type42 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type43 { get; set; } + public global::Jina.AnyOf? Type43 { get; set; } /// /// /// - public global::Jina.AnyOf? Type44 { get; set; } + public global::Jina.AnyOf>? Type44 { get; set; } /// /// /// - public global::Jina.ModelEmbeddingOutput? Type45 { get; set; } + public global::Jina.MixedEmbeddingInputEmbeddingType? Type45 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type46 { get; set; } + public global::System.Collections.Generic.IList? Type46 { get; set; } /// /// /// - public global::Jina.ModelEmbeddingOutputDataItem? Type47 { get; set; } + public global::Jina.MixedEmbeddingInputEmbeddingTypeItem? Type47 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type48 { get; set; } + public global::Jina.HTTPValidationError? Type48 { get; set; } /// /// /// - public float? Type49 { get; set; } + public global::System.Collections.Generic.IList? Type49 { get; set; } /// /// /// - public global::Jina.RankAPIInput? Type50 { get; set; } + public global::Jina.ValidationError? Type50 { get; set; } /// /// /// - public global::Jina.AnyOf? Type51 { get; set; } + public global::System.Collections.Generic.IList>? Type51 { get; set; } /// /// /// - public global::Jina.ApiSchemasRankTextDoc? Type52 { get; set; } + public global::Jina.AnyOf? Type52 { get; set; } /// /// /// - public global::Jina.AnyOf, global::System.Collections.Generic.IList>? Type53 { get; set; } + public global::Jina.ImageExampleDoc? Type53 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type54 { get; set; } + public global::Jina.AnyOf? Type54 { get; set; } /// /// /// - public global::Jina.RankingOutput? Type55 { get; set; } + public global::Jina.ModelEmbeddingOutput? Type55 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type56 { get; set; } + public global::System.Collections.Generic.IList? Type56 { get; set; } /// /// /// - public global::Jina.RankingOutputResult? Type57 { get; set; } + public global::Jina.ModelEmbeddingOutputDataItem? Type57 { get; set; } /// /// /// - public long? Type58 { get; set; } + public global::System.Collections.Generic.IList? Type58 { get; set; } /// /// /// - public double? Type59 { get; set; } + public float? Type59 { get; set; } /// /// /// - public global::Jina.RankingOutputResultDocument? Type60 { get; set; } + public global::Jina.RankAPIInput? Type60 { get; set; } /// /// /// - public global::Jina.ApiSchemasRankUsage? Type61 { get; set; } + public global::Jina.AnyOf? Type61 { get; set; } /// /// /// - public global::Jina.TextEmbeddingAPIInput? Type62 { get; set; } + public global::Jina.ApiSchemasRankTextDoc? Type62 { get; set; } /// /// /// - public global::Jina.TextEmbeddingAPIInputInputType? Type63 { get; set; } + public global::Jina.AnyOf, global::System.Collections.Generic.IList>? Type63 { get; set; } /// /// /// - public global::Jina.AnyOf>? Type64 { get; set; } + public global::System.Collections.Generic.IList? Type64 { get; set; } /// /// /// - public global::Jina.TextEmbeddingAPIInputEmbeddingType? Type65 { get; set; } + public global::Jina.RankingOutput? Type65 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type66 { get; set; } + public global::System.Collections.Generic.IList? Type66 { get; set; } /// /// /// - public global::Jina.TextEmbeddingAPIInputEmbeddingTypeItem? Type67 { get; set; } + public global::Jina.RankingOutputResult? Type67 { get; set; } + /// + /// + /// + public long? Type68 { get; set; } + /// + /// + /// + public double? Type69 { get; set; } + /// + /// + /// + public global::Jina.RankingOutputResultDocument? Type70 { get; set; } + /// + /// + /// + public global::Jina.ApiSchemasRankUsage? Type71 { get; set; } + /// + /// + /// + public global::Jina.TextEmbeddingAPIInput? Type72 { get; set; } + /// + /// + /// + public global::Jina.TextEmbeddingAPIInputInputType? Type73 { get; set; } + /// + /// + /// + public global::Jina.AnyOf>? Type74 { get; set; } + /// + /// + /// + public global::Jina.TextEmbeddingAPIInputEmbeddingType? Type75 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type76 { get; set; } + /// + /// + /// + public global::Jina.TextEmbeddingAPIInputEmbeddingTypeItem? Type77 { get; set; } + /// + /// + /// + public global::Jina.TextExampleDoc? Type78 { get; set; } + /// + /// + /// + public global::Jina.TrainingAPIInput? Type79 { get; set; } + /// + /// + /// + public global::Jina.TrainingAPIInputVisibility? Type80 { get; set; } + /// + /// + /// + public global::Jina.AnyOf>, global::Jina.TextExampleDoc, global::Jina.ImageExampleDoc>? Type81 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList>? Type82 { get; set; } + /// + /// + /// + public global::Jina.AnyOf? Type83 { get; set; } + /// + /// + /// + public global::Jina.TrainingOutput? Type84 { get; set; } + /// + /// + /// + public global::Jina.ApiSchemasTrainingUsage? Type85 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Jina/openapi.yaml b/src/libs/Jina/openapi.yaml index 6a759b0..8fcd525 100644 --- a/src/libs/Jina/openapi.yaml +++ b/src/libs/Jina/openapi.yaml @@ -142,6 +142,62 @@ paths: $ref: '#/components/schemas/HTTPValidationError' security: - HTTPBearer: [ ] + /v1/train: + post: + tags: + - classification + summary: Train + description: Rank pairs. + operationId: train_v1_train_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TrainingAPIInput' + required: true + responses: + '200': + description: Training output + content: + application/json: + schema: + $ref: '#/components/schemas/TrainingOutput' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + security: + - HTTPBearer: [ ] + /v1/classify: + post: + tags: + - classification + summary: Classify + description: Classify. + operationId: classify_v1_classify_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClassificationAPIInput' + required: true + responses: + '200': + description: Classification output + content: + application/json: + schema: + $ref: '#/components/schemas/ClassificationOutput' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + security: + - HTTPBearer: [ ] /v1/multi-vector: post: tags: @@ -303,6 +359,77 @@ components: - completed type: string description: An enumeration. + ClassificationAPIInput: + title: ClassificationAPIInput + required: + - input + type: object + properties: + model: + title: Model + type: string + description: "The identifier of the model.\n\nAvailable models and corresponding param size and dimension:\n- `jina-clip-v1`,\t223M,\t768\n- `jina-embeddings-v2-base-en`,\t137M,\t768\n- `jina-embeddings-v2-base-es`,\t161M,\t768\n- `jina-embeddings-v2-base-de`,\t161M,\t768\n- `jina-embeddings-v2-base-zh`,\t161M,\t768\n- `jina-embeddings-v2-base-code`,\t137M,\t768\n- `jina-embeddings-v3`,\t570M,\t1024\n\nFor more information, please checkout our [technical blog](https://arxiv.org/abs/2307.11224).\n" + classifier_id: + title: Classifier Id + type: string + description: "The identifier of the classifier. If not provided, a new classifier will be created.\nYou can provide only either `model` or `classifier_id`" + input: + title: Input + anyOf: + - type: array + items: + anyOf: + - $ref: '#/components/schemas/api_schemas__classification__TextDoc' + - $ref: '#/components/schemas/api_schemas__classification__ImageDoc' + - type: string + - $ref: '#/components/schemas/api_schemas__classification__TextDoc' + - $ref: '#/components/schemas/api_schemas__classification__ImageDoc' + - type: string + description: List of text and images or a single text and image for classification + labels: + title: Labels + type: array + items: + type: string + description: List of labels used for classification + additionalProperties: false + description: The input to the API for classify endpoint. OpenAI compatible + example: + classifier_id: classifier_id + input: + - text: text1 + - text: text2 + ClassificationOutput: + title: ClassificationOutput + required: + - data + - usage + type: object + properties: + data: + title: Data + type: array + items: { } + description: A list of Classification Objects returned by the classification service + usage: + title: Usage + allOf: + - $ref: '#/components/schemas/api_schemas__classification__Usage' + description: Total usage of the request. Sums up the usage from each individual input + description: Output of the classification service + example: + data: + - index: 0 + prediction: label1 + object: classification + score: 0.75 + - index: 1 + prediction: label2 + object: classification + score: 0.54 + usage: + total_tokens: 15 + prompt_tokens: 15 ColbertModelEmbeddingsOutput: title: ColbertModelEmbeddingsOutput required: @@ -394,37 +521,6 @@ components: title: HealthModel type: object description: 'Pydantic BaseModel for Jina health check, used as the response model in REST app.' - ImageDoc: - title: ImageDoc - type: object - properties: - id: - title: Id - type: string - description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value' - url: - title: Url - maxLength: 65536 - minLength: 1 - type: string - description: URL of an image file - format: uri - bytes: - title: Bytes - type: string - description: base64 representation of the Image. - format: binary - image: - title: Image - anyOf: - - maxLength: 65536 - minLength: 1 - type: string - format: uri - - type: string - format: binary - description: Image representation that can hold URL of an image or a base64 representation - description: ImageDoc with fields ImageEmbeddingInput: title: ImageEmbeddingInput required: @@ -439,10 +535,10 @@ components: input: title: Input anyOf: - - $ref: '#/components/schemas/ImageDoc' + - $ref: '#/components/schemas/api_schemas__embedding__ImageDoc' - type: array items: - $ref: '#/components/schemas/ImageDoc' + $ref: '#/components/schemas/api_schemas__embedding__ImageDoc' description: List of images to embed embedding_type: title: Embedding Type @@ -472,6 +568,46 @@ components: model: clip input: - bytes or URL + ImageExampleDoc: + title: ImageExampleDoc + required: + - label + type: object + properties: + id: + title: Id + type: string + description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value' + example: e10b550cf99e2e072e22420af5c6eb47 + url: + title: Url + maxLength: 65536 + minLength: 1 + type: string + description: URL of an image file + format: uri + bytes: + title: Bytes + type: string + description: base64 representation of the Image. + format: binary + image: + title: Image + anyOf: + - maxLength: 65536 + minLength: 1 + type: string + format: uri + - type: string + format: binary + description: Image representation that can hold URL of an image or a base64 representation + label: + title: Label + anyOf: + - type: boolean + - type: string + description: The label of the image + description: ImageDoc with fields and a label MixedEmbeddingInput: title: MixedEmbeddingInput required: @@ -488,7 +624,7 @@ components: type: array items: anyOf: - - $ref: '#/components/schemas/ImageDoc' + - $ref: '#/components/schemas/api_schemas__embedding__ImageDoc' - $ref: '#/components/schemas/api_schemas__embedding__TextDoc' - type: string description: List of text and images to embed @@ -800,6 +936,100 @@ components: model: jina-embeddings-v2-base-en input: - 'Hello, world!' + TextExampleDoc: + title: TextExampleDoc + required: + - text + - label + type: object + properties: + id: + title: Id + type: string + description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value' + example: e10b550cf99e2e072e22420af5c6eb47 + text: + title: Text + type: string + description: The example text + label: + title: Label + anyOf: + - type: boolean + - type: string + description: The label of the text + description: Document containing a text field and a label + TrainingAPIInput: + title: TrainingAPIInput + required: + - input + type: object + properties: + model: + title: Model + type: string + description: "The identifier of the model.\n\nAvailable models and corresponding param size and dimension:\n- `jina-clip-v1`,\t223M,\t768\n- `jina-embeddings-v2-base-en`,\t137M,\t768\n- `jina-embeddings-v2-base-es`,\t161M,\t768\n- `jina-embeddings-v2-base-de`,\t161M,\t768\n- `jina-embeddings-v2-base-zh`,\t161M,\t768\n- `jina-embeddings-v2-base-code`,\t137M,\t768\n\nFor more information, please checkout our [technical blog](https://arxiv.org/abs/2307.11224).\n\nYou can provide only either `model` or `classifier_id`" + classifier_id: + title: Classifier Id + type: string + description: "The identifier of the classifier. If not provided, a new classifier will be created.\nYou can provide only either `model` or `classifier_id`" + visibility: + title: Visibility + enum: + - public + - private + type: string + description: The visibility of the classifier when created. Will be ignored if `classifier_id` is provided + default: public + input: + title: Input + anyOf: + - type: array + items: + anyOf: + - $ref: '#/components/schemas/TextExampleDoc' + - $ref: '#/components/schemas/ImageExampleDoc' + - $ref: '#/components/schemas/TextExampleDoc' + - $ref: '#/components/schemas/ImageExampleDoc' + description: List of text and images and labels or a single text and image and label to train the classifier + additionalProperties: false + description: The input to the API for train the classifier. OpenAI compatible + example: + model: jina-embeddings-v2-base-en + visibility: public + input: + - text: text1 + label: label1 + - text: text2 + label: label2 + TrainingOutput: + title: TrainingOutput + required: + - classifier_id + - num_samples + - usage + type: object + properties: + classifier_id: + title: Classifier Id + type: string + description: The identifier of the classifier that was trained + num_samples: + title: Num Samples + type: integer + description: The number of samples that were used to train the classifier + usage: + title: Usage + allOf: + - $ref: '#/components/schemas/api_schemas__training__Usage' + description: Total usage of the request. Sums up the usage from each individual input + description: Output of the training service + example: + classifier_id: classifier_id + num_samples: 10 + usage: + total_tokens: 15 + prompt_tokens: 15 ValidationError: title: ValidationError required: @@ -821,6 +1051,100 @@ components: type: title: Error Type type: string + api_schemas__classification__ImageDoc: + title: ImageDoc + type: object + properties: + id: + title: Id + type: string + description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value' + example: e10b550cf99e2e072e22420af5c6eb47 + url: + title: Url + maxLength: 65536 + minLength: 1 + type: string + description: URL of an image file + format: uri + bytes: + title: Bytes + type: string + description: base64 representation of the Image. + format: binary + image: + title: Image + anyOf: + - maxLength: 65536 + minLength: 1 + type: string + format: uri + - type: string + format: binary + description: Image representation that can hold URL of an image or a base64 representation + description: ImageDoc with fields + api_schemas__classification__TextDoc: + title: TextDoc + required: + - text + type: object + properties: + id: + title: Id + type: string + description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value' + example: e10b550cf99e2e072e22420af5c6eb47 + text: + title: Text + type: string + description: Document containing a text field + api_schemas__classification__Usage: + title: Usage + required: + - total_tokens + - prompt_tokens + type: object + properties: + total_tokens: + title: Total Tokens + type: integer + description: The number of tokens used by all the texts in the input + prompt_tokens: + title: Prompt Tokens + type: integer + description: Same as total_tokens + api_schemas__embedding__ImageDoc: + title: ImageDoc + type: object + properties: + id: + title: Id + type: string + description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value' + example: e10b550cf99e2e072e22420af5c6eb47 + url: + title: Url + maxLength: 65536 + minLength: 1 + type: string + description: URL of an image file + format: uri + bytes: + title: Bytes + type: string + description: base64 representation of the Image. + format: binary + image: + title: Image + anyOf: + - maxLength: 65536 + minLength: 1 + type: string + format: uri + - type: string + format: binary + description: Image representation that can hold URL of an image or a base64 representation + description: ImageDoc with fields api_schemas__embedding__TextDoc: title: TextDoc required: @@ -831,6 +1155,7 @@ components: title: Id type: string description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value' + example: e10b550cf99e2e072e22420af5c6eb47 text: title: Text type: string @@ -860,6 +1185,7 @@ components: title: Id type: string description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value' + example: e10b550cf99e2e072e22420af5c6eb47 text: title: Text type: string @@ -882,6 +1208,21 @@ components: example: total_tokens: 15 prompt_tokens: 15 + api_schemas__training__Usage: + title: Usage + required: + - total_tokens + - prompt_tokens + type: object + properties: + total_tokens: + title: Total Tokens + type: integer + description: The number of tokens used by all the texts in the input + prompt_tokens: + title: Prompt Tokens + type: integer + description: Same as total_tokens securitySchemes: HTTPBearer: type: http