generated from tryAGI/SdkTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from tryAGI/bot/update-openapi_202411201241
feat:@coderabbitai
- Loading branch information
Showing
11 changed files
with
480 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/libs/Jina/Generated/Jina.Models.ImageEmbeddingInputTask.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Jina | ||
{ | ||
/// <summary> | ||
/// Used to convey intended downstream application to help the model produce better embeddings. Must be one of the following values:<br/> | ||
/// - "retrieval.query": Specifies the given text is a query in a search or retrieval setting.<br/> | ||
/// - "retrieval.passage": Specifies the given text is a document in a search or retrieval setting.<br/> | ||
/// - "text-matching": Specifies the given text is used for Semantic Textual Similarity.<br/> | ||
/// - "classification": Specifies that the embedding is used for classification.<br/> | ||
/// - "separation": Specifies that the embedding is used for clustering. | ||
/// </summary> | ||
public enum ImageEmbeddingInputTask | ||
{ | ||
/// <summary> | ||
/// Specifies the given text is a query in a search or retrieval setting. | ||
/// </summary> | ||
RetrievalQuery, | ||
/// <summary> | ||
/// Specifies the given text is a document in a search or retrieval setting. | ||
/// </summary> | ||
RetrievalPassage, | ||
/// <summary> | ||
/// Specifies the given text is used for Semantic Textual Similarity. | ||
/// </summary> | ||
TextMatching, | ||
/// <summary> | ||
/// Specifies that the embedding is used for classification. | ||
/// </summary> | ||
Classification, | ||
/// <summary> | ||
/// Specifies that the embedding is used for clustering. | ||
/// </summary> | ||
Separation, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class ImageEmbeddingInputTaskExtensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this ImageEmbeddingInputTask value) | ||
{ | ||
return value switch | ||
{ | ||
ImageEmbeddingInputTask.RetrievalQuery => "retrieval.query", | ||
ImageEmbeddingInputTask.RetrievalPassage => "retrieval.passage", | ||
ImageEmbeddingInputTask.TextMatching => "text-matching", | ||
ImageEmbeddingInputTask.Classification => "classification", | ||
ImageEmbeddingInputTask.Separation => "separation", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static ImageEmbeddingInputTask? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"retrieval.query" => ImageEmbeddingInputTask.RetrievalQuery, | ||
"retrieval.passage" => ImageEmbeddingInputTask.RetrievalPassage, | ||
"text-matching" => ImageEmbeddingInputTask.TextMatching, | ||
"classification" => ImageEmbeddingInputTask.Classification, | ||
"separation" => ImageEmbeddingInputTask.Separation, | ||
_ => null, | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/libs/Jina/Generated/Jina.Models.MixedEmbeddingInputTask.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Jina | ||
{ | ||
/// <summary> | ||
/// Used to convey intended downstream application to help the model produce better embeddings. Must be one of the following values:<br/> | ||
/// - "retrieval.query": Specifies the given text is a query in a search or retrieval setting.<br/> | ||
/// - "retrieval.passage": Specifies the given text is a document in a search or retrieval setting.<br/> | ||
/// - "text-matching": Specifies the given text is used for Semantic Textual Similarity.<br/> | ||
/// - "classification": Specifies that the embedding is used for classification.<br/> | ||
/// - "separation": Specifies that the embedding is used for clustering. | ||
/// </summary> | ||
public enum MixedEmbeddingInputTask | ||
{ | ||
/// <summary> | ||
/// Specifies the given text is a query in a search or retrieval setting. | ||
/// </summary> | ||
RetrievalQuery, | ||
/// <summary> | ||
/// Specifies the given text is a document in a search or retrieval setting. | ||
/// </summary> | ||
RetrievalPassage, | ||
/// <summary> | ||
/// Specifies the given text is used for Semantic Textual Similarity. | ||
/// </summary> | ||
TextMatching, | ||
/// <summary> | ||
/// Specifies that the embedding is used for classification. | ||
/// </summary> | ||
Classification, | ||
/// <summary> | ||
/// Specifies that the embedding is used for clustering. | ||
/// </summary> | ||
Separation, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class MixedEmbeddingInputTaskExtensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this MixedEmbeddingInputTask value) | ||
{ | ||
return value switch | ||
{ | ||
MixedEmbeddingInputTask.RetrievalQuery => "retrieval.query", | ||
MixedEmbeddingInputTask.RetrievalPassage => "retrieval.passage", | ||
MixedEmbeddingInputTask.TextMatching => "text-matching", | ||
MixedEmbeddingInputTask.Classification => "classification", | ||
MixedEmbeddingInputTask.Separation => "separation", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static MixedEmbeddingInputTask? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"retrieval.query" => MixedEmbeddingInputTask.RetrievalQuery, | ||
"retrieval.passage" => MixedEmbeddingInputTask.RetrievalPassage, | ||
"text-matching" => MixedEmbeddingInputTask.TextMatching, | ||
"classification" => MixedEmbeddingInputTask.Classification, | ||
"separation" => MixedEmbeddingInputTask.Separation, | ||
_ => null, | ||
}; | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/libs/Jina/Generated/JsonConverters.ImageEmbeddingInputTask.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#nullable enable | ||
|
||
namespace Jina.JsonConverters | ||
{ | ||
/// <inheritdoc /> | ||
public sealed class ImageEmbeddingInputTaskJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Jina.ImageEmbeddingInputTask> | ||
{ | ||
/// <inheritdoc /> | ||
public override global::Jina.ImageEmbeddingInputTask 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.ImageEmbeddingInputTaskExtensions.ToEnum(stringValue) ?? default; | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::Jina.ImageEmbeddingInputTask)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void Write( | ||
global::System.Text.Json.Utf8JsonWriter writer, | ||
global::Jina.ImageEmbeddingInputTask value, | ||
global::System.Text.Json.JsonSerializerOptions options) | ||
{ | ||
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); | ||
|
||
writer.WriteStringValue(global::Jina.ImageEmbeddingInputTaskExtensions.ToValueString(value)); | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/libs/Jina/Generated/JsonConverters.ImageEmbeddingInputTaskNullable.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#nullable enable | ||
|
||
namespace Jina.JsonConverters | ||
{ | ||
/// <inheritdoc /> | ||
public sealed class ImageEmbeddingInputTaskNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Jina.ImageEmbeddingInputTask?> | ||
{ | ||
/// <inheritdoc /> | ||
public override global::Jina.ImageEmbeddingInputTask? 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.ImageEmbeddingInputTaskExtensions.ToEnum(stringValue); | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::Jina.ImageEmbeddingInputTask)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void Write( | ||
global::System.Text.Json.Utf8JsonWriter writer, | ||
global::Jina.ImageEmbeddingInputTask? 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.ImageEmbeddingInputTaskExtensions.ToValueString(value.Value)); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.