diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.SkillsClient.GetSkillContent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.SkillsClient.GetSkillContent.g.cs index 55851dbc..2b1f3933 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.SkillsClient.GetSkillContent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.SkillsClient.GetSkillContent.g.cs @@ -19,7 +19,7 @@ partial void ProcessGetSkillContentResponse( partial void ProcessGetSkillContentResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); + ref byte[] content); /// /// Download a skill zip bundle by its ID. @@ -89,16 +89,12 @@ partial void ProcessGetSkillContentResponseContent( if (ReadResponseAsString) { - var __content = await __response.Content.ReadAsStringAsync( + var __content = await __response.Content.ReadAsByteArrayAsync( #if NET5_0_OR_GREATER cancellationToken #endif ).ConfigureAwait(false); - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); ProcessGetSkillContentResponseContent( httpClient: HttpClient, httpResponseMessage: __response, @@ -108,18 +104,15 @@ partial void ProcessGetSkillContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(byte[]), JsonSerializerContext) as byte[] ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return __content; } catch (global::System.Exception __ex) { throw new global::tryAGI.OpenAI.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __response.ReasonPhrase ?? string.Empty, innerException: __ex, statusCode: __response.StatusCode) { - ResponseBody = __content, ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, @@ -133,15 +126,13 @@ partial void ProcessGetSkillContentResponseContent( { __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( + var __content = await __response.Content.ReadAsByteArrayAsync( #if NET5_0_OR_GREATER cancellationToken #endif ).ConfigureAwait(false); - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(byte[]), JsonSerializerContext).ConfigureAwait(false) as byte[] ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); + return __content; } catch (global::System.Exception __ex) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.SkillsClient.GetSkillVersionContent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.SkillsClient.GetSkillVersionContent.g.cs index 1fe138a1..1fa33190 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.SkillsClient.GetSkillVersionContent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.SkillsClient.GetSkillVersionContent.g.cs @@ -21,7 +21,7 @@ partial void ProcessGetSkillVersionContentResponse( partial void ProcessGetSkillVersionContentResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); + ref byte[] content); /// /// Download a skill version zip bundle. @@ -97,16 +97,12 @@ partial void ProcessGetSkillVersionContentResponseContent( if (ReadResponseAsString) { - var __content = await __response.Content.ReadAsStringAsync( + var __content = await __response.Content.ReadAsByteArrayAsync( #if NET5_0_OR_GREATER cancellationToken #endif ).ConfigureAwait(false); - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); ProcessGetSkillVersionContentResponseContent( httpClient: HttpClient, httpResponseMessage: __response, @@ -116,18 +112,15 @@ partial void ProcessGetSkillVersionContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(byte[]), JsonSerializerContext) as byte[] ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return __content; } catch (global::System.Exception __ex) { throw new global::tryAGI.OpenAI.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __response.ReasonPhrase ?? string.Empty, innerException: __ex, statusCode: __response.StatusCode) { - ResponseBody = __content, ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, @@ -141,15 +134,13 @@ partial void ProcessGetSkillVersionContentResponseContent( { __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( + var __content = await __response.Content.ReadAsByteArrayAsync( #if NET5_0_OR_GREATER cancellationToken #endif ).ConfigureAwait(false); - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(byte[]), JsonSerializerContext).ConfigureAwait(false) as byte[] ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); + return __content; } catch (global::System.Exception __ex) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.VideosClient.RetrieveVideoContent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.VideosClient.RetrieveVideoContent.g.cs index 4dd95d67..e8d60c58 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.VideosClient.RetrieveVideoContent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.VideosClient.RetrieveVideoContent.g.cs @@ -21,7 +21,7 @@ partial void ProcessRetrieveVideoContentResponse( partial void ProcessRetrieveVideoContentResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); + ref byte[] content); /// /// Download the generated video bytes or a derived preview asset.
@@ -99,16 +99,12 @@ partial void ProcessRetrieveVideoContentResponseContent( if (ReadResponseAsString) { - var __content = await __response.Content.ReadAsStringAsync( + var __content = await __response.Content.ReadAsByteArrayAsync( #if NET5_0_OR_GREATER cancellationToken #endif ).ConfigureAwait(false); - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); ProcessRetrieveVideoContentResponseContent( httpClient: HttpClient, httpResponseMessage: __response, @@ -118,18 +114,15 @@ partial void ProcessRetrieveVideoContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(byte[]), JsonSerializerContext) as byte[] ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return __content; } catch (global::System.Exception __ex) { throw new global::tryAGI.OpenAI.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, + message: __response.ReasonPhrase ?? string.Empty, innerException: __ex, statusCode: __response.StatusCode) { - ResponseBody = __content, ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, @@ -143,15 +136,13 @@ partial void ProcessRetrieveVideoContentResponseContent( { __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( + var __content = await __response.Content.ReadAsByteArrayAsync( #if NET5_0_OR_GREATER cancellationToken #endif ).ConfigureAwait(false); - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(byte[]), JsonSerializerContext).ConfigureAwait(false) as byte[] ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); + return __content; } catch (global::System.Exception __ex) {