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 @@ -27,8 +27,6 @@ internal static partial class AgentsCreateAgentSessionAsStreamCommandApiCommand
};
private static readonly CreateAgentSessionParamsOptionSet CreateAgentSessionParamsOptionSetOptions = CreateAgentSessionParamsOptionSet.Create();

private static readonly SessionSpendControlParamOptionSet SpendControlOptions = SessionSpendControlParamOptionSet.Create(@"spend-control");

private static readonly SessionAgentConfigParamOptionSet AgentOptions = SessionAgentConfigParamOptionSet.Create(@"agent");
private static Option<string?> RequestInput { get; } = new(@"--request-input")
{
Expand Down Expand Up @@ -56,7 +54,7 @@ public static Command Create(string? commandName = null)
command.Options.Add(Metadata);
command.Options.Add(Environment);
command.Options.Add(InputOption); command.Options.Add(CreateAgentSessionParamsOptionSetOptions.AgentId);
command.Options.Add(CreateAgentSessionParamsOptionSetOptions.VaultIds); command.Options.Add(SpendControlOptions.Limit); command.Options.Add(AgentOptions.Model);
command.Options.Add(CreateAgentSessionParamsOptionSetOptions.VaultIds); command.Options.Add(AgentOptions.Model);
command.Options.Add(AgentOptions.Instructions);
command.Options.Add(RequestInput);
command.Options.Add(RequestJson);
Expand Down Expand Up @@ -88,17 +86,6 @@ await CliRuntime.RunAsync(async () =>
var input = CliRuntime.WasSpecified(parseResult, InputOption) ? parseResult.GetValue(InputOption) : (__requestBase is { } __InputBaseValue ? __InputBaseValue.Input : default); var agentId = CliRuntime.WasSpecified(parseResult, CreateAgentSessionParamsOptionSetOptions.AgentId) ? parseResult.GetValue(CreateAgentSessionParamsOptionSetOptions.AgentId) : (__requestBase is { } __AgentIdBaseValue ? __AgentIdBaseValue.AgentId : default);
var vaultIds = CliRuntime.WasSpecified(parseResult, CreateAgentSessionParamsOptionSetOptions.VaultIds) ? parseResult.GetValue(CreateAgentSessionParamsOptionSetOptions.VaultIds) : (__requestBase is { } __VaultIdsBaseValue ? __VaultIdsBaseValue.VaultIds : default);

var __SpendControlBase = __requestBase is { } __SpendControlBaseValue ? __SpendControlBaseValue.SpendControl : default; var spendControlLimit = CliRuntime.WasSpecified(parseResult, SpendControlOptions.Limit) ? parseResult.GetValue(SpendControlOptions.Limit) : (__SpendControlBase is { } __SpendControllimitBaseValue ? __SpendControllimitBaseValue.Limit : default);
var __SpendControlSpecified = CliRuntime.WasSpecified(parseResult, SpendControlOptions.Limit);
var spendControl =
__SpendControlSpecified || __SpendControlBase is not null
? new global::tryAGI.OpenAI.SessionSpendControlParam
{
Limit = spendControlLimit,

}
: __SpendControlBase;

var __AgentBase = __requestBase is { } __AgentBaseValue ? __AgentBaseValue.Agent : default; var agentModel = CliRuntime.WasSpecified(parseResult, AgentOptions.Model) ? parseResult.GetValue(AgentOptions.Model) : (__AgentBase is { } __AgentmodelBaseValue ? __AgentmodelBaseValue.Model : default);
var agentInstructions = CliRuntime.WasSpecified(parseResult, AgentOptions.Instructions) ? parseResult.GetValue(AgentOptions.Instructions) : (__AgentBase is { } __AgentinstructionsBaseValue ? __AgentinstructionsBaseValue.Instructions : default);
var __AgentSpecified = CliRuntime.WasSpecified(parseResult, AgentOptions.Model) || CliRuntime.WasSpecified(parseResult, AgentOptions.Instructions);
Expand All @@ -120,7 +107,6 @@ await CliRuntime.RunAsync(async () =>
input: input,
agentId: agentId,
vaultIds: vaultIds,
spendControl: spendControl,
agent: agent,
cancellationToken: cancellationToken);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ internal static partial class AgentsCreateAgentSessionCommandApiCommand
};
private static readonly CreateAgentSessionParamsOptionSet CreateAgentSessionParamsOptionSetOptions = CreateAgentSessionParamsOptionSet.Create();

private static readonly SessionSpendControlParamOptionSet SpendControlOptions = SessionSpendControlParamOptionSet.Create(@"spend-control");

private static readonly SessionAgentConfigParamOptionSet AgentOptions = SessionAgentConfigParamOptionSet.Create(@"agent");
private static Option<string?> RequestInput { get; } = new(@"--request-input")
{
Expand Down Expand Up @@ -92,7 +90,7 @@ public static Command Create(string? commandName = null)
command.Options.Add(Metadata);
command.Options.Add(Environment);
command.Options.Add(InputOption); command.Options.Add(CreateAgentSessionParamsOptionSetOptions.AgentId);
command.Options.Add(CreateAgentSessionParamsOptionSetOptions.VaultIds); command.Options.Add(SpendControlOptions.Limit); command.Options.Add(AgentOptions.Model);
command.Options.Add(CreateAgentSessionParamsOptionSetOptions.VaultIds); command.Options.Add(AgentOptions.Model);
command.Options.Add(AgentOptions.Instructions);
command.Options.Add(RequestInput);
command.Options.Add(RequestJson);
Expand Down Expand Up @@ -126,17 +124,6 @@ await CliRuntime.RunAsync(async () =>
var input = CliRuntime.WasSpecified(parseResult, InputOption) ? parseResult.GetValue(InputOption) : (__requestBase is { } __InputBaseValue ? __InputBaseValue.Input : default); var agentId = CliRuntime.WasSpecified(parseResult, CreateAgentSessionParamsOptionSetOptions.AgentId) ? parseResult.GetValue(CreateAgentSessionParamsOptionSetOptions.AgentId) : (__requestBase is { } __AgentIdBaseValue ? __AgentIdBaseValue.AgentId : default);
var vaultIds = CliRuntime.WasSpecified(parseResult, CreateAgentSessionParamsOptionSetOptions.VaultIds) ? parseResult.GetValue(CreateAgentSessionParamsOptionSetOptions.VaultIds) : (__requestBase is { } __VaultIdsBaseValue ? __VaultIdsBaseValue.VaultIds : default);

var __SpendControlBase = __requestBase is { } __SpendControlBaseValue ? __SpendControlBaseValue.SpendControl : default; var spendControlLimit = CliRuntime.WasSpecified(parseResult, SpendControlOptions.Limit) ? parseResult.GetValue(SpendControlOptions.Limit) : (__SpendControlBase is { } __SpendControllimitBaseValue ? __SpendControllimitBaseValue.Limit : default);
var __SpendControlSpecified = CliRuntime.WasSpecified(parseResult, SpendControlOptions.Limit);
var spendControl =
__SpendControlSpecified || __SpendControlBase is not null
? new global::tryAGI.OpenAI.SessionSpendControlParam
{
Limit = spendControlLimit,

}
: __SpendControlBase;

var __AgentBase = __requestBase is { } __AgentBaseValue ? __AgentBaseValue.Agent : default; var agentModel = CliRuntime.WasSpecified(parseResult, AgentOptions.Model) ? parseResult.GetValue(AgentOptions.Model) : (__AgentBase is { } __AgentmodelBaseValue ? __AgentmodelBaseValue.Model : default);
var agentInstructions = CliRuntime.WasSpecified(parseResult, AgentOptions.Instructions) ? parseResult.GetValue(AgentOptions.Instructions) : (__AgentBase is { } __AgentinstructionsBaseValue ? __AgentinstructionsBaseValue.Instructions : default);
var __AgentSpecified = CliRuntime.WasSpecified(parseResult, AgentOptions.Model) || CliRuntime.WasSpecified(parseResult, AgentOptions.Instructions);
Expand All @@ -161,7 +148,6 @@ await CliRuntime.RunAsync(async () =>
input: input,
agentId: agentId,
vaultIds: vaultIds,
spendControl: spendControl,
agent: agent,
cancellationToken: cancellationToken).ConfigureAwait(false);
var resourceId = global::System.Convert.ToString(
Expand Down Expand Up @@ -194,7 +180,6 @@ await CliRuntime.WriteResponseAsync(
input: input,
agentId: agentId,
vaultIds: vaultIds,
spendControl: spendControl,
agent: agent,
cancellationToken: cancellationToken).ConfigureAwait(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ internal static partial class AgentsUpdateAgentSessionCommandApiCommand
{
Description = @"Replaces all metadata. Omit to leave unchanged, or pass null or {} to clear it. Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters.",
};
private static readonly SessionSpendControlParamOptionSet SpendControlOptions = SessionSpendControlParamOptionSet.Create(@"spend-control");
private static Option<string?> Input { get; } = new(@"--input")
{
Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.",
Expand Down Expand Up @@ -70,7 +69,7 @@ public static Command Create(string? commandName = null)
Updates session metadata, model, reasoning effort, or service tier. Model settings apply to subsequent turns. Omitted fields are unchanged. See [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).");
command.Arguments.Add(SessionId);
command.Options.Add(Agent);
command.Options.Add(Metadata); command.Options.Add(SpendControlOptions.Limit);
command.Options.Add(Metadata);
command.Options.Add(Input);
command.Options.Add(RequestJson);
command.Options.Add(RequestFile);
Expand Down Expand Up @@ -99,25 +98,13 @@ await CliRuntime.RunAsync(async () =>
var sessionId = parseResult.GetRequiredValue(SessionId);
var agent = CliRuntime.WasSpecified(parseResult, Agent) ? parseResult.GetValue(Agent) : (__requestBase is { } __AgentBaseValue ? __AgentBaseValue.Agent : default);
var metadata = CliRuntime.WasSpecified(parseResult, Metadata) ? parseResult.GetValue(Metadata) : (__requestBase is { } __MetadataBaseValue ? __MetadataBaseValue.Metadata : default);

var __SpendControlBase = __requestBase is { } __SpendControlBaseValue ? __SpendControlBaseValue.SpendControl : default; var spendControlLimit = CliRuntime.WasSpecified(parseResult, SpendControlOptions.Limit) ? parseResult.GetValue(SpendControlOptions.Limit) : (__SpendControlBase is { } __SpendControllimitBaseValue ? __SpendControllimitBaseValue.Limit : default);
var __SpendControlSpecified = CliRuntime.WasSpecified(parseResult, SpendControlOptions.Limit);
var spendControl =
__SpendControlSpecified || __SpendControlBase is not null
? new global::tryAGI.OpenAI.SessionSpendControlParam
{
Limit = spendControlLimit,

}
: __SpendControlBase;
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.Agents.UpdateAgentSessionAsync(
sessionId: sessionId,
agent: agent,
metadata: metadata,
spendControl: spendControl,
cancellationToken: cancellationToken).ConfigureAwait(false);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal static partial class AudioCreateSpeechAsEventStreamCommandApiCommand
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). Custom voices must be created from audio samples.",
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). Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live.",
Required = true,
};
private static readonly CreateSpeechRequestOptionSet CreateSpeechRequestOptionSetOptions = CreateSpeechRequestOptionSet.Create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal static partial class AudioCreateSpeechCommandApiCommand
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). Custom voices must be created from audio samples.",
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). Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live.",
Required = true,
};
private static readonly CreateSpeechRequestOptionSet CreateSpeechRequestOptionSetOptions = CreateSpeechRequestOptionSet.Create();
Expand Down
Loading
Loading