Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static partial class AudioCreateSpeechAsEventStreamCommandApiCommand
Required = true,
};

private static Option<global::tryAGI.OpenAI.VoiceIdsOrCustomVoice> Voice { get; } = new(
private static Option<global::tryAGI.OpenAI.AnyOf<global::tryAGI.OpenAI.AnyOf<global::tryAGI.OpenAI.VoiceIdsShared?, global::tryAGI.OpenAI.CreateSpeechRequestVoice?>?, global::tryAGI.OpenAI.CreateSpeechRequestVoice2>> Voice { get; } = new(
name: @"--voice")
{
Description = @"The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ ""id"": ""voice_1234"" }`. Previews of the voices are available in the [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static partial class AudioCreateSpeechCommandApiCommand
Required = true,
};

private static Option<global::tryAGI.OpenAI.VoiceIdsOrCustomVoice> Voice { get; } = new(
private static Option<global::tryAGI.OpenAI.AnyOf<global::tryAGI.OpenAI.AnyOf<global::tryAGI.OpenAI.VoiceIdsShared?, global::tryAGI.OpenAI.CreateSpeechRequestVoice?>?, global::tryAGI.OpenAI.CreateSpeechRequestVoice2>> Voice { get; } = new(
name: @"--voice")
{
Description = @"The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ ""id"": ""voice_1234"" }`. Previews of the voices are available in the [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,6 @@ internal static partial class FilesDownloadFileCommandApiCommand
Description = @"The ID of the file to use for this request.",
};

private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings)
{
string? text = null;
CustomizeResponseText(parseResult, value, ref text);
if (!string.IsNullOrWhiteSpace(text))
{
return text;
}

var hints = new Dictionary<string, CliFormatHint>(StringComparer.OrdinalIgnoreCase)
{
};
CustomizeResponseFormatHints(hints);
return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints);
}

static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text);
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


public static Command Create()
{
var command = new Command(@"download-file", @"Retrieve file content
Expand All @@ -51,13 +31,7 @@ await CliRuntime.RunAsync(async () =>
fileId: fileId,
cancellationToken: cancellationToken).ConfigureAwait(false);


await CliRuntime.WriteResponseAsync(
parseResult,
response,
global::tryAGI.OpenAI.SourceGenerationContext.Default,
FormatResponse,
cancellationToken).ConfigureAwait(false);
await CliRuntime.WriteBinaryAsync(parseResult, response, cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
return command;
}
Expand Down
42 changes: 21 additions & 21 deletions src/libs/tryAGI.OpenAI/Generated/autosdk.generated-examples.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,43 @@ partial void ProcessCreateAgentResponseContent(
h => h.Key,
h => h.Value));
}
// The API key lacks the required permission.
if ((int)__response.StatusCode == 403)
{
string? __content_403 = null;
global::System.Exception? __exception_403 = null;
global::tryAGI.OpenAI.ErrorResponse2? __value_403 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_403 = global::tryAGI.OpenAI.ErrorResponse2.FromJson(__content_403, JsonSerializerContext);
}
else
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_403 = global::tryAGI.OpenAI.ErrorResponse2.FromJson(__content_403, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_403 = __ex;
}


throw global::tryAGI.OpenAI.ApiException<global::tryAGI.OpenAI.ErrorResponse2>.Create(
statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
responseBody: __content_403,
responseObject: __value_403,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}
// The requested session or event was not found.
if ((int)__response.StatusCode == 404)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,43 @@ partial void ProcessCreateAgentEnvironmentFileResponseContent(
h => h.Key,
h => h.Value));
}
// The API key lacks the required permission.
if ((int)__response.StatusCode == 403)
{
string? __content_403 = null;
global::System.Exception? __exception_403 = null;
global::tryAGI.OpenAI.ErrorResponse2? __value_403 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_403 = global::tryAGI.OpenAI.ErrorResponse2.FromJson(__content_403, JsonSerializerContext);
}
else
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_403 = global::tryAGI.OpenAI.ErrorResponse2.FromJson(__content_403, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_403 = __ex;
}


throw global::tryAGI.OpenAI.ApiException<global::tryAGI.OpenAI.ErrorResponse2>.Create(
statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
responseBody: __content_403,
responseObject: __value_403,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}
// The requested session or event was not found.
if ((int)__response.StatusCode == 404)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ partial void ProcessCreateAgentEnvironmentTemplateResponseContent(
/// Ordered, confidential setup commands. Command bodies are never returned.
/// </param>
/// <param name="network">
/// Network access policy for the environment. Defaults to disabled for GA requests and enabled for alpha/beta requests.
/// Network access policy for the environment. Defaults to disabled for GA requests and enabled for beta requests.
/// </param>
/// <param name="env">
/// Environment variables made available to the agent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,43 @@ partial void ProcessDeleteAgentResponseContent(
h => h.Key,
h => h.Value));
}
// The API key lacks the required permission.
if ((int)__response.StatusCode == 403)
{
string? __content_403 = null;
global::System.Exception? __exception_403 = null;
global::tryAGI.OpenAI.ErrorResponse2? __value_403 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_403 = global::tryAGI.OpenAI.ErrorResponse2.FromJson(__content_403, JsonSerializerContext);
}
else
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_403 = global::tryAGI.OpenAI.ErrorResponse2.FromJson(__content_403, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_403 = __ex;
}


throw global::tryAGI.OpenAI.ApiException<global::tryAGI.OpenAI.ErrorResponse2>.Create(
statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
responseBody: __content_403,
responseObject: __value_403,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}
// The requested session or event was not found.
if ((int)__response.StatusCode == 404)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,43 @@ partial void ProcessListAgentEnvironmentFilesResponseContent(
h => h.Key,
h => h.Value));
}
// The API key lacks the required permission.
if ((int)__response.StatusCode == 403)
{
string? __content_403 = null;
global::System.Exception? __exception_403 = null;
global::tryAGI.OpenAI.ErrorResponse2? __value_403 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_403 = global::tryAGI.OpenAI.ErrorResponse2.FromJson(__content_403, JsonSerializerContext);
}
else
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_403 = global::tryAGI.OpenAI.ErrorResponse2.FromJson(__content_403, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_403 = __ex;
}


throw global::tryAGI.OpenAI.ApiException<global::tryAGI.OpenAI.ErrorResponse2>.Create(
statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
responseBody: __content_403,
responseObject: __value_403,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}
// The requested session or event was not found.
if ((int)__response.StatusCode == 404)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,43 @@ partial void ProcessListAgentSessionTurnsResponseContent(
h => h.Key,
h => h.Value));
}
// The API key lacks the required permission.
if ((int)__response.StatusCode == 403)
{
string? __content_403 = null;
global::System.Exception? __exception_403 = null;
global::tryAGI.OpenAI.ErrorResponse2? __value_403 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_403 = global::tryAGI.OpenAI.ErrorResponse2.FromJson(__content_403, JsonSerializerContext);
}
else
{
__content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_403 = global::tryAGI.OpenAI.ErrorResponse2.FromJson(__content_403, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_403 = __ex;
}


throw global::tryAGI.OpenAI.ApiException<global::tryAGI.OpenAI.ErrorResponse2>.Create(
statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
responseBody: __content_403,
responseObject: __value_403,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}
// The requested session or event was not found.
if ((int)__response.StatusCode == 404)
{
Expand Down
Loading
Loading