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 @@ -78,7 +78,7 @@ partial void ProcessAudioSpeechResponse(
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}
var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
var __httpRequestContentBody = request.ToJson(JsonSerializerOptions);
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, JsonSerializerContext) ??
var __streamedResponse = global::Together.AudioSpeechStreamResponse.FromJson(__content, JsonSerializerOptions) ??
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, JsonSerializerContext);
__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerOptions);
}
else
{
__content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext);
__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerOptions);
}
}
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, JsonSerializerContext);
__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerOptions);
}
else
{
__content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext);
__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerOptions);
}
}
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, JsonSerializerContext);
__value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerOptions);
}
else
{
__content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

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

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

return
await global::Together.AudioTranscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
await global::Together.AudioTranscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerOptions).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, JsonSerializerContext);
__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerOptions);
}
else
{
__content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext);
__value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerOptions);
}
}
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, JsonSerializerContext);
__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerOptions);
}
else
{
__content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext);
__value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerOptions);
}
}
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, JsonSerializerContext);
__value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerOptions);
}
else
{
__content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

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

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

return
await global::Together.AudioTranslationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
await global::Together.AudioTranslationResponse.FromJsonStreamAsync(__content, JsonSerializerOptions).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.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default;
public global::System.Text.Json.JsonSerializerOptions JsonSerializerOptions { get; set; } = new global::System.Text.Json.JsonSerializerOptions();


/// <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(JsonSerializerContext);
var __httpRequestContentBody = request.ToJson(JsonSerializerOptions);
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, JsonSerializerContext);
__value_400 = global::Together.BatchErrorResponse.FromJson(__content_400, JsonSerializerOptions);
}
else
{
__content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_400 = global::Together.BatchErrorResponse.FromJson(__content_400, JsonSerializerContext);
__value_400 = global::Together.BatchErrorResponse.FromJson(__content_400, JsonSerializerOptions);
}
}
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, JsonSerializerContext);
__value_401 = global::Together.BatchErrorResponse.FromJson(__content_401, JsonSerializerOptions);
}
else
{
__content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_401 = global::Together.BatchErrorResponse.FromJson(__content_401, JsonSerializerContext);
__value_401 = global::Together.BatchErrorResponse.FromJson(__content_401, JsonSerializerOptions);
}
}
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, JsonSerializerContext);
__value_429 = global::Together.BatchErrorResponse.FromJson(__content_429, JsonSerializerOptions);
}
else
{
__content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

__value_429 = global::Together.BatchErrorResponse.FromJson(__content_429, JsonSerializerContext);
__value_429 = global::Together.BatchErrorResponse.FromJson(__content_429, JsonSerializerOptions);
}
}
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, JsonSerializerContext);
__value_500 = global::Together.BatchErrorResponse.FromJson(__content_500, JsonSerializerOptions);
}
else
{
__content_500 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

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

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

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