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
8 changes: 4 additions & 4 deletions src/libs/Together/Generated/Together.AllOf.2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Together
/// <summary>
///
/// </summary>
public readonly partial struct AllOf<T1, T2> : global::System.IEquatable<AllOf<T1, T2>>
public readonly partial struct AllOf<[global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T1, [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T2> : global::System.IEquatable<AllOf<T1, T2>>
{
/// <summary>
///
Expand Down Expand Up @@ -105,9 +105,9 @@ Value1 as object
Value2?.ToString()
;

private static bool RequiresValue<TValue>() => RequirementCache<TValue>.Value;
private static bool RequiresValue<[global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] TValue>() => RequirementCache<TValue>.Value;

private static bool DetermineRequiresValue(global::System.Type type)
private static bool DetermineRequiresValue([global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] global::System.Type type)
{
if (global::System.Nullable.GetUnderlyingType(type) != null)
{
Expand Down Expand Up @@ -138,7 +138,7 @@ private static bool DetermineRequiresValue(global::System.Type type)
return false;
}

private static class RequirementCache<TValue>
private static class RequirementCache<[global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] TValue>
{
public static readonly bool Value = DetermineRequiresValue(typeof(TValue));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ partial void ProcessAudioSpeechResponse(
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}
var __httpRequestContentBody = request.ToJson(JsonSerializerOptions);
var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
encoding: global::System.Text.Encoding.UTF8,
Expand Down Expand Up @@ -152,7 +152,7 @@ partial void ProcessAudioSpeechResponse(
yield break;
}

var __streamedResponse = global::Together.AudioSpeechStreamResponse.FromJson(__content, JsonSerializerOptions) ??
var __streamedResponse = global::Together.AudioSpeechStreamResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::Together.ApiException(
message: $"Response deserialization failed for \"{__content}\" ",
statusCode: __response.StatusCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ partial void ProcessAudioTranscriptionsResponseContent(
if (ReadResponseAsString)
{
__content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerOptions);
__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext);
}
else
{
__content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerOptions);
__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -218,13 +218,13 @@ partial void ProcessAudioTranscriptionsResponseContent(
if (ReadResponseAsString)
{
__content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerOptions);
__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext);
}
else
{
__content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerOptions);
__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -256,13 +256,13 @@ partial void ProcessAudioTranscriptionsResponseContent(
if (ReadResponseAsString)
{
__content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerOptions);
__value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerContext);
}
else
{
__content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerOptions);
__value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -306,7 +306,7 @@ partial void ProcessAudioTranscriptionsResponseContent(
__response.EnsureSuccessStatusCode();

return
global::Together.AudioTranscriptionResponse.FromJson(__content, JsonSerializerOptions) ??
global::Together.AudioTranscriptionResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -336,7 +336,7 @@ partial void ProcessAudioTranscriptionsResponseContent(
).ConfigureAwait(false);

return
await global::Together.AudioTranscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerOptions).ConfigureAwait(false) ??
await global::Together.AudioTranscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
catch (global::System.Exception __ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ partial void ProcessAudioTranslationsResponseContent(
if (ReadResponseAsString)
{
__content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerOptions);
__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext);
}
else
{
__content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerOptions);
__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -199,13 +199,13 @@ partial void ProcessAudioTranslationsResponseContent(
if (ReadResponseAsString)
{
__content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerOptions);
__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext);
}
else
{
__content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerOptions);
__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -237,13 +237,13 @@ partial void ProcessAudioTranslationsResponseContent(
if (ReadResponseAsString)
{
__content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerOptions);
__value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerContext);
}
else
{
__content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerOptions);
__value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -287,7 +287,7 @@ partial void ProcessAudioTranslationsResponseContent(
__response.EnsureSuccessStatusCode();

return
global::Together.AudioTranslationResponse.FromJson(__content, JsonSerializerOptions) ??
global::Together.AudioTranslationResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -317,7 +317,7 @@ partial void ProcessAudioTranslationsResponseContent(
).ConfigureAwait(false);

return
await global::Together.AudioTranslationResponse.FromJsonStreamAsync(__content, JsonSerializerOptions).ConfigureAwait(false) ??
await global::Together.AudioTranslationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
catch (global::System.Exception __ex)
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Together/Generated/Together.AudioClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public sealed partial class AudioClient : global::Together.IAudioClient, global:
/// <summary>
///
/// </summary>
public global::System.Text.Json.JsonSerializerOptions JsonSerializerOptions { get; set; } = new global::System.Text.Json.JsonSerializerOptions();
public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default;


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ partial void ProcessCreateBatchesResponseContent(
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}
var __httpRequestContentBody = request.ToJson(JsonSerializerOptions);
var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
encoding: global::System.Text.Encoding.UTF8,
Expand Down Expand Up @@ -115,13 +115,13 @@ partial void ProcessCreateBatchesResponseContent(
if (ReadResponseAsString)
{
__content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_400 = global::Together.BatchErrorResponse.FromJson(__content_400, JsonSerializerOptions);
__value_400 = global::Together.BatchErrorResponse.FromJson(__content_400, JsonSerializerContext);
}
else
{
__content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_400 = global::Together.BatchErrorResponse.FromJson(__content_400, JsonSerializerOptions);
__value_400 = global::Together.BatchErrorResponse.FromJson(__content_400, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -153,13 +153,13 @@ partial void ProcessCreateBatchesResponseContent(
if (ReadResponseAsString)
{
__content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_401 = global::Together.BatchErrorResponse.FromJson(__content_401, JsonSerializerOptions);
__value_401 = global::Together.BatchErrorResponse.FromJson(__content_401, JsonSerializerContext);
}
else
{
__content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_401 = global::Together.BatchErrorResponse.FromJson(__content_401, JsonSerializerOptions);
__value_401 = global::Together.BatchErrorResponse.FromJson(__content_401, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -191,13 +191,13 @@ partial void ProcessCreateBatchesResponseContent(
if (ReadResponseAsString)
{
__content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_429 = global::Together.BatchErrorResponse.FromJson(__content_429, JsonSerializerOptions);
__value_429 = global::Together.BatchErrorResponse.FromJson(__content_429, JsonSerializerContext);
}
else
{
__content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_429 = global::Together.BatchErrorResponse.FromJson(__content_429, JsonSerializerOptions);
__value_429 = global::Together.BatchErrorResponse.FromJson(__content_429, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -229,13 +229,13 @@ partial void ProcessCreateBatchesResponseContent(
if (ReadResponseAsString)
{
__content_500 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_500 = global::Together.BatchErrorResponse.FromJson(__content_500, JsonSerializerOptions);
__value_500 = global::Together.BatchErrorResponse.FromJson(__content_500, JsonSerializerContext);
}
else
{
__content_500 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_500 = global::Together.BatchErrorResponse.FromJson(__content_500, JsonSerializerOptions);
__value_500 = global::Together.BatchErrorResponse.FromJson(__content_500, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -279,7 +279,7 @@ partial void ProcessCreateBatchesResponseContent(
__response.EnsureSuccessStatusCode();

return
global::Together.BatchJobWithWarning.FromJson(__content, JsonSerializerOptions) ??
global::Together.BatchJobWithWarning.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Exception __ex)
Expand Down Expand Up @@ -309,7 +309,7 @@ partial void ProcessCreateBatchesResponseContent(
).ConfigureAwait(false);

return
await global::Together.BatchJobWithWarning.FromJsonStreamAsync(__content, JsonSerializerOptions).ConfigureAwait(false) ??
await global::Together.BatchJobWithWarning.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
catch (global::System.Exception __ex)
Expand Down
Loading