-
-
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
Jan 17, 2025
1 parent
e2a3694
commit d961db1
Showing
11 changed files
with
1,037 additions
and
673 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
51 changes: 51 additions & 0 deletions
51
src/libs/Cohere/Generated/Cohere.Models.ChatCitationType.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,51 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// The type of citation which indicates what part of the response the citation is for. | ||
/// </summary> | ||
public enum ChatCitationType | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
TEXTCONTENT, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
PLAN, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class ChatCitationTypeExtensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this ChatCitationType value) | ||
{ | ||
return value switch | ||
{ | ||
ChatCitationType.TEXTCONTENT => "TEXT_CONTENT", | ||
ChatCitationType.PLAN => "PLAN", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static ChatCitationType? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"TEXT_CONTENT" => ChatCitationType.TEXTCONTENT, | ||
"PLAN" => ChatCitationType.PLAN, | ||
_ => 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
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,51 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Cohere | ||
{ | ||
/// <summary> | ||
/// The type of citation which indicates what part of the response the citation is for. | ||
/// </summary> | ||
public enum CitationType | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
TEXTCONTENT, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
PLAN, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class CitationTypeExtensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this CitationType value) | ||
{ | ||
return value switch | ||
{ | ||
CitationType.TEXTCONTENT => "TEXT_CONTENT", | ||
CitationType.PLAN => "PLAN", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static CitationType? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"TEXT_CONTENT" => CitationType.TEXTCONTENT, | ||
"PLAN" => CitationType.PLAN, | ||
_ => null, | ||
}; | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/libs/Cohere/Generated/JsonConverters.ChatCitationType.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 Cohere.JsonConverters | ||
{ | ||
/// <inheritdoc /> | ||
public sealed class ChatCitationTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Cohere.ChatCitationType> | ||
{ | ||
/// <inheritdoc /> | ||
public override global::Cohere.ChatCitationType 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.ChatCitationTypeExtensions.ToEnum(stringValue) ?? default; | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::Cohere.ChatCitationType)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void Write( | ||
global::System.Text.Json.Utf8JsonWriter writer, | ||
global::Cohere.ChatCitationType value, | ||
global::System.Text.Json.JsonSerializerOptions options) | ||
{ | ||
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); | ||
|
||
writer.WriteStringValue(global::Cohere.ChatCitationTypeExtensions.ToValueString(value)); | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/libs/Cohere/Generated/JsonConverters.ChatCitationTypeNullable.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 Cohere.JsonConverters | ||
{ | ||
/// <inheritdoc /> | ||
public sealed class ChatCitationTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Cohere.ChatCitationType?> | ||
{ | ||
/// <inheritdoc /> | ||
public override global::Cohere.ChatCitationType? 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.ChatCitationTypeExtensions.ToEnum(stringValue); | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::Cohere.ChatCitationType)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void Write( | ||
global::System.Text.Json.Utf8JsonWriter writer, | ||
global::Cohere.ChatCitationType? 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::Cohere.ChatCitationTypeExtensions.ToValueString(value.Value)); | ||
} | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/libs/Cohere/Generated/JsonConverters.CitationType.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 Cohere.JsonConverters | ||
{ | ||
/// <inheritdoc /> | ||
public sealed class CitationTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Cohere.CitationType> | ||
{ | ||
/// <inheritdoc /> | ||
public override global::Cohere.CitationType 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.CitationTypeExtensions.ToEnum(stringValue) ?? default; | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::Cohere.CitationType)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void Write( | ||
global::System.Text.Json.Utf8JsonWriter writer, | ||
global::Cohere.CitationType value, | ||
global::System.Text.Json.JsonSerializerOptions options) | ||
{ | ||
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); | ||
|
||
writer.WriteStringValue(global::Cohere.CitationTypeExtensions.ToValueString(value)); | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/libs/Cohere/Generated/JsonConverters.CitationTypeNullable.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 Cohere.JsonConverters | ||
{ | ||
/// <inheritdoc /> | ||
public sealed class CitationTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Cohere.CitationType?> | ||
{ | ||
/// <inheritdoc /> | ||
public override global::Cohere.CitationType? 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.CitationTypeExtensions.ToEnum(stringValue); | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::Cohere.CitationType)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void Write( | ||
global::System.Text.Json.Utf8JsonWriter writer, | ||
global::Cohere.CitationType? 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::Cohere.CitationTypeExtensions.ToValueString(value.Value)); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.