-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
17 changed files
with
1,404 additions
and
648 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
56 changes: 56 additions & 0 deletions
56
...napshots/cohere/NewtonsoftJson/_#G.Models.ChatStreamEventDiscriminator.Json.g.verified.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 @@ | ||
//HintName: G.Models.ChatStreamEventDiscriminator.Json.g.cs | ||
#nullable enable | ||
|
||
namespace G | ||
{ | ||
public sealed partial class ChatStreamEventDiscriminator | ||
{ | ||
/// <summary> | ||
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. | ||
/// </summary> | ||
#if NET8_0_OR_GREATER | ||
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] | ||
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] | ||
#endif | ||
public string ToJson( | ||
global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null) | ||
{ | ||
return global::Newtonsoft.Json.JsonConvert.SerializeObject( | ||
this, | ||
jsonSerializerOptions); | ||
} | ||
|
||
/// <summary> | ||
/// Deserializes a JSON string using the provided JsonSerializerOptions. | ||
/// </summary> | ||
#if NET8_0_OR_GREATER | ||
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] | ||
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] | ||
#endif | ||
public static global::G.ChatStreamEventDiscriminator? FromJson( | ||
string json, | ||
global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null) | ||
{ | ||
return global::Newtonsoft.Json.JsonConvert.DeserializeObject<global::G.ChatStreamEventDiscriminator>( | ||
json, | ||
jsonSerializerOptions); | ||
} | ||
|
||
/// <summary> | ||
/// Deserializes a JSON stream using the provided JsonSerializerOptions. | ||
/// </summary> | ||
#if NET8_0_OR_GREATER | ||
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] | ||
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] | ||
#endif | ||
public static global::System.Threading.Tasks.ValueTask<global::G.ChatStreamEventDiscriminator?> FromJsonStreamAsync( | ||
global::System.IO.Stream jsonStream, | ||
global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null) | ||
{ | ||
using var streamReader = new global::System.IO.StreamReader(jsonStream); | ||
using var jsonReader = new global::Newtonsoft.Json.JsonTextReader(streamReader); | ||
var serializer = global::Newtonsoft.Json.JsonSerializer.Create(jsonSerializerOptions); | ||
return new global::System.Threading.Tasks.ValueTask<global::G.ChatStreamEventDiscriminator?>(serializer.Deserialize<global::G.ChatStreamEventDiscriminator>(jsonReader)); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...sts/Snapshots/cohere/NewtonsoftJson/_#G.Models.ChatStreamEventDiscriminator.g.verified.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,41 @@ | ||
//HintName: G.Models.ChatStreamEventDiscriminator.g.cs | ||
|
||
#nullable enable | ||
|
||
namespace G | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class ChatStreamEventDiscriminator | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::Newtonsoft.Json.JsonProperty("event_type")] | ||
public global::G.ChatStreamEventDiscriminatorEventType? EventType { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::Newtonsoft.Json.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ChatStreamEventDiscriminator" /> class. | ||
/// </summary> | ||
/// <param name="eventType"></param> | ||
public ChatStreamEventDiscriminator( | ||
global::G.ChatStreamEventDiscriminatorEventType? eventType) | ||
{ | ||
this.EventType = eventType; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ChatStreamEventDiscriminator" /> class. | ||
/// </summary> | ||
public ChatStreamEventDiscriminator() | ||
{ | ||
} | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
...hots/cohere/NewtonsoftJson/_#G.Models.ChatStreamEventDiscriminatorEventType.g.verified.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,83 @@ | ||
//HintName: G.Models.ChatStreamEventDiscriminatorEventType.g.cs | ||
|
||
#nullable enable | ||
|
||
namespace G | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Runtime.Serialization.DataContract] | ||
public enum ChatStreamEventDiscriminatorEventType | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Runtime.Serialization.EnumMember(Value="stream-start")] | ||
StreamStart, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Runtime.Serialization.EnumMember(Value="search-queries-generation")] | ||
SearchQueriesGeneration, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Runtime.Serialization.EnumMember(Value="search-results")] | ||
SearchResults, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Runtime.Serialization.EnumMember(Value="text-generation")] | ||
TextGeneration, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Runtime.Serialization.EnumMember(Value="citation-generation")] | ||
CitationGeneration, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Runtime.Serialization.EnumMember(Value="stream-end")] | ||
StreamEnd, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class ChatStreamEventDiscriminatorEventTypeExtensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this ChatStreamEventDiscriminatorEventType value) | ||
{ | ||
return value switch | ||
{ | ||
ChatStreamEventDiscriminatorEventType.StreamStart => "stream-start", | ||
ChatStreamEventDiscriminatorEventType.SearchQueriesGeneration => "search-queries-generation", | ||
ChatStreamEventDiscriminatorEventType.SearchResults => "search-results", | ||
ChatStreamEventDiscriminatorEventType.TextGeneration => "text-generation", | ||
ChatStreamEventDiscriminatorEventType.CitationGeneration => "citation-generation", | ||
ChatStreamEventDiscriminatorEventType.StreamEnd => "stream-end", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static ChatStreamEventDiscriminatorEventType? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"stream-start" => ChatStreamEventDiscriminatorEventType.StreamStart, | ||
"search-queries-generation" => ChatStreamEventDiscriminatorEventType.SearchQueriesGeneration, | ||
"search-results" => ChatStreamEventDiscriminatorEventType.SearchResults, | ||
"text-generation" => ChatStreamEventDiscriminatorEventType.TextGeneration, | ||
"citation-generation" => ChatStreamEventDiscriminatorEventType.CitationGeneration, | ||
"stream-end" => ChatStreamEventDiscriminatorEventType.StreamEnd, | ||
_ => 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
93 changes: 93 additions & 0 deletions
93
...napshots/cohere/SystemTextJson/_#G.Models.ChatStreamEventDiscriminator.Json.g.verified.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,93 @@ | ||
//HintName: G.Models.ChatStreamEventDiscriminator.Json.g.cs | ||
#nullable enable | ||
|
||
namespace G | ||
{ | ||
public sealed partial class ChatStreamEventDiscriminator | ||
{ | ||
/// <summary> | ||
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext. | ||
/// </summary> | ||
public string ToJson( | ||
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) | ||
{ | ||
return global::System.Text.Json.JsonSerializer.Serialize( | ||
this, | ||
this.GetType(), | ||
jsonSerializerContext); | ||
} | ||
|
||
/// <summary> | ||
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. | ||
/// </summary> | ||
#if NET8_0_OR_GREATER | ||
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] | ||
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] | ||
#endif | ||
public string ToJson( | ||
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) | ||
{ | ||
return global::System.Text.Json.JsonSerializer.Serialize( | ||
this, | ||
jsonSerializerOptions); | ||
} | ||
|
||
/// <summary> | ||
/// Deserializes a JSON string using the provided JsonSerializerContext. | ||
/// </summary> | ||
public static global::G.ChatStreamEventDiscriminator? FromJson( | ||
string json, | ||
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) | ||
{ | ||
return global::System.Text.Json.JsonSerializer.Deserialize( | ||
json, | ||
typeof(global::G.ChatStreamEventDiscriminator), | ||
jsonSerializerContext) as global::G.ChatStreamEventDiscriminator; | ||
} | ||
|
||
/// <summary> | ||
/// Deserializes a JSON string using the provided JsonSerializerOptions. | ||
/// </summary> | ||
#if NET8_0_OR_GREATER | ||
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] | ||
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] | ||
#endif | ||
public static global::G.ChatStreamEventDiscriminator? FromJson( | ||
string json, | ||
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) | ||
{ | ||
return global::System.Text.Json.JsonSerializer.Deserialize<global::G.ChatStreamEventDiscriminator>( | ||
json, | ||
jsonSerializerOptions); | ||
} | ||
|
||
/// <summary> | ||
/// Deserializes a JSON stream using the provided JsonSerializerContext. | ||
/// </summary> | ||
public static async global::System.Threading.Tasks.ValueTask<global::G.ChatStreamEventDiscriminator?> FromJsonStreamAsync( | ||
global::System.IO.Stream jsonStream, | ||
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) | ||
{ | ||
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( | ||
jsonStream, | ||
typeof(global::G.ChatStreamEventDiscriminator), | ||
jsonSerializerContext).ConfigureAwait(false)) as global::G.ChatStreamEventDiscriminator; | ||
} | ||
|
||
/// <summary> | ||
/// Deserializes a JSON stream using the provided JsonSerializerOptions. | ||
/// </summary> | ||
#if NET8_0_OR_GREATER | ||
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] | ||
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] | ||
#endif | ||
public static global::System.Threading.Tasks.ValueTask<global::G.ChatStreamEventDiscriminator?> FromJsonStreamAsync( | ||
global::System.IO.Stream jsonStream, | ||
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) | ||
{ | ||
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::G.ChatStreamEventDiscriminator?>( | ||
jsonStream, | ||
jsonSerializerOptions); | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...sts/Snapshots/cohere/SystemTextJson/_#G.Models.ChatStreamEventDiscriminator.g.verified.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,43 @@ | ||
//HintName: G.Models.ChatStreamEventDiscriminator.g.cs | ||
|
||
#nullable enable | ||
|
||
namespace G | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class ChatStreamEventDiscriminator | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("event_type")] | ||
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ChatStreamEventDiscriminatorEventTypeJsonConverter))] | ||
public global::G.ChatStreamEventDiscriminatorEventType? EventType { 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>(); | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ChatStreamEventDiscriminator" /> class. | ||
/// </summary> | ||
/// <param name="eventType"></param> | ||
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] | ||
public ChatStreamEventDiscriminator( | ||
global::G.ChatStreamEventDiscriminatorEventType? eventType) | ||
{ | ||
this.EventType = eventType; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ChatStreamEventDiscriminator" /> class. | ||
/// </summary> | ||
public ChatStreamEventDiscriminator() | ||
{ | ||
} | ||
} | ||
} |
Oops, something went wrong.