Skip to content

Commit bb06012

Browse files
HavenDVgithub-actions[bot]
andauthored
feat: Updated OpenAPI spec (#258)
Co-authored-by: github-actions[bot] <bot@openai.com>
1 parent fcee327 commit bb06012

3 files changed

Lines changed: 18 additions & 45 deletions

File tree

src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.SkillsClient.GetSkillContent.g.cs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ partial void ProcessGetSkillContentResponse(
1919
partial void ProcessGetSkillContentResponseContent(
2020
global::System.Net.Http.HttpClient httpClient,
2121
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
22-
ref string content);
22+
ref byte[] content);
2323

2424
/// <summary>
2525
/// Download a skill zip bundle by its ID.
@@ -89,16 +89,12 @@ partial void ProcessGetSkillContentResponseContent(
8989

9090
if (ReadResponseAsString)
9191
{
92-
var __content = await __response.Content.ReadAsStringAsync(
92+
var __content = await __response.Content.ReadAsByteArrayAsync(
9393
#if NET5_0_OR_GREATER
9494
cancellationToken
9595
#endif
9696
).ConfigureAwait(false);
9797

98-
ProcessResponseContent(
99-
client: HttpClient,
100-
response: __response,
101-
content: ref __content);
10298
ProcessGetSkillContentResponseContent(
10399
httpClient: HttpClient,
104100
httpResponseMessage: __response,
@@ -108,18 +104,15 @@ partial void ProcessGetSkillContentResponseContent(
108104
{
109105
__response.EnsureSuccessStatusCode();
110106

111-
return
112-
global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(byte[]), JsonSerializerContext) as byte[] ??
113-
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
107+
return __content;
114108
}
115109
catch (global::System.Exception __ex)
116110
{
117111
throw new global::tryAGI.OpenAI.ApiException(
118-
message: __content ?? __response.ReasonPhrase ?? string.Empty,
112+
message: __response.ReasonPhrase ?? string.Empty,
119113
innerException: __ex,
120114
statusCode: __response.StatusCode)
121115
{
122-
ResponseBody = __content,
123116
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
124117
__response.Headers,
125118
h => h.Key,
@@ -133,15 +126,13 @@ partial void ProcessGetSkillContentResponseContent(
133126
{
134127
__response.EnsureSuccessStatusCode();
135128

136-
using var __content = await __response.Content.ReadAsStreamAsync(
129+
var __content = await __response.Content.ReadAsByteArrayAsync(
137130
#if NET5_0_OR_GREATER
138131
cancellationToken
139132
#endif
140133
).ConfigureAwait(false);
141134

142-
return
143-
await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(byte[]), JsonSerializerContext).ConfigureAwait(false) as byte[] ??
144-
throw new global::System.InvalidOperationException("Response deserialization failed.");
135+
return __content;
145136
}
146137
catch (global::System.Exception __ex)
147138
{

src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.SkillsClient.GetSkillVersionContent.g.cs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ partial void ProcessGetSkillVersionContentResponse(
2121
partial void ProcessGetSkillVersionContentResponseContent(
2222
global::System.Net.Http.HttpClient httpClient,
2323
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
24-
ref string content);
24+
ref byte[] content);
2525

2626
/// <summary>
2727
/// Download a skill version zip bundle.
@@ -97,16 +97,12 @@ partial void ProcessGetSkillVersionContentResponseContent(
9797

9898
if (ReadResponseAsString)
9999
{
100-
var __content = await __response.Content.ReadAsStringAsync(
100+
var __content = await __response.Content.ReadAsByteArrayAsync(
101101
#if NET5_0_OR_GREATER
102102
cancellationToken
103103
#endif
104104
).ConfigureAwait(false);
105105

106-
ProcessResponseContent(
107-
client: HttpClient,
108-
response: __response,
109-
content: ref __content);
110106
ProcessGetSkillVersionContentResponseContent(
111107
httpClient: HttpClient,
112108
httpResponseMessage: __response,
@@ -116,18 +112,15 @@ partial void ProcessGetSkillVersionContentResponseContent(
116112
{
117113
__response.EnsureSuccessStatusCode();
118114

119-
return
120-
global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(byte[]), JsonSerializerContext) as byte[] ??
121-
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
115+
return __content;
122116
}
123117
catch (global::System.Exception __ex)
124118
{
125119
throw new global::tryAGI.OpenAI.ApiException(
126-
message: __content ?? __response.ReasonPhrase ?? string.Empty,
120+
message: __response.ReasonPhrase ?? string.Empty,
127121
innerException: __ex,
128122
statusCode: __response.StatusCode)
129123
{
130-
ResponseBody = __content,
131124
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
132125
__response.Headers,
133126
h => h.Key,
@@ -141,15 +134,13 @@ partial void ProcessGetSkillVersionContentResponseContent(
141134
{
142135
__response.EnsureSuccessStatusCode();
143136

144-
using var __content = await __response.Content.ReadAsStreamAsync(
137+
var __content = await __response.Content.ReadAsByteArrayAsync(
145138
#if NET5_0_OR_GREATER
146139
cancellationToken
147140
#endif
148141
).ConfigureAwait(false);
149142

150-
return
151-
await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(byte[]), JsonSerializerContext).ConfigureAwait(false) as byte[] ??
152-
throw new global::System.InvalidOperationException("Response deserialization failed.");
143+
return __content;
153144
}
154145
catch (global::System.Exception __ex)
155146
{

src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.VideosClient.RetrieveVideoContent.g.cs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ partial void ProcessRetrieveVideoContentResponse(
2121
partial void ProcessRetrieveVideoContentResponseContent(
2222
global::System.Net.Http.HttpClient httpClient,
2323
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
24-
ref string content);
24+
ref byte[] content);
2525

2626
/// <summary>
2727
/// Download the generated video bytes or a derived preview asset.<br/>
@@ -99,16 +99,12 @@ partial void ProcessRetrieveVideoContentResponseContent(
9999

100100
if (ReadResponseAsString)
101101
{
102-
var __content = await __response.Content.ReadAsStringAsync(
102+
var __content = await __response.Content.ReadAsByteArrayAsync(
103103
#if NET5_0_OR_GREATER
104104
cancellationToken
105105
#endif
106106
).ConfigureAwait(false);
107107

108-
ProcessResponseContent(
109-
client: HttpClient,
110-
response: __response,
111-
content: ref __content);
112108
ProcessRetrieveVideoContentResponseContent(
113109
httpClient: HttpClient,
114110
httpResponseMessage: __response,
@@ -118,18 +114,15 @@ partial void ProcessRetrieveVideoContentResponseContent(
118114
{
119115
__response.EnsureSuccessStatusCode();
120116

121-
return
122-
global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(byte[]), JsonSerializerContext) as byte[] ??
123-
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
117+
return __content;
124118
}
125119
catch (global::System.Exception __ex)
126120
{
127121
throw new global::tryAGI.OpenAI.ApiException(
128-
message: __content ?? __response.ReasonPhrase ?? string.Empty,
122+
message: __response.ReasonPhrase ?? string.Empty,
129123
innerException: __ex,
130124
statusCode: __response.StatusCode)
131125
{
132-
ResponseBody = __content,
133126
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
134127
__response.Headers,
135128
h => h.Key,
@@ -143,15 +136,13 @@ partial void ProcessRetrieveVideoContentResponseContent(
143136
{
144137
__response.EnsureSuccessStatusCode();
145138

146-
using var __content = await __response.Content.ReadAsStreamAsync(
139+
var __content = await __response.Content.ReadAsByteArrayAsync(
147140
#if NET5_0_OR_GREATER
148141
cancellationToken
149142
#endif
150143
).ConfigureAwait(false);
151144

152-
return
153-
await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(byte[]), JsonSerializerContext).ConfigureAwait(false) as byte[] ??
154-
throw new global::System.InvalidOperationException("Response deserialization failed.");
145+
return __content;
155146
}
156147
catch (global::System.Exception __ex)
157148
{

0 commit comments

Comments
 (0)