-
-
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.
- Loading branch information
github-actions[bot]
committed
Sep 13, 2024
1 parent
9511271
commit 5ea0edf
Showing
15 changed files
with
815 additions
and
587 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
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
52 changes: 52 additions & 0 deletions
52
src/libs/Cohere/Generated/Cohere.Models.ResponseFormatType2.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,52 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// Defaults to `"text"`.<br/> | ||
/// When set to `"json_object"`, the model's output will be a valid JSON Object. | ||
/// </summary> | ||
public enum ResponseFormatType2 | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
Text, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
JsonObject, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class ResponseFormatType2Extensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this ResponseFormatType2 value) | ||
{ | ||
return value switch | ||
{ | ||
ResponseFormatType2.Text => "text", | ||
ResponseFormatType2.JsonObject => "json_object", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static ResponseFormatType2? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"text" => ResponseFormatType2.Text, | ||
"json_object" => ResponseFormatType2.JsonObject, | ||
_ => null, | ||
}; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/libs/Cohere/Generated/Cohere.Models.TextResponseFormat2.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,26 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class TextResponseFormat2 | ||
{ | ||
/// <summary> | ||
/// Defaults to `"text"`.<br/> | ||
/// When set to `"json_object"`, the model's output will be a valid JSON Object. | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("type")] | ||
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.ResponseFormatType2JsonConverter))] | ||
[global::System.Text.Json.Serialization.JsonRequired] | ||
public required global::Cohere.ResponseFormatType2 Type { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
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
49 changes: 49 additions & 0 deletions
49
src/libs/Cohere/Generated/JsonConverters.ResponseFormatType2.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 OpenApiGenerator.JsonConverters | ||
{ | ||
/// <inheritdoc /> | ||
public sealed class ResponseFormatType2JsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Cohere.ResponseFormatType2> | ||
{ | ||
/// <inheritdoc /> | ||
public override global::Cohere.ResponseFormatType2 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::Cohere.ResponseFormatType2Extensions.ToEnum(stringValue) ?? default; | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::Cohere.ResponseFormatType2)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void Write( | ||
global::System.Text.Json.Utf8JsonWriter writer, | ||
global::Cohere.ResponseFormatType2 value, | ||
global::System.Text.Json.JsonSerializerOptions options) | ||
{ | ||
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); | ||
|
||
writer.WriteStringValue(global::Cohere.ResponseFormatType2Extensions.ToValueString(value)); | ||
} | ||
} | ||
} |
Oops, something went wrong.