Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Update OpenAPI specification for Jina Embedding Serving API to 0.1.92 #80

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ partial void ProcessClassifyResponseContent(
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// - `jina-embeddings-v2-base-en`, 137M, 768<br/>
/// - `jina-embeddings-v2-base-es`, 161M, 768<br/>
/// - `jina-embeddings-v2-base-de`, 161M, 768<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ partial void ProcessTrainResponseContent(
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// - `jina-embeddings-v2-base-en`, 137M, 768<br/>
/// - `jina-embeddings-v2-base-es`, 161M, 768<br/>
/// - `jina-embeddings-v2-base-de`, 161M, 768<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public partial interface IClassificationClient
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// - `jina-embeddings-v2-base-en`, 137M, 768<br/>
/// - `jina-embeddings-v2-base-es`, 161M, 768<br/>
/// - `jina-embeddings-v2-base-de`, 161M, 768<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public partial interface IClassificationClient
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// - `jina-embeddings-v2-base-en`, 137M, 768<br/>
/// - `jina-embeddings-v2-base-es`, 161M, 768<br/>
/// - `jina-embeddings-v2-base-de`, 161M, 768<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public sealed partial class ClassificationAPIInput
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// - `jina-embeddings-v2-base-en`, 137M, 768<br/>
/// - `jina-embeddings-v2-base-es`, 161M, 768<br/>
/// - `jina-embeddings-v2-base-de`, 161M, 768<br/>
Expand Down Expand Up @@ -59,6 +60,7 @@ public sealed partial class ClassificationAPIInput
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// - `jina-embeddings-v2-base-en`, 137M, 768<br/>
/// - `jina-embeddings-v2-base-es`, 161M, 768<br/>
/// - `jina-embeddings-v2-base-de`, 161M, 768<br/>
Expand Down
15 changes: 14 additions & 1 deletion src/libs/Jina/Generated/Jina.Models.ImageEmbeddingInput.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public sealed partial class ImageEmbeddingInput
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// For more information, please checkout our [technical blog](https://arxiv.org/abs/2405.20204).
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("model")]
Expand Down Expand Up @@ -41,6 +42,12 @@ public sealed partial class ImageEmbeddingInput
[global::System.Text.Json.Serialization.JsonPropertyName("normalized")]
public bool? Normalized { get; set; }

/// <summary>
/// Used to specify output embedding size. If set, output embeddings will be truncated to the size specified.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("dimensions")]
public int? Dimensions { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand All @@ -54,6 +61,7 @@ public sealed partial class ImageEmbeddingInput
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// For more information, please checkout our [technical blog](https://arxiv.org/abs/2405.20204).
/// </param>
/// <param name="input">
Expand All @@ -65,17 +73,22 @@ public sealed partial class ImageEmbeddingInput
/// <param name="normalized">
/// Flag to determine if the embeddings should be normalized to have a unit L2 norm
/// </param>
/// <param name="dimensions">
/// Used to specify output embedding size. If set, output embeddings will be truncated to the size specified.
/// </param>
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public ImageEmbeddingInput(
string model,
global::Jina.AnyOf<global::Jina.ApiSchemasEmbeddingImageDoc, global::System.Collections.Generic.IList<global::Jina.ApiSchemasEmbeddingImageDoc>> input,
global::Jina.AnyOf<global::Jina.ImageEmbeddingInputEmbeddingType?, global::System.Collections.Generic.IList<global::Jina.ImageEmbeddingInputEmbeddingTypeItem>>? embeddingType,
bool? normalized)
bool? normalized,
int? dimensions)
{
this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model));
this.Input = input;
this.EmbeddingType = embeddingType;
this.Normalized = normalized;
this.Dimensions = dimensions;
}

/// <summary>
Expand Down
15 changes: 14 additions & 1 deletion src/libs/Jina/Generated/Jina.Models.MixedEmbeddingInput.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public sealed partial class MixedEmbeddingInput
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// For more information, please checkout our [technical blog](https://arxiv.org/abs/2405.20204).
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("model")]
Expand All @@ -40,6 +41,12 @@ public sealed partial class MixedEmbeddingInput
[global::System.Text.Json.Serialization.JsonPropertyName("normalized")]
public bool? Normalized { get; set; }

/// <summary>
/// Used to specify output embedding size. If set, output embeddings will be truncated to the size specified.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("dimensions")]
public int? Dimensions { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand All @@ -53,6 +60,7 @@ public sealed partial class MixedEmbeddingInput
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// For more information, please checkout our [technical blog](https://arxiv.org/abs/2405.20204).
/// </param>
/// <param name="input">
Expand All @@ -64,17 +72,22 @@ public sealed partial class MixedEmbeddingInput
/// <param name="normalized">
/// Flag to determine if the embeddings should be normalized to have a unit L2 norm
/// </param>
/// <param name="dimensions">
/// Used to specify output embedding size. If set, output embeddings will be truncated to the size specified.
/// </param>
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public MixedEmbeddingInput(
string model,
global::System.Collections.Generic.IList<global::Jina.AnyOf<global::Jina.ApiSchemasEmbeddingImageDoc, global::Jina.ApiSchemasEmbeddingTextDoc, string>> input,
global::Jina.AnyOf<global::Jina.MixedEmbeddingInputEmbeddingType?, global::System.Collections.Generic.IList<global::Jina.MixedEmbeddingInputEmbeddingTypeItem>>? embeddingType,
bool? normalized)
bool? normalized,
int? dimensions)
{
this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model));
this.Input = input ?? throw new global::System.ArgumentNullException(nameof(input));
this.EmbeddingType = embeddingType;
this.Normalized = normalized;
this.Dimensions = dimensions;
}

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/libs/Jina/Generated/Jina.Models.TextEmbeddingInput.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public sealed partial class TextEmbeddingInput
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// - `jina-embeddings-v2-base-en`, 137M, 768<br/>
/// - `jina-embeddings-v2-base-es`, 161M, 768<br/>
/// - `jina-embeddings-v2-base-de`, 161M, 768<br/>
Expand Down Expand Up @@ -85,6 +86,7 @@ public sealed partial class TextEmbeddingInput
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// - `jina-embeddings-v2-base-en`, 137M, 768<br/>
/// - `jina-embeddings-v2-base-es`, 161M, 768<br/>
/// - `jina-embeddings-v2-base-de`, 161M, 768<br/>
Expand Down
2 changes: 2 additions & 0 deletions src/libs/Jina/Generated/Jina.Models.TrainingAPIInput.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public sealed partial class TrainingAPIInput
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// - `jina-embeddings-v2-base-en`, 137M, 768<br/>
/// - `jina-embeddings-v2-base-es`, 161M, 768<br/>
/// - `jina-embeddings-v2-base-de`, 161M, 768<br/>
Expand Down Expand Up @@ -68,6 +69,7 @@ public sealed partial class TrainingAPIInput
/// The identifier of the model.<br/>
/// Available models and corresponding param size and dimension:<br/>
/// - `jina-clip-v1`, 223M, 768<br/>
/// - `jina-clip-v2`, 865M, 1024<br/>
/// - `jina-embeddings-v2-base-en`, 137M, 768<br/>
/// - `jina-embeddings-v2-base-es`, 161M, 768<br/>
/// - `jina-embeddings-v2-base-de`, 161M, 768<br/>
Expand Down
1 change: 1 addition & 0 deletions src/libs/Jina/Generated/JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ namespace Jina
typeof(global::Jina.JsonConverters.AnyOfJsonConverter<global::Jina.TextEmbeddingAPIInputEmbeddingType?, global::System.Collections.Generic.IList<global::Jina.TextEmbeddingAPIInputEmbeddingTypeItem>>),
typeof(global::Jina.JsonConverters.AnyOfJsonConverter<global::System.Collections.Generic.IList<global::Jina.AnyOf<global::Jina.TextExampleDoc, global::Jina.ImageExampleDoc>>, global::Jina.TextExampleDoc, global::Jina.ImageExampleDoc>),
typeof(global::Jina.JsonConverters.AnyOfJsonConverter<global::Jina.TextExampleDoc, global::Jina.ImageExampleDoc>),
typeof(global::Jina.JsonConverters.UnixTimestampJsonConverter),
})]

[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Jina.JsonSerializerContextTypes))]
Expand Down
20 changes: 14 additions & 6 deletions src/libs/Jina/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.0.1
info:
title: The Jina Embedding Serving API
description: This is the UniversalAPI to access all the Jina embedding models
version: 0.1.89
version: 0.1.92
servers:
- url: https://api.jina.ai/
paths:
Expand Down Expand Up @@ -411,7 +411,7 @@ components:
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"
description: "The identifier of the model.\n\nAvailable models and corresponding param size and dimension:\n- `jina-clip-v1`,\t223M,\t768\n- `jina-clip-v2`,\t865M,\t1024\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
Expand Down Expand Up @@ -583,7 +583,7 @@ components:
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\nFor more information, please checkout our [technical blog](https://arxiv.org/abs/2405.20204).\n"
description: "The identifier of the model.\n\nAvailable models and corresponding param size and dimension:\n- `jina-clip-v1`,\t223M,\t768\n- `jina-clip-v2`,\t865M,\t1024\n\nFor more information, please checkout our [technical blog](https://arxiv.org/abs/2405.20204).\n"
input:
title: Input
anyOf:
Expand Down Expand Up @@ -614,6 +614,10 @@ components:
title: Normalized
type: boolean
description: Flag to determine if the embeddings should be normalized to have a unit L2 norm
dimensions:
title: Dimensions
type: integer
description: 'Used to specify output embedding size. If set, output embeddings will be truncated to the size specified.'
Comment on lines +617 to +620
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Inconsistency found in dimensions property definition

The dimensions property is defined differently across schemas:

  • ImageEmbeddingInput and MixedEmbeddingInput have consistent definitions with type: integer and truncation description
  • However, another schema (likely TextEmbeddingInput) has a different definition with an enum restricting values to [64, 96]

This inconsistency in property definitions could lead to confusion and potential issues. The schemas should either:

  • All use the flexible integer type with truncation behavior, or
  • All use the enum with specific allowed dimensions
🔗 Analysis chain

LGTM: Dimensions property consistently added

The dimensions property has been consistently added to relevant schemas with clear documentation about truncation behavior.

Also applies to: 707-710


Let me verify the exact definition of the dimensions property across all schemas to ensure complete consistency.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that dimensions property is consistently defined across schemas
# and that no schema is missing this property where it should be present

# Search for all schema definitions that might need the dimensions property
rg -l "embedding" | xargs rg "title: \w+EmbeddingInput" -A 50 | rg "dimensions|title"

Length of output: 1151


Script:

#!/bin/bash
# Get the full context of dimensions property definition in all embedding input schemas
rg -A 4 "dimensions:" src/libs/Jina/openapi.yaml

Length of output: 852

additionalProperties: false
description: The input to the API for text embedding. OpenAI compatible
example:
Expand Down Expand Up @@ -668,7 +672,7 @@ components:
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\nFor more information, please checkout our [technical blog](https://arxiv.org/abs/2405.20204).\n"
description: "The identifier of the model.\n\nAvailable models and corresponding param size and dimension:\n- `jina-clip-v1`,\t223M,\t768\n- `jina-clip-v2`,\t865M,\t1024\n\nFor more information, please checkout our [technical blog](https://arxiv.org/abs/2405.20204).\n"
input:
title: Input
type: array
Expand Down Expand Up @@ -700,6 +704,10 @@ components:
title: Normalized
type: boolean
description: Flag to determine if the embeddings should be normalized to have a unit L2 norm
dimensions:
title: Dimensions
type: integer
description: 'Used to specify output embedding size. If set, output embeddings will be truncated to the size specified.'
additionalProperties: false
description: The input to the API for text embedding. OpenAI compatible
example:
Expand Down Expand Up @@ -927,7 +935,7 @@ components:
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"
description: "The identifier of the model.\n\nAvailable models and corresponding param size and dimension:\n- `jina-clip-v1`,\t223M,\t768\n- `jina-clip-v2`,\t865M,\t1024\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"
input:
title: Input
anyOf:
Expand Down Expand Up @@ -1017,7 +1025,7 @@ components:
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`"
description: "The identifier of the model.\n\nAvailable models and corresponding param size and dimension:\n- `jina-clip-v1`,\t223M,\t768\n- `jina-clip-v2`,\t865M,\t1024\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
Expand Down
Loading