-
-
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 #82 from tryAGI/bot/update-openapi_202412161247
feat:Add response_language parameter and increase limit in API specifications
- Loading branch information
Showing
11 changed files
with
260 additions
and
28 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
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
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
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
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
87 changes: 87 additions & 0 deletions
87
src/libs/AI21/Generated/AI21.Models.ConversationalRagConfigResponseLanguage.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,87 @@ | ||
|
||
#nullable enable | ||
|
||
namespace AI21 | ||
{ | ||
/// <summary> | ||
/// Default Value: english | ||
/// </summary> | ||
public enum ConversationalRagConfigResponseLanguage | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
Dutch, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
English, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
French, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
German, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
Hebrew, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
Italian, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
Portuguese, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
Spanish, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class ConversationalRagConfigResponseLanguageExtensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this ConversationalRagConfigResponseLanguage value) | ||
{ | ||
return value switch | ||
{ | ||
ConversationalRagConfigResponseLanguage.Dutch => "dutch", | ||
ConversationalRagConfigResponseLanguage.English => "english", | ||
ConversationalRagConfigResponseLanguage.French => "french", | ||
ConversationalRagConfigResponseLanguage.German => "german", | ||
ConversationalRagConfigResponseLanguage.Hebrew => "hebrew", | ||
ConversationalRagConfigResponseLanguage.Italian => "italian", | ||
ConversationalRagConfigResponseLanguage.Portuguese => "portuguese", | ||
ConversationalRagConfigResponseLanguage.Spanish => "spanish", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static ConversationalRagConfigResponseLanguage? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"dutch" => ConversationalRagConfigResponseLanguage.Dutch, | ||
"english" => ConversationalRagConfigResponseLanguage.English, | ||
"french" => ConversationalRagConfigResponseLanguage.French, | ||
"german" => ConversationalRagConfigResponseLanguage.German, | ||
"hebrew" => ConversationalRagConfigResponseLanguage.Hebrew, | ||
"italian" => ConversationalRagConfigResponseLanguage.Italian, | ||
"portuguese" => ConversationalRagConfigResponseLanguage.Portuguese, | ||
"spanish" => ConversationalRagConfigResponseLanguage.Spanish, | ||
_ => null, | ||
}; | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/libs/AI21/Generated/JsonConverters.ConversationalRagConfigResponseLanguage.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 AI21.JsonConverters | ||
{ | ||
/// <inheritdoc /> | ||
public sealed class ConversationalRagConfigResponseLanguageJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::AI21.ConversationalRagConfigResponseLanguage> | ||
{ | ||
/// <inheritdoc /> | ||
public override global::AI21.ConversationalRagConfigResponseLanguage 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::AI21.ConversationalRagConfigResponseLanguageExtensions.ToEnum(stringValue) ?? default; | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::AI21.ConversationalRagConfigResponseLanguage)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void Write( | ||
global::System.Text.Json.Utf8JsonWriter writer, | ||
global::AI21.ConversationalRagConfigResponseLanguage value, | ||
global::System.Text.Json.JsonSerializerOptions options) | ||
{ | ||
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); | ||
|
||
writer.WriteStringValue(global::AI21.ConversationalRagConfigResponseLanguageExtensions.ToValueString(value)); | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/libs/AI21/Generated/JsonConverters.ConversationalRagConfigResponseLanguageNullable.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 AI21.JsonConverters | ||
{ | ||
/// <inheritdoc /> | ||
public sealed class ConversationalRagConfigResponseLanguageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::AI21.ConversationalRagConfigResponseLanguage?> | ||
{ | ||
/// <inheritdoc /> | ||
public override global::AI21.ConversationalRagConfigResponseLanguage? 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::AI21.ConversationalRagConfigResponseLanguageExtensions.ToEnum(stringValue); | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::AI21.ConversationalRagConfigResponseLanguage)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void Write( | ||
global::System.Text.Json.Utf8JsonWriter writer, | ||
global::AI21.ConversationalRagConfigResponseLanguage? 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::AI21.ConversationalRagConfigResponseLanguageExtensions.ToValueString(value.Value)); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.