Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ public string ToJson(
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the generated default JsonSerializerContext.
/// </summary>
public string ToJson()
{
return ToJson(global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -26,6 +34,11 @@ public string ToJson(
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return ToJson(global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
Expand All @@ -44,6 +57,17 @@ public string ToJson(
jsonSerializerContext) as global::Gonka.ChatCompletionChoice;
}

/// <summary>
/// Deserializes a JSON string using the generated default JsonSerializerContext.
/// </summary>
public static global::Gonka.ChatCompletionChoice? FromJson(
string json)
{
return FromJson(
json,
global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -55,6 +79,13 @@ public string ToJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJson(
json,
global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Deserialize<global::Gonka.ChatCompletionChoice>(
json,
jsonSerializerOptions);
Expand All @@ -73,6 +104,17 @@ public string ToJson(
jsonSerializerContext).ConfigureAwait(false)) as global::Gonka.ChatCompletionChoice;
}

/// <summary>
/// Deserializes a JSON stream using the generated default JsonSerializerContext.
/// </summary>
public static global::System.Threading.Tasks.ValueTask<global::Gonka.ChatCompletionChoice?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream)
{
return FromJsonStreamAsync(
jsonStream,
global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -84,6 +126,13 @@ public string ToJson(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJsonStreamAsync(
jsonStream,
global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Gonka.ChatCompletionChoice?>(
jsonStream,
jsonSerializerOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ public string ToJson(
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the generated default JsonSerializerContext.
/// </summary>
public string ToJson()
{
return ToJson(global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -26,6 +34,11 @@ public string ToJson(
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return ToJson(global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
Expand All @@ -44,6 +57,17 @@ public string ToJson(
jsonSerializerContext) as global::Gonka.ChatCompletionContentPart;
}

/// <summary>
/// Deserializes a JSON string using the generated default JsonSerializerContext.
/// </summary>
public static global::Gonka.ChatCompletionContentPart? FromJson(
string json)
{
return FromJson(
json,
global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -55,6 +79,13 @@ public string ToJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJson(
json,
global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Deserialize<global::Gonka.ChatCompletionContentPart>(
json,
jsonSerializerOptions);
Expand All @@ -73,6 +104,17 @@ public string ToJson(
jsonSerializerContext).ConfigureAwait(false)) as global::Gonka.ChatCompletionContentPart;
}

/// <summary>
/// Deserializes a JSON stream using the generated default JsonSerializerContext.
/// </summary>
public static global::System.Threading.Tasks.ValueTask<global::Gonka.ChatCompletionContentPart?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream)
{
return FromJsonStreamAsync(
jsonStream,
global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -84,6 +126,13 @@ public string ToJson(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJsonStreamAsync(
jsonStream,
global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Gonka.ChatCompletionContentPart?>(
jsonStream,
jsonSerializerOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ public string ToJson(
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the generated default JsonSerializerContext.
/// </summary>
public string ToJson()
{
return ToJson(global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -26,6 +34,11 @@ public string ToJson(
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return ToJson(global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
Expand All @@ -44,6 +57,17 @@ public string ToJson(
jsonSerializerContext) as global::Gonka.ChatCompletionDelta;
}

/// <summary>
/// Deserializes a JSON string using the generated default JsonSerializerContext.
/// </summary>
public static global::Gonka.ChatCompletionDelta? FromJson(
string json)
{
return FromJson(
json,
global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -55,6 +79,13 @@ public string ToJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJson(
json,
global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Deserialize<global::Gonka.ChatCompletionDelta>(
json,
jsonSerializerOptions);
Expand All @@ -73,6 +104,17 @@ public string ToJson(
jsonSerializerContext).ConfigureAwait(false)) as global::Gonka.ChatCompletionDelta;
}

/// <summary>
/// Deserializes a JSON stream using the generated default JsonSerializerContext.
/// </summary>
public static global::System.Threading.Tasks.ValueTask<global::Gonka.ChatCompletionDelta?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream)
{
return FromJsonStreamAsync(
jsonStream,
global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -84,6 +126,13 @@ public string ToJson(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJsonStreamAsync(
jsonStream,
global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Gonka.ChatCompletionDelta?>(
jsonStream,
jsonSerializerOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ public string ToJson(
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the generated default JsonSerializerContext.
/// </summary>
public string ToJson()
{
return ToJson(global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -26,6 +34,11 @@ public string ToJson(
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return ToJson(global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
Expand All @@ -44,6 +57,17 @@ public string ToJson(
jsonSerializerContext) as global::Gonka.ChatCompletionMessage;
}

/// <summary>
/// Deserializes a JSON string using the generated default JsonSerializerContext.
/// </summary>
public static global::Gonka.ChatCompletionMessage? FromJson(
string json)
{
return FromJson(
json,
global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -55,6 +79,13 @@ public string ToJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJson(
json,
global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.Deserialize<global::Gonka.ChatCompletionMessage>(
json,
jsonSerializerOptions);
Expand All @@ -73,6 +104,17 @@ public string ToJson(
jsonSerializerContext).ConfigureAwait(false)) as global::Gonka.ChatCompletionMessage;
}

/// <summary>
/// Deserializes a JSON stream using the generated default JsonSerializerContext.
/// </summary>
public static global::System.Threading.Tasks.ValueTask<global::Gonka.ChatCompletionMessage?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream)
{
return FromJsonStreamAsync(
jsonStream,
global::Gonka.SourceGenerationContext.Default);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
Expand All @@ -84,6 +126,13 @@ public string ToJson(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
if (jsonSerializerOptions is null)
{
return FromJsonStreamAsync(
jsonStream,
global::Gonka.SourceGenerationContext.Default);
}

return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Gonka.ChatCompletionMessage?>(
jsonStream,
jsonSerializerOptions);
Expand Down
Loading