diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AllOf.2.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AllOf.2.g.cs index a731c624..73a6ec7a 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AllOf.2.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AllOf.2.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + /// /// /// @@ -41,6 +54,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] #endif public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } /// /// /// @@ -157,6 +183,30 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AnyOf.2.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AnyOf.2.g.cs index 7aaec176..4e389588 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AnyOf.2.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AnyOf.2.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + /// /// /// @@ -41,6 +54,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] #endif public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } /// /// /// @@ -143,6 +169,30 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AnyOf.3.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AnyOf.3.g.cs index 8cf51ef1..bb884020 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AnyOf.3.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AnyOf.3.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + /// /// /// @@ -58,6 +84,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] #endif public bool IsValue3 => Value3 != null; + + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } /// /// /// @@ -187,6 +226,36 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, bool validate = true) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AdminApiKeyCreateResponse.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AdminApiKeyCreateResponse.g.cs index 86aa98cc..d436f282 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AdminApiKeyCreateResponse.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AdminApiKeyCreateResponse.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsAdminApiKey => AdminApiKey != null; + /// + /// + /// + public bool TryPickAdminApiKey( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.AdminApiKey? value) + { + value = AdminApiKey; + return IsAdminApiKey; + } + /// /// The newly created admin API key. The `value` field is only returned once, when the key is created. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AdminApiKeyCreateResponseVariant2))] #endif public bool IsAdminApiKeyCreateResponseVariant2 => AdminApiKeyCreateResponseVariant2 != null; + + /// + /// + /// + public bool TryPickAdminApiKeyCreateResponseVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.AdminApiKeyCreateResponseVariant2? value) + { + value = AdminApiKeyCreateResponseVariant2; + return IsAdminApiKeyCreateResponseVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? adminApiKey = null, - global::System.Func? adminApiKeyCreateResponseVariant2 = null, + global::System.Func? adminApiKey = null, + global::System.Func? adminApiKeyCreateResponseVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? adminApiKey = null, - global::System.Action? adminApiKeyCreateResponseVariant2 = null, + global::System.Action? adminApiKey = null, + + global::System.Action? adminApiKeyCreateResponseVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAdminApiKey) + { + adminApiKey?.Invoke(AdminApiKey!); + } + else if (IsAdminApiKeyCreateResponseVariant2) + { + adminApiKeyCreateResponseVariant2?.Invoke(AdminApiKeyCreateResponseVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? adminApiKey = null, + global::System.Action? adminApiKeyCreateResponseVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Annotation.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Annotation.g.cs index 44898de6..f450c2d8 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Annotation.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Annotation.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsFileCitation => FileCitation != null; + /// + /// + /// + public bool TryPickFileCitation( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FileCitationBody? value) + { + value = FileCitation; + return IsFileCitation; + } + /// /// A citation for a web resource used to generate a model response. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsUrlCitation => UrlCitation != null; + /// + /// + /// + public bool TryPickUrlCitation( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UrlCitationBody? value) + { + value = UrlCitation; + return IsUrlCitation; + } + /// /// A citation for a container file used to generate a model response. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsContainerFileCitation => ContainerFileCitation != null; + /// + /// + /// + public bool TryPickContainerFileCitation( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ContainerFileCitationBody? value) + { + value = ContainerFileCitation; + return IsContainerFileCitation; + } + /// /// A path to a file. /// @@ -76,6 +115,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FilePath))] #endif public bool IsFilePath => FilePath != null; + + /// + /// + /// + public bool TryPickFilePath( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FilePath? value) + { + value = FilePath; + return IsFilePath; + } /// /// /// @@ -196,10 +248,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? fileCitation = null, - global::System.Func? urlCitation = null, - global::System.Func? containerFileCitation = null, - global::System.Func? filePath = null, + global::System.Func? fileCitation = null, + global::System.Func? urlCitation = null, + global::System.Func? containerFileCitation = null, + global::System.Func? filePath = null, bool validate = true) { if (validate) @@ -231,10 +283,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? fileCitation = null, - global::System.Action? urlCitation = null, - global::System.Action? containerFileCitation = null, - global::System.Action? filePath = null, + global::System.Action? fileCitation = null, + + global::System.Action? urlCitation = null, + + global::System.Action? containerFileCitation = null, + + global::System.Action? filePath = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsFileCitation) + { + fileCitation?.Invoke(FileCitation!); + } + else if (IsUrlCitation) + { + urlCitation?.Invoke(UrlCitation!); + } + else if (IsContainerFileCitation) + { + containerFileCitation?.Invoke(ContainerFileCitation!); + } + else if (IsFilePath) + { + filePath?.Invoke(FilePath!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? fileCitation = null, + global::System.Action? urlCitation = null, + global::System.Action? containerFileCitation = null, + global::System.Action? filePath = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AnnotationsItem3.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AnnotationsItem3.g.cs index 11269cff..06d61c2c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AnnotationsItem3.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AnnotationsItem3.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsFile => File != null; + /// + /// + /// + public bool TryPickFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FileAnnotation? value) + { + value = File; + return IsFile; + } + /// /// Annotation that references a URL. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Url))] #endif public bool IsUrl => Url != null; + + /// + /// + /// + public bool TryPickUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UrlAnnotation? value) + { + value = Url; + return IsUrl; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? file = null, - global::System.Func? url = null, + global::System.Func? file = null, + global::System.Func? url = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? file = null, - global::System.Action? url = null, + global::System.Action? file = null, + + global::System.Action? url = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsFile) + { + file?.Invoke(File!); + } + else if (IsUrl) + { + url?.Invoke(Url!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? file = null, + global::System.Action? url = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ApplyPatchOperationParam.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ApplyPatchOperationParam.g.cs index 76a9d49f..1031a365 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ApplyPatchOperationParam.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ApplyPatchOperationParam.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsCreateFile => CreateFile != null; + /// + /// + /// + public bool TryPickCreateFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchCreateFileOperationParam? value) + { + value = CreateFile; + return IsCreateFile; + } + /// /// Instruction for deleting an existing file via the apply_patch tool. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsDeleteFile => DeleteFile != null; + /// + /// + /// + public bool TryPickDeleteFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchDeleteFileOperationParam? value) + { + value = DeleteFile; + return IsDeleteFile; + } + /// /// Instruction for updating an existing file via the apply_patch tool. /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UpdateFile))] #endif public bool IsUpdateFile => UpdateFile != null; + + /// + /// + /// + public bool TryPickUpdateFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchUpdateFileOperationParam? value) + { + value = UpdateFile; + return IsUpdateFile; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? createFile = null, - global::System.Func? deleteFile = null, - global::System.Func? updateFile = null, + global::System.Func? createFile = null, + global::System.Func? deleteFile = null, + global::System.Func? updateFile = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? createFile = null, - global::System.Action? deleteFile = null, - global::System.Action? updateFile = null, + global::System.Action? createFile = null, + + global::System.Action? deleteFile = null, + + global::System.Action? updateFile = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCreateFile) + { + createFile?.Invoke(CreateFile!); + } + else if (IsDeleteFile) + { + deleteFile?.Invoke(DeleteFile!); + } + else if (IsUpdateFile) + { + updateFile?.Invoke(UpdateFile!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? createFile = null, + global::System.Action? deleteFile = null, + global::System.Action? updateFile = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantStreamEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantStreamEvent.g.cs index 9471f839..d7bd5bb9 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantStreamEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantStreamEvent.g.cs @@ -40,6 +40,19 @@ namespace tryAGI.OpenAI #endif public bool IsThread => Thread != null; + /// + /// + /// + public bool TryPickThread( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ThreadStreamEvent? value) + { + value = Thread; + return IsThread; + } + /// /// /// @@ -57,6 +70,19 @@ namespace tryAGI.OpenAI #endif public bool IsRun => Run != null; + /// + /// + /// + public bool TryPickRun( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStreamEvent? value) + { + value = Run; + return IsRun; + } + /// /// /// @@ -74,6 +100,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStep => RunStep != null; + /// + /// + /// + public bool TryPickRunStep( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStepStreamEvent? value) + { + value = RunStep; + return IsRunStep; + } + /// /// /// @@ -91,6 +130,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessage => Message != null; + /// + /// + /// + public bool TryPickMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MessageStreamEvent? value) + { + value = Message; + return IsMessage; + } + /// /// Occurs when an [error](/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout. /// @@ -108,6 +160,19 @@ namespace tryAGI.OpenAI #endif public bool IsError => Error != null; + /// + /// + /// + public bool TryPickError( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ErrorEvent? value) + { + value = Error; + return IsError; + } + /// /// Occurs when a stream ends. /// @@ -124,6 +189,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Done))] #endif public bool IsDone => Done != null; + + /// + /// + /// + public bool TryPickDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.DoneEvent? value) + { + value = Done; + return IsDone; + } /// /// /// @@ -292,8 +370,8 @@ public bool Validate() global::System.Func? run = null, global::System.Func? runStep = null, global::System.Func? message = null, - global::System.Func? error = null, - global::System.Func? done = null, + global::System.Func? error = null, + global::System.Func? done = null, bool validate = true) { if (validate) @@ -334,11 +412,59 @@ public bool Validate() /// public void Match( global::System.Action? thread = null, + + global::System.Action? run = null, + + global::System.Action? runStep = null, + + global::System.Action? message = null, + + global::System.Action? error = null, + + global::System.Action? done = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsThread) + { + thread?.Invoke(Thread!); + } + else if (IsRun) + { + run?.Invoke(Run!); + } + else if (IsRunStep) + { + runStep?.Invoke(RunStep!); + } + else if (IsMessage) + { + message?.Invoke(Message!); + } + else if (IsError) + { + error?.Invoke(Error!); + } + else if (IsDone) + { + done?.Invoke(Done!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? thread = null, global::System.Action? run = null, global::System.Action? runStep = null, global::System.Action? message = null, - global::System.Action? error = null, - global::System.Action? done = null, + global::System.Action? error = null, + global::System.Action? done = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantsApiResponseFormatOption.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantsApiResponseFormatOption.g.cs index 9f8a1e67..54726410 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantsApiResponseFormatOption.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantsApiResponseFormatOption.g.cs @@ -29,6 +29,19 @@ namespace tryAGI.OpenAI #endif public bool IsEnum => Enum != null; + /// + /// + /// + public bool TryPickEnum( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum? value) + { + value = Enum; + return IsEnum; + } + /// /// Default response format. Used to generate text responses. /// @@ -46,6 +59,19 @@ namespace tryAGI.OpenAI #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFormatText? value) + { + value = Text; + return IsText; + } + /// /// JSON object response format. An older method of generating JSON responses.
/// Using `json_schema` is recommended for models that support it. Note that the
@@ -66,6 +92,19 @@ namespace tryAGI.OpenAI #endif public bool IsJsonObject => JsonObject != null; + /// + /// + /// + public bool TryPickJsonObject( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFormatJsonObject? value) + { + value = JsonObject; + return IsJsonObject; + } + /// /// JSON Schema response format. Used to generate structured JSON responses.
/// Learn more about [Structured Outputs](/docs/guides/structured-outputs). @@ -83,6 +122,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JsonSchema))] #endif public bool IsJsonSchema => JsonSchema != null; + + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFormatJsonSchema? value) + { + value = JsonSchema; + return IsJsonSchema; + } /// /// /// @@ -204,9 +256,9 @@ public bool Validate() ///
public TResult? Match( global::System.Func? @enum = null, - global::System.Func? text = null, - global::System.Func? jsonObject = null, - global::System.Func? jsonSchema = null, + global::System.Func? text = null, + global::System.Func? jsonObject = null, + global::System.Func? jsonSchema = null, bool validate = true) { if (validate) @@ -239,9 +291,45 @@ public bool Validate() ///
public void Match( global::System.Action? @enum = null, - global::System.Action? text = null, - global::System.Action? jsonObject = null, - global::System.Action? jsonSchema = null, + + global::System.Action? text = null, + + global::System.Action? jsonObject = null, + + global::System.Action? jsonSchema = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsEnum) + { + @enum?.Invoke(Enum!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsJsonObject) + { + jsonObject?.Invoke(JsonObject!); + } + else if (IsJsonSchema) + { + jsonSchema?.Invoke(JsonSchema!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? @enum = null, + global::System.Action? text = null, + global::System.Action? jsonObject = null, + global::System.Action? jsonSchema = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantsApiToolChoiceOption.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantsApiToolChoiceOption.g.cs index bf00971f..62e56587 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantsApiToolChoiceOption.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.AssistantsApiToolChoiceOption.g.cs @@ -30,6 +30,19 @@ namespace tryAGI.OpenAI #endif public bool IsEnum => Enum != null; + /// + /// + /// + public bool TryPickEnum( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum? value) + { + value = Enum; + return IsEnum; + } + /// /// Specifies a tool the model should use. Use to force the model to call a specific tool. /// @@ -46,6 +59,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Named))] #endif public bool IsNamed => Named != null; + + /// + /// + /// + public bool TryPickNamed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.AssistantsNamedToolChoice? value) + { + value = Named; + return IsNamed; + } /// /// /// @@ -123,7 +149,7 @@ public bool Validate() /// public TResult? Match( global::System.Func? @enum = null, - global::System.Func? named = null, + global::System.Func? named = null, bool validate = true) { if (validate) @@ -148,7 +174,31 @@ public bool Validate() /// public void Match( global::System.Action? @enum = null, - global::System.Action? named = null, + + global::System.Action? named = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsEnum) + { + @enum?.Invoke(Enum!); + } + else if (IsNamed) + { + named?.Invoke(Named!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? @enum = null, + global::System.Action? named = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionMessageToolCallsItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionMessageToolCallsItem.g.cs index d3b1d49f..e6929ed7 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionMessageToolCallsItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionMessageToolCallsItem.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunction => Function != null; + /// + /// + /// + public bool TryPickFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionMessageToolCall? value) + { + value = Function; + return IsFunction; + } + /// /// A call to a custom tool created by the model. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Custom))] #endif public bool IsCustom => Custom != null; + + /// + /// + /// + public bool TryPickCustom( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionMessageCustomToolCall? value) + { + value = Custom; + return IsCustom; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? function = null, - global::System.Func? custom = null, + global::System.Func? function = null, + global::System.Func? custom = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? function = null, - global::System.Action? custom = null, + global::System.Action? function = null, + + global::System.Action? custom = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsFunction) + { + function?.Invoke(Function!); + } + else if (IsCustom) + { + custom?.Invoke(Custom!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? function = null, + global::System.Action? custom = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestAssistantMessageContentPart.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestAssistantMessageContentPart.g.cs index bb46d7ba..0f747202 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestAssistantMessageContentPart.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestAssistantMessageContentPart.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestMessageContentPartText? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Refusal))] #endif public bool IsRefusal => Refusal != null; + + /// + /// + /// + public bool TryPickRefusal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestMessageContentPartRefusal? value) + { + value = Refusal; + return IsRefusal; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? refusal = null, + global::System.Func? text = null, + global::System.Func? refusal = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? refusal = null, + global::System.Action? text = null, + + global::System.Action? refusal = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsRefusal) + { + refusal?.Invoke(Refusal!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? refusal = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestMessage.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestMessage.g.cs index fd57fcfc..54419005 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestMessage.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestMessage.g.cs @@ -28,6 +28,19 @@ namespace tryAGI.OpenAI #endif public bool IsDeveloper => Developer != null; + /// + /// + /// + public bool TryPickDeveloper( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestDeveloperMessage? value) + { + value = Developer; + return IsDeveloper; + } + /// /// Developer-provided instructions that the model should follow, regardless of
/// messages sent by the user. With o1 models and newer, use `developer` messages
@@ -47,6 +60,19 @@ namespace tryAGI.OpenAI #endif public bool IsSystem => System != null; + /// + /// + /// + public bool TryPickSystem( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestSystemMessage? value) + { + value = System; + return IsSystem; + } + /// /// Messages sent by an end user, containing prompts or additional context
/// information. @@ -65,6 +91,19 @@ namespace tryAGI.OpenAI #endif public bool IsUser => User != null; + /// + /// + /// + public bool TryPickUser( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestUserMessage? value) + { + value = User; + return IsUser; + } + /// /// Messages sent by the model in response to user messages. /// @@ -82,6 +121,19 @@ namespace tryAGI.OpenAI #endif public bool IsAssistant => Assistant != null; + /// + /// + /// + public bool TryPickAssistant( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestAssistantMessage? value) + { + value = Assistant; + return IsAssistant; + } + /// /// /// @@ -99,6 +151,19 @@ namespace tryAGI.OpenAI #endif public bool IsTool => Tool != null; + /// + /// + /// + public bool TryPickTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestToolMessage? value) + { + value = Tool; + return IsTool; + } + /// /// /// @@ -115,6 +180,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Function))] #endif public bool IsFunction => Function != null; + + /// + /// + /// + public bool TryPickFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestFunctionMessage? value) + { + value = Function; + return IsFunction; + } /// /// /// @@ -279,12 +357,12 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? developer = null, - global::System.Func? system = null, - global::System.Func? user = null, - global::System.Func? assistant = null, - global::System.Func? tool = null, - global::System.Func? function = null, + global::System.Func? developer = null, + global::System.Func? system = null, + global::System.Func? user = null, + global::System.Func? assistant = null, + global::System.Func? tool = null, + global::System.Func? function = null, bool validate = true) { if (validate) @@ -324,12 +402,60 @@ public bool Validate() /// ///
public void Match( - global::System.Action? developer = null, - global::System.Action? system = null, - global::System.Action? user = null, - global::System.Action? assistant = null, - global::System.Action? tool = null, - global::System.Action? function = null, + global::System.Action? developer = null, + + global::System.Action? system = null, + + global::System.Action? user = null, + + global::System.Action? assistant = null, + + global::System.Action? tool = null, + + global::System.Action? function = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDeveloper) + { + developer?.Invoke(Developer!); + } + else if (IsSystem) + { + system?.Invoke(System!); + } + else if (IsUser) + { + user?.Invoke(User!); + } + else if (IsAssistant) + { + assistant?.Invoke(Assistant!); + } + else if (IsTool) + { + tool?.Invoke(Tool!); + } + else if (IsFunction) + { + function?.Invoke(Function!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? developer = null, + global::System.Action? system = null, + global::System.Action? user = null, + global::System.Action? assistant = null, + global::System.Action? tool = null, + global::System.Action? function = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestSystemMessageContentPart.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestSystemMessageContentPart.g.cs index 1f46ca6e..6f5beda0 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestSystemMessageContentPart.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestSystemMessageContentPart.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TextContentPart))] #endif public bool IsTextContentPart => TextContentPart != null; + + /// + /// + /// + public bool TryPickTextContentPart( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestMessageContentPartText? value) + { + value = TextContentPart; + return IsTextContentPart; + } /// /// /// @@ -69,7 +82,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? textContentPart = null, + global::System.Func? textContentPart = null, bool validate = true) { if (validate) @@ -89,7 +102,25 @@ public bool Validate() /// /// public void Match( - global::System.Action? textContentPart = null, + global::System.Action? textContentPart = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTextContentPart) + { + textContentPart?.Invoke(TextContentPart!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? textContentPart = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestToolMessageContentPart.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestToolMessageContentPart.g.cs index 9b5ef7ba..a4ca856d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestToolMessageContentPart.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestToolMessageContentPart.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TextContentPart))] #endif public bool IsTextContentPart => TextContentPart != null; + + /// + /// + /// + public bool TryPickTextContentPart( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestMessageContentPartText? value) + { + value = TextContentPart; + return IsTextContentPart; + } /// /// /// @@ -69,7 +82,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? textContentPart = null, + global::System.Func? textContentPart = null, bool validate = true) { if (validate) @@ -89,7 +102,25 @@ public bool Validate() /// /// public void Match( - global::System.Action? textContentPart = null, + global::System.Action? textContentPart = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTextContentPart) + { + textContentPart?.Invoke(TextContentPart!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? textContentPart = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestUserMessageContentPart.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestUserMessageContentPart.g.cs index 7d05e1d6..48b35a51 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestUserMessageContentPart.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionRequestUserMessageContentPart.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsTextContentPart => TextContentPart != null; + /// + /// + /// + public bool TryPickTextContentPart( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestMessageContentPartText? value) + { + value = TextContentPart; + return IsTextContentPart; + } + /// /// Learn about [image inputs](/docs/guides/vision). /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsImageContentPart => ImageContentPart != null; + /// + /// + /// + public bool TryPickImageContentPart( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestMessageContentPartImage? value) + { + value = ImageContentPart; + return IsImageContentPart; + } + /// /// Learn about [audio inputs](/docs/guides/audio). /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsAudioContentPart => AudioContentPart != null; + /// + /// + /// + public bool TryPickAudioContentPart( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestMessageContentPartAudio? value) + { + value = AudioContentPart; + return IsAudioContentPart; + } + /// /// Learn about [file inputs](/docs/guides/text) for text generation. /// @@ -76,6 +115,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FileContentPart))] #endif public bool IsFileContentPart => FileContentPart != null; + + /// + /// + /// + public bool TryPickFileContentPart( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestMessageContentPartFile? value) + { + value = FileContentPart; + return IsFileContentPart; + } /// /// /// @@ -196,10 +248,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? textContentPart = null, - global::System.Func? imageContentPart = null, - global::System.Func? audioContentPart = null, - global::System.Func? fileContentPart = null, + global::System.Func? textContentPart = null, + global::System.Func? imageContentPart = null, + global::System.Func? audioContentPart = null, + global::System.Func? fileContentPart = null, bool validate = true) { if (validate) @@ -231,10 +283,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? textContentPart = null, - global::System.Action? imageContentPart = null, - global::System.Action? audioContentPart = null, - global::System.Action? fileContentPart = null, + global::System.Action? textContentPart = null, + + global::System.Action? imageContentPart = null, + + global::System.Action? audioContentPart = null, + + global::System.Action? fileContentPart = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTextContentPart) + { + textContentPart?.Invoke(TextContentPart!); + } + else if (IsImageContentPart) + { + imageContentPart?.Invoke(ImageContentPart!); + } + else if (IsAudioContentPart) + { + audioContentPart?.Invoke(AudioContentPart!); + } + else if (IsFileContentPart) + { + fileContentPart?.Invoke(FileContentPart!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? textContentPart = null, + global::System.Action? imageContentPart = null, + global::System.Action? audioContentPart = null, + global::System.Action? fileContentPart = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionToolChoiceOption.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionToolChoiceOption.g.cs index 18ecb5aa..aa902c8e 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionToolChoiceOption.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChatCompletionToolChoiceOption.g.cs @@ -31,6 +31,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolChoiceMode => ToolChoiceMode != null; + /// + /// + /// + public bool TryPickToolChoiceMode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionToolChoiceOptionEnum? value) + { + value = ToolChoiceMode; + return IsToolChoiceMode; + } + /// /// Constrains the tools available to the model to a pre-defined set. /// @@ -48,6 +61,19 @@ namespace tryAGI.OpenAI #endif public bool IsAllowedTools => AllowedTools != null; + /// + /// + /// + public bool TryPickAllowedTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionAllowedToolsChoice? value) + { + value = AllowedTools; + return IsAllowedTools; + } + /// /// Specifies a tool the model should use. Use to force the model to call a specific function. /// @@ -65,6 +91,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionToolChoice => FunctionToolChoice != null; + /// + /// + /// + public bool TryPickFunctionToolChoice( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionNamedToolChoice? value) + { + value = FunctionToolChoice; + return IsFunctionToolChoice; + } + /// /// Specifies a tool the model should use. Use to force the model to call a specific custom tool. /// @@ -81,6 +120,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomToolChoice))] #endif public bool IsCustomToolChoice => CustomToolChoice != null; + + /// + /// + /// + public bool TryPickCustomToolChoice( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionNamedToolChoiceCustom? value) + { + value = CustomToolChoice; + return IsCustomToolChoice; + } /// /// /// @@ -202,9 +254,9 @@ public bool Validate() /// public TResult? Match( global::System.Func? toolChoiceMode = null, - global::System.Func? allowedTools = null, - global::System.Func? functionToolChoice = null, - global::System.Func? customToolChoice = null, + global::System.Func? allowedTools = null, + global::System.Func? functionToolChoice = null, + global::System.Func? customToolChoice = null, bool validate = true) { if (validate) @@ -237,9 +289,45 @@ public bool Validate() /// public void Match( global::System.Action? toolChoiceMode = null, - global::System.Action? allowedTools = null, - global::System.Action? functionToolChoice = null, - global::System.Action? customToolChoice = null, + + global::System.Action? allowedTools = null, + + global::System.Action? functionToolChoice = null, + + global::System.Action? customToolChoice = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsToolChoiceMode) + { + toolChoiceMode?.Invoke(ToolChoiceMode!); + } + else if (IsAllowedTools) + { + allowedTools?.Invoke(AllowedTools!); + } + else if (IsFunctionToolChoice) + { + functionToolChoice?.Invoke(FunctionToolChoice!); + } + else if (IsCustomToolChoice) + { + customToolChoice?.Invoke(CustomToolChoice!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? toolChoiceMode = null, + global::System.Action? allowedTools = null, + global::System.Action? functionToolChoice = null, + global::System.Action? customToolChoice = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChunkingStrategyRequestParam.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChunkingStrategyRequestParam.g.cs index 8e17a112..f435a706 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChunkingStrategyRequestParam.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ChunkingStrategyRequestParam.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsAuto => Auto != null; + /// + /// + /// + public bool TryPickAuto( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.AutoChunkingStrategyRequestParam? value) + { + value = Auto; + return IsAuto; + } + /// /// Customize your own chunking strategy by setting chunk size and chunk overlap. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Static))] #endif public bool IsStatic => Static != null; + + /// + /// + /// + public bool TryPickStatic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.StaticChunkingStrategyRequestParam? value) + { + value = Static; + return IsStatic; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? auto = null, - global::System.Func? @static = null, + global::System.Func? auto = null, + global::System.Func? @static = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? auto = null, - global::System.Action? @static = null, + global::System.Action? auto = null, + + global::System.Action? @static = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAuto) + { + auto?.Invoke(Auto!); + } + else if (IsStatic) + { + @static?.Invoke(Static!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? auto = null, + global::System.Action? @static = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ComputerAction.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ComputerAction.g.cs index d8aa97d9..a6848f39 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ComputerAction.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ComputerAction.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsClick => Click != null; + /// + /// + /// + public bool TryPickClick( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ClickParam? value) + { + value = Click; + return IsClick; + } + /// /// A double click action. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsDoubleClick => DoubleClick != null; + /// + /// + /// + public bool TryPickDoubleClick( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.DoubleClickAction? value) + { + value = DoubleClick; + return IsDoubleClick; + } + /// /// A drag action. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsDrag => Drag != null; + /// + /// + /// + public bool TryPickDrag( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.DragParam? value) + { + value = Drag; + return IsDrag; + } + /// /// A collection of keypresses the model would like to perform. /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI #endif public bool IsKeypress => Keypress != null; + /// + /// + /// + public bool TryPickKeypress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.KeyPressAction? value) + { + value = Keypress; + return IsKeypress; + } + /// /// A mouse move action. /// @@ -94,6 +146,19 @@ namespace tryAGI.OpenAI #endif public bool IsMove => Move != null; + /// + /// + /// + public bool TryPickMove( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MoveParam? value) + { + value = Move; + return IsMove; + } + /// /// A screenshot action. /// @@ -111,6 +176,19 @@ namespace tryAGI.OpenAI #endif public bool IsScreenshot => Screenshot != null; + /// + /// + /// + public bool TryPickScreenshot( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ScreenshotParam? value) + { + value = Screenshot; + return IsScreenshot; + } + /// /// A scroll action. /// @@ -128,6 +206,19 @@ namespace tryAGI.OpenAI #endif public bool IsScroll => Scroll != null; + /// + /// + /// + public bool TryPickScroll( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ScrollParam? value) + { + value = Scroll; + return IsScroll; + } + /// /// An action to type in text. /// @@ -145,6 +236,19 @@ namespace tryAGI.OpenAI #endif public bool IsType => Type != null; + /// + /// + /// + public bool TryPickType( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.TypeParam? value) + { + value = Type; + return IsType; + } + /// /// A wait action. /// @@ -161,6 +265,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Wait))] #endif public bool IsWait => Wait != null; + + /// + /// + /// + public bool TryPickWait( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WaitParam? value) + { + value = Wait; + return IsWait; + } /// /// /// @@ -391,15 +508,15 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? click = null, - global::System.Func? doubleClick = null, - global::System.Func? drag = null, - global::System.Func? keypress = null, - global::System.Func? move = null, - global::System.Func? screenshot = null, - global::System.Func? scroll = null, - global::System.Func? type = null, - global::System.Func? wait = null, + global::System.Func? click = null, + global::System.Func? doubleClick = null, + global::System.Func? drag = null, + global::System.Func? keypress = null, + global::System.Func? move = null, + global::System.Func? screenshot = null, + global::System.Func? scroll = null, + global::System.Func? type = null, + global::System.Func? wait = null, bool validate = true) { if (validate) @@ -451,15 +568,81 @@ public bool Validate() /// /// public void Match( - global::System.Action? click = null, - global::System.Action? doubleClick = null, - global::System.Action? drag = null, - global::System.Action? keypress = null, - global::System.Action? move = null, - global::System.Action? screenshot = null, - global::System.Action? scroll = null, - global::System.Action? type = null, - global::System.Action? wait = null, + global::System.Action? click = null, + + global::System.Action? doubleClick = null, + + global::System.Action? drag = null, + + global::System.Action? keypress = null, + + global::System.Action? move = null, + + global::System.Action? screenshot = null, + + global::System.Action? scroll = null, + + global::System.Action? type = null, + + global::System.Action? wait = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsClick) + { + click?.Invoke(Click!); + } + else if (IsDoubleClick) + { + doubleClick?.Invoke(DoubleClick!); + } + else if (IsDrag) + { + drag?.Invoke(Drag!); + } + else if (IsKeypress) + { + keypress?.Invoke(Keypress!); + } + else if (IsMove) + { + move?.Invoke(Move!); + } + else if (IsScreenshot) + { + screenshot?.Invoke(Screenshot!); + } + else if (IsScroll) + { + scroll?.Invoke(Scroll!); + } + else if (IsType) + { + type?.Invoke(Type!); + } + else if (IsWait) + { + wait?.Invoke(Wait!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? click = null, + global::System.Action? doubleClick = null, + global::System.Action? drag = null, + global::System.Action? keypress = null, + global::System.Action? move = null, + global::System.Action? screenshot = null, + global::System.Action? scroll = null, + global::System.Action? type = null, + global::System.Action? wait = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ComputerToolCallOutputResource.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ComputerToolCallOutputResource.g.cs index 67629369..ad0594ac 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ComputerToolCallOutputResource.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ComputerToolCallOutputResource.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerToolCallOutput => ComputerToolCallOutput != null; + /// + /// + /// + public bool TryPickComputerToolCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerToolCallOutput? value) + { + value = ComputerToolCallOutput; + return IsComputerToolCallOutput; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ComputerToolCallOutputResourceVariant2))] #endif public bool IsComputerToolCallOutputResourceVariant2 => ComputerToolCallOutputResourceVariant2 != null; + + /// + /// + /// + public bool TryPickComputerToolCallOutputResourceVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2? value) + { + value = ComputerToolCallOutputResourceVariant2; + return IsComputerToolCallOutputResourceVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? computerToolCallOutput = null, - global::System.Func? computerToolCallOutputResourceVariant2 = null, + global::System.Func? computerToolCallOutput = null, + global::System.Func? computerToolCallOutputResourceVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? computerToolCallOutput = null, - global::System.Action? computerToolCallOutputResourceVariant2 = null, + global::System.Action? computerToolCallOutput = null, + + global::System.Action? computerToolCallOutputResourceVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsComputerToolCallOutput) + { + computerToolCallOutput?.Invoke(ComputerToolCallOutput!); + } + else if (IsComputerToolCallOutputResourceVariant2) + { + computerToolCallOutputResourceVariant2?.Invoke(ComputerToolCallOutputResourceVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? computerToolCallOutput = null, + global::System.Action? computerToolCallOutputResourceVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Content5.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Content5.g.cs index 0a83f4a3..760e2609 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Content5.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Content5.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputContentTypes => InputContentTypes != null; + /// + /// + /// + public bool TryPickInputContentTypes( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputContent? value) + { + value = InputContentTypes; + return IsInputContentTypes; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(OutputContentTypes))] #endif public bool IsOutputContentTypes => OutputContentTypes != null; + + /// + /// + /// + public bool TryPickOutputContentTypes( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.OutputContent? value) + { + value = OutputContentTypes; + return IsOutputContentTypes; + } /// /// /// @@ -144,6 +170,30 @@ public bool Validate() /// public void Match( global::System.Action? inputContentTypes = null, + + global::System.Action? outputContentTypes = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsInputContentTypes) + { + inputContentTypes?.Invoke(InputContentTypes!); + } + else if (IsOutputContentTypes) + { + outputContentTypes?.Invoke(OutputContentTypes!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? inputContentTypes = null, global::System.Action? outputContentTypes = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ContentItem3.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ContentItem3.g.cs index 828575ad..29b66257 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ContentItem3.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ContentItem3.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputText => InputText != null; + /// + /// + /// + public bool TryPickInputText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputTextContent? value) + { + value = InputText; + return IsInputText; + } + /// /// A text output from the model. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsOutputText => OutputText != null; + /// + /// + /// + public bool TryPickOutputText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.OutputTextContent? value) + { + value = OutputText; + return IsOutputText; + } + /// /// A text content. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.TextContent? value) + { + value = Text; + return IsText; + } + /// /// A summary text from the model. /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI #endif public bool IsSummaryText => SummaryText != null; + /// + /// + /// + public bool TryPickSummaryText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.SummaryTextContent? value) + { + value = SummaryText; + return IsSummaryText; + } + /// /// Reasoning text from the model. /// @@ -94,6 +146,19 @@ namespace tryAGI.OpenAI #endif public bool IsReasoningText => ReasoningText != null; + /// + /// + /// + public bool TryPickReasoningText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ReasoningTextContent? value) + { + value = ReasoningText; + return IsReasoningText; + } + /// /// A refusal from the model. /// @@ -111,6 +176,19 @@ namespace tryAGI.OpenAI #endif public bool IsRefusal => Refusal != null; + /// + /// + /// + public bool TryPickRefusal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RefusalContent? value) + { + value = Refusal; + return IsRefusal; + } + /// /// An image input to the model. Learn about [image inputs](/docs/guides/vision). /// @@ -128,6 +206,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputImage => InputImage != null; + /// + /// + /// + public bool TryPickInputImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputImageContent? value) + { + value = InputImage; + return IsInputImage; + } + /// /// A screenshot of a computer. /// @@ -145,6 +236,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerScreenshot => ComputerScreenshot != null; + /// + /// + /// + public bool TryPickComputerScreenshot( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerScreenshotContent? value) + { + value = ComputerScreenshot; + return IsComputerScreenshot; + } + /// /// A file input to the model. /// @@ -161,6 +265,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InputFile))] #endif public bool IsInputFile => InputFile != null; + + /// + /// + /// + public bool TryPickInputFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputFileContent? value) + { + value = InputFile; + return IsInputFile; + } /// /// /// @@ -391,15 +508,15 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? inputText = null, - global::System.Func? outputText = null, - global::System.Func? text = null, - global::System.Func? summaryText = null, - global::System.Func? reasoningText = null, - global::System.Func? refusal = null, - global::System.Func? inputImage = null, - global::System.Func? computerScreenshot = null, - global::System.Func? inputFile = null, + global::System.Func? inputText = null, + global::System.Func? outputText = null, + global::System.Func? text = null, + global::System.Func? summaryText = null, + global::System.Func? reasoningText = null, + global::System.Func? refusal = null, + global::System.Func? inputImage = null, + global::System.Func? computerScreenshot = null, + global::System.Func? inputFile = null, bool validate = true) { if (validate) @@ -451,15 +568,81 @@ public bool Validate() /// /// public void Match( - global::System.Action? inputText = null, - global::System.Action? outputText = null, - global::System.Action? text = null, - global::System.Action? summaryText = null, - global::System.Action? reasoningText = null, - global::System.Action? refusal = null, - global::System.Action? inputImage = null, - global::System.Action? computerScreenshot = null, - global::System.Action? inputFile = null, + global::System.Action? inputText = null, + + global::System.Action? outputText = null, + + global::System.Action? text = null, + + global::System.Action? summaryText = null, + + global::System.Action? reasoningText = null, + + global::System.Action? refusal = null, + + global::System.Action? inputImage = null, + + global::System.Action? computerScreenshot = null, + + global::System.Action? inputFile = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsInputText) + { + inputText?.Invoke(InputText!); + } + else if (IsOutputText) + { + outputText?.Invoke(OutputText!); + } + else if (IsText) + { + text?.Invoke(Text!); + } + else if (IsSummaryText) + { + summaryText?.Invoke(SummaryText!); + } + else if (IsReasoningText) + { + reasoningText?.Invoke(ReasoningText!); + } + else if (IsRefusal) + { + refusal?.Invoke(Refusal!); + } + else if (IsInputImage) + { + inputImage?.Invoke(InputImage!); + } + else if (IsComputerScreenshot) + { + computerScreenshot?.Invoke(ComputerScreenshot!); + } + else if (IsInputFile) + { + inputFile?.Invoke(InputFile!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? inputText = null, + global::System.Action? outputText = null, + global::System.Action? text = null, + global::System.Action? summaryText = null, + global::System.Action? reasoningText = null, + global::System.Action? refusal = null, + global::System.Action? inputImage = null, + global::System.Action? computerScreenshot = null, + global::System.Action? inputFile = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ContentItem4.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ContentItem4.g.cs index 1911672b..1b54ef64 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ContentItem4.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ContentItem4.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputText => InputText != null; + /// + /// + /// + public bool TryPickInputText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UserMessageInputText? value) + { + value = InputText; + return IsInputText; + } + /// /// Quoted snippet that the user referenced in their message. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(QuotedText))] #endif public bool IsQuotedText => QuotedText != null; + + /// + /// + /// + public bool TryPickQuotedText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UserMessageQuotedText? value) + { + value = QuotedText; + return IsQuotedText; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? inputText = null, - global::System.Func? quotedText = null, + global::System.Func? inputText = null, + global::System.Func? quotedText = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? inputText = null, - global::System.Action? quotedText = null, + global::System.Action? inputText = null, + + global::System.Action? quotedText = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsInputText) + { + inputText?.Invoke(InputText!); + } + else if (IsQuotedText) + { + quotedText?.Invoke(QuotedText!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? inputText = null, + global::System.Action? quotedText = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ConversationItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ConversationItem.g.cs index 1080da07..242b0bc1 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ConversationItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ConversationItem.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessage => Message != null; + /// + /// + /// + public bool TryPickMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Message? value) + { + value = Message; + return IsMessage; + } + /// /// /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionToolCallResource => FunctionToolCallResource != null; + /// + /// + /// + public bool TryPickFunctionToolCallResource( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCallResource? value) + { + value = FunctionToolCallResource; + return IsFunctionToolCallResource; + } + /// /// /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionToolCallOutputResource => FunctionToolCallOutputResource != null; + /// + /// + /// + public bool TryPickFunctionToolCallOutputResource( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCallOutputResource? value) + { + value = FunctionToolCallOutputResource; + return IsFunctionToolCallOutputResource; + } + /// /// The results of a file search tool call. See the
/// [file search guide](/docs/guides/tools-file-search) for more information. @@ -78,6 +117,19 @@ namespace tryAGI.OpenAI #endif public bool IsFileSearchCall => FileSearchCall != null; + /// + /// + /// + public bool TryPickFileSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FileSearchToolCall? value) + { + value = FileSearchCall; + return IsFileSearchCall; + } + /// /// The results of a web search tool call. See the
/// [web search guide](/docs/guides/tools-web-search) for more information. @@ -96,6 +148,19 @@ namespace tryAGI.OpenAI #endif public bool IsWebSearchCall => WebSearchCall != null; + /// + /// + /// + public bool TryPickWebSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WebSearchToolCall? value) + { + value = WebSearchCall; + return IsWebSearchCall; + } + /// /// An image generation request made by the model. /// @@ -113,6 +178,19 @@ namespace tryAGI.OpenAI #endif public bool IsImageGenerationCall => ImageGenerationCall != null; + /// + /// + /// + public bool TryPickImageGenerationCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ImageGenToolCall? value) + { + value = ImageGenerationCall; + return IsImageGenerationCall; + } + /// /// A tool call to a computer use tool. See the
/// [computer use guide](/docs/guides/tools-computer-use) for more information. @@ -131,6 +209,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerCall => ComputerCall != null; + /// + /// + /// + public bool TryPickComputerCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerToolCall? value) + { + value = ComputerCall; + return IsComputerCall; + } + /// /// /// @@ -148,6 +239,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerToolCallOutputResource => ComputerToolCallOutputResource != null; + /// + /// + /// + public bool TryPickComputerToolCallOutputResource( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerToolCallOutputResource? value) + { + value = ComputerToolCallOutputResource; + return IsComputerToolCallOutputResource; + } + /// /// /// @@ -165,6 +269,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolSearchCall => ToolSearchCall != null; + /// + /// + /// + public bool TryPickToolSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolSearchCall? value) + { + value = ToolSearchCall; + return IsToolSearchCall; + } + /// /// /// @@ -182,6 +299,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolSearchOutput => ToolSearchOutput != null; + /// + /// + /// + public bool TryPickToolSearchOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolSearchOutput? value) + { + value = ToolSearchOutput; + return IsToolSearchOutput; + } + /// /// A description of the chain of thought used by a reasoning model while generating
/// a response. Be sure to include these items in your `input` to the Responses API
@@ -202,6 +332,19 @@ namespace tryAGI.OpenAI #endif public bool IsReasoning => Reasoning != null; + /// + /// + /// + public bool TryPickReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ReasoningItem? value) + { + value = Reasoning; + return IsReasoning; + } + /// /// A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). /// @@ -219,6 +362,19 @@ namespace tryAGI.OpenAI #endif public bool IsCompaction => Compaction != null; + /// + /// + /// + public bool TryPickCompaction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CompactionBody? value) + { + value = Compaction; + return IsCompaction; + } + /// /// A tool call to run code. /// @@ -236,6 +392,19 @@ namespace tryAGI.OpenAI #endif public bool IsCodeInterpreterCall => CodeInterpreterCall != null; + /// + /// + /// + public bool TryPickCodeInterpreterCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CodeInterpreterToolCall? value) + { + value = CodeInterpreterCall; + return IsCodeInterpreterCall; + } + /// /// A tool call to run a command on the local shell. /// @@ -253,6 +422,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocalShellCall => LocalShellCall != null; + /// + /// + /// + public bool TryPickLocalShellCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalShellToolCall? value) + { + value = LocalShellCall; + return IsLocalShellCall; + } + /// /// The output of a local shell tool call. /// @@ -270,6 +452,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocalShellCallOutput => LocalShellCallOutput != null; + /// + /// + /// + public bool TryPickLocalShellCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalShellToolCallOutput? value) + { + value = LocalShellCallOutput; + return IsLocalShellCallOutput; + } + /// /// A tool call that executes one or more shell commands in a managed environment. /// @@ -287,6 +482,19 @@ namespace tryAGI.OpenAI #endif public bool IsShellCall => ShellCall != null; + /// + /// + /// + public bool TryPickShellCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCall? value) + { + value = ShellCall; + return IsShellCall; + } + /// /// The output of a shell tool call that was emitted. /// @@ -304,6 +512,19 @@ namespace tryAGI.OpenAI #endif public bool IsShellCallOutput => ShellCallOutput != null; + /// + /// + /// + public bool TryPickShellCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCallOutput? value) + { + value = ShellCallOutput; + return IsShellCallOutput; + } + /// /// A tool call that applies file diffs by creating, deleting, or updating files. /// @@ -321,6 +542,19 @@ namespace tryAGI.OpenAI #endif public bool IsApplyPatchCall => ApplyPatchCall != null; + /// + /// + /// + public bool TryPickApplyPatchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchToolCall? value) + { + value = ApplyPatchCall; + return IsApplyPatchCall; + } + /// /// The output emitted by an apply patch tool call. /// @@ -338,6 +572,19 @@ namespace tryAGI.OpenAI #endif public bool IsApplyPatchCallOutput => ApplyPatchCallOutput != null; + /// + /// + /// + public bool TryPickApplyPatchCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchToolCallOutput? value) + { + value = ApplyPatchCallOutput; + return IsApplyPatchCallOutput; + } + /// /// A list of tools available on an MCP server. /// @@ -355,6 +602,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpListTools => McpListTools != null; + /// + /// + /// + public bool TryPickMcpListTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPListTools? value) + { + value = McpListTools; + return IsMcpListTools; + } + /// /// A request for human approval of a tool invocation. /// @@ -372,6 +632,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpApprovalRequest => McpApprovalRequest != null; + /// + /// + /// + public bool TryPickMcpApprovalRequest( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPApprovalRequest? value) + { + value = McpApprovalRequest; + return IsMcpApprovalRequest; + } + /// /// A response to an MCP approval request. /// @@ -389,6 +662,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpApprovalResponse => McpApprovalResponse != null; + /// + /// + /// + public bool TryPickMcpApprovalResponse( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPApprovalResponseResource? value) + { + value = McpApprovalResponse; + return IsMcpApprovalResponse; + } + /// /// An invocation of a tool on an MCP server. /// @@ -406,6 +692,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpCall => McpCall != null; + /// + /// + /// + public bool TryPickMcpCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPToolCall? value) + { + value = McpCall; + return IsMcpCall; + } + /// /// A call to a custom tool created by the model. /// @@ -423,6 +722,19 @@ namespace tryAGI.OpenAI #endif public bool IsCustomToolCall => CustomToolCall != null; + /// + /// + /// + public bool TryPickCustomToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCall? value) + { + value = CustomToolCall; + return IsCustomToolCall; + } + /// /// The output of a custom tool call from your code, being sent back to the model. /// @@ -439,6 +751,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomToolCallOutput))] #endif public bool IsCustomToolCallOutput => CustomToolCallOutput != null; + + /// + /// + /// + public bool TryPickCustomToolCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCallOutput? value) + { + value = CustomToolCallOutput; + return IsCustomToolCallOutput; + } /// /// /// @@ -1021,31 +1346,31 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? message = null, + global::System.Func? message = null, global::System.Func? functionToolCallResource = null, global::System.Func? functionToolCallOutputResource = null, - global::System.Func? fileSearchCall = null, - global::System.Func? webSearchCall = null, - global::System.Func? imageGenerationCall = null, - global::System.Func? computerCall = null, + global::System.Func? fileSearchCall = null, + global::System.Func? webSearchCall = null, + global::System.Func? imageGenerationCall = null, + global::System.Func? computerCall = null, global::System.Func? computerToolCallOutputResource = null, - global::System.Func? toolSearchCall = null, - global::System.Func? toolSearchOutput = null, - global::System.Func? reasoning = null, - global::System.Func? compaction = null, - global::System.Func? codeInterpreterCall = null, - global::System.Func? localShellCall = null, - global::System.Func? localShellCallOutput = null, - global::System.Func? shellCall = null, - global::System.Func? shellCallOutput = null, - global::System.Func? applyPatchCall = null, - global::System.Func? applyPatchCallOutput = null, - global::System.Func? mcpListTools = null, - global::System.Func? mcpApprovalRequest = null, - global::System.Func? mcpApprovalResponse = null, - global::System.Func? mcpCall = null, - global::System.Func? customToolCall = null, - global::System.Func? customToolCallOutput = null, + global::System.Func? toolSearchCall = null, + global::System.Func? toolSearchOutput = null, + global::System.Func? reasoning = null, + global::System.Func? compaction = null, + global::System.Func? codeInterpreterCall = null, + global::System.Func? localShellCall = null, + global::System.Func? localShellCallOutput = null, + global::System.Func? shellCall = null, + global::System.Func? shellCallOutput = null, + global::System.Func? applyPatchCall = null, + global::System.Func? applyPatchCallOutput = null, + global::System.Func? mcpListTools = null, + global::System.Func? mcpApprovalRequest = null, + global::System.Func? mcpApprovalResponse = null, + global::System.Func? mcpCall = null, + global::System.Func? customToolCall = null, + global::System.Func? customToolCallOutput = null, bool validate = true) { if (validate) @@ -1161,31 +1486,193 @@ public bool Validate() /// ///
public void Match( - global::System.Action? message = null, + global::System.Action? message = null, + + global::System.Action? functionToolCallResource = null, + + global::System.Action? functionToolCallOutputResource = null, + + global::System.Action? fileSearchCall = null, + + global::System.Action? webSearchCall = null, + + global::System.Action? imageGenerationCall = null, + + global::System.Action? computerCall = null, + + global::System.Action? computerToolCallOutputResource = null, + + global::System.Action? toolSearchCall = null, + + global::System.Action? toolSearchOutput = null, + + global::System.Action? reasoning = null, + + global::System.Action? compaction = null, + + global::System.Action? codeInterpreterCall = null, + + global::System.Action? localShellCall = null, + + global::System.Action? localShellCallOutput = null, + + global::System.Action? shellCall = null, + + global::System.Action? shellCallOutput = null, + + global::System.Action? applyPatchCall = null, + + global::System.Action? applyPatchCallOutput = null, + + global::System.Action? mcpListTools = null, + + global::System.Action? mcpApprovalRequest = null, + + global::System.Action? mcpApprovalResponse = null, + + global::System.Action? mcpCall = null, + + global::System.Action? customToolCall = null, + + global::System.Action? customToolCallOutput = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMessage) + { + message?.Invoke(Message!); + } + else if (IsFunctionToolCallResource) + { + functionToolCallResource?.Invoke(FunctionToolCallResource!); + } + else if (IsFunctionToolCallOutputResource) + { + functionToolCallOutputResource?.Invoke(FunctionToolCallOutputResource!); + } + else if (IsFileSearchCall) + { + fileSearchCall?.Invoke(FileSearchCall!); + } + else if (IsWebSearchCall) + { + webSearchCall?.Invoke(WebSearchCall!); + } + else if (IsImageGenerationCall) + { + imageGenerationCall?.Invoke(ImageGenerationCall!); + } + else if (IsComputerCall) + { + computerCall?.Invoke(ComputerCall!); + } + else if (IsComputerToolCallOutputResource) + { + computerToolCallOutputResource?.Invoke(ComputerToolCallOutputResource!); + } + else if (IsToolSearchCall) + { + toolSearchCall?.Invoke(ToolSearchCall!); + } + else if (IsToolSearchOutput) + { + toolSearchOutput?.Invoke(ToolSearchOutput!); + } + else if (IsReasoning) + { + reasoning?.Invoke(Reasoning!); + } + else if (IsCompaction) + { + compaction?.Invoke(Compaction!); + } + else if (IsCodeInterpreterCall) + { + codeInterpreterCall?.Invoke(CodeInterpreterCall!); + } + else if (IsLocalShellCall) + { + localShellCall?.Invoke(LocalShellCall!); + } + else if (IsLocalShellCallOutput) + { + localShellCallOutput?.Invoke(LocalShellCallOutput!); + } + else if (IsShellCall) + { + shellCall?.Invoke(ShellCall!); + } + else if (IsShellCallOutput) + { + shellCallOutput?.Invoke(ShellCallOutput!); + } + else if (IsApplyPatchCall) + { + applyPatchCall?.Invoke(ApplyPatchCall!); + } + else if (IsApplyPatchCallOutput) + { + applyPatchCallOutput?.Invoke(ApplyPatchCallOutput!); + } + else if (IsMcpListTools) + { + mcpListTools?.Invoke(McpListTools!); + } + else if (IsMcpApprovalRequest) + { + mcpApprovalRequest?.Invoke(McpApprovalRequest!); + } + else if (IsMcpApprovalResponse) + { + mcpApprovalResponse?.Invoke(McpApprovalResponse!); + } + else if (IsMcpCall) + { + mcpCall?.Invoke(McpCall!); + } + else if (IsCustomToolCall) + { + customToolCall?.Invoke(CustomToolCall!); + } + else if (IsCustomToolCallOutput) + { + customToolCallOutput?.Invoke(CustomToolCallOutput!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? message = null, global::System.Action? functionToolCallResource = null, global::System.Action? functionToolCallOutputResource = null, - global::System.Action? fileSearchCall = null, - global::System.Action? webSearchCall = null, - global::System.Action? imageGenerationCall = null, - global::System.Action? computerCall = null, + global::System.Action? fileSearchCall = null, + global::System.Action? webSearchCall = null, + global::System.Action? imageGenerationCall = null, + global::System.Action? computerCall = null, global::System.Action? computerToolCallOutputResource = null, - global::System.Action? toolSearchCall = null, - global::System.Action? toolSearchOutput = null, - global::System.Action? reasoning = null, - global::System.Action? compaction = null, - global::System.Action? codeInterpreterCall = null, - global::System.Action? localShellCall = null, - global::System.Action? localShellCallOutput = null, - global::System.Action? shellCall = null, - global::System.Action? shellCallOutput = null, - global::System.Action? applyPatchCall = null, - global::System.Action? applyPatchCallOutput = null, - global::System.Action? mcpListTools = null, - global::System.Action? mcpApprovalRequest = null, - global::System.Action? mcpApprovalResponse = null, - global::System.Action? mcpCall = null, - global::System.Action? customToolCall = null, - global::System.Action? customToolCallOutput = null, + global::System.Action? toolSearchCall = null, + global::System.Action? toolSearchOutput = null, + global::System.Action? reasoning = null, + global::System.Action? compaction = null, + global::System.Action? codeInterpreterCall = null, + global::System.Action? localShellCall = null, + global::System.Action? localShellCallOutput = null, + global::System.Action? shellCall = null, + global::System.Action? shellCallOutput = null, + global::System.Action? applyPatchCall = null, + global::System.Action? applyPatchCallOutput = null, + global::System.Action? mcpListTools = null, + global::System.Action? mcpApprovalRequest = null, + global::System.Action? mcpApprovalResponse = null, + global::System.Action? mcpCall = null, + global::System.Action? customToolCall = null, + global::System.Action? customToolCallOutput = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ConversationParam.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ConversationParam.g.cs index c10768cd..a5e9cb6a 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ConversationParam.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ConversationParam.g.cs @@ -28,6 +28,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationId => ConversationId != null; + /// + /// + /// + public bool TryPickConversationId( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = ConversationId; + return IsConversationId; + } + /// /// The conversation that this response belongs to. /// @@ -44,6 +57,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ConversationObject))] #endif public bool IsConversationObject => ConversationObject != null; + + /// + /// + /// + public bool TryPickConversationObject( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ConversationParam2? value) + { + value = ConversationObject; + return IsConversationObject; + } /// /// /// @@ -120,8 +146,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? conversationId = null, - global::System.Func? conversationObject = null, + global::System.Func? conversationId = null, + global::System.Func? conversationObject = null, bool validate = true) { if (validate) @@ -145,8 +171,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? conversationId = null, - global::System.Action? conversationObject = null, + global::System.Action? conversationId = null, + + global::System.Action? conversationObject = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsConversationId) + { + conversationId?.Invoke(ConversationId!); + } + else if (IsConversationObject) + { + conversationObject?.Invoke(ConversationObject!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? conversationId = null, + global::System.Action? conversationObject = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateChatCompletionRequest.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateChatCompletionRequest.g.cs index e1374f08..e5afab0a 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateChatCompletionRequest.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateChatCompletionRequest.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsModelResponseProperties => ModelResponseProperties != null; + /// + /// + /// + public bool TryPickModelResponseProperties( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CreateModelResponseProperties? value) + { + value = ModelResponseProperties; + return IsModelResponseProperties; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CreateChatCompletionRequestVariant2))] #endif public bool IsCreateChatCompletionRequestVariant2 => CreateChatCompletionRequestVariant2 != null; + + /// + /// + /// + public bool TryPickCreateChatCompletionRequestVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CreateChatCompletionRequestVariant2? value) + { + value = CreateChatCompletionRequestVariant2; + return IsCreateChatCompletionRequestVariant2; + } /// /// /// @@ -119,7 +145,7 @@ public bool Validate() /// public TResult? Match( global::System.Func? modelResponseProperties = null, - global::System.Func? createChatCompletionRequestVariant2 = null, + global::System.Func? createChatCompletionRequestVariant2 = null, bool validate = true) { if (validate) @@ -144,7 +170,31 @@ public bool Validate() /// public void Match( global::System.Action? modelResponseProperties = null, - global::System.Action? createChatCompletionRequestVariant2 = null, + + global::System.Action? createChatCompletionRequestVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsModelResponseProperties) + { + modelResponseProperties?.Invoke(ModelResponseProperties!); + } + else if (IsCreateChatCompletionRequestVariant2) + { + createChatCompletionRequestVariant2?.Invoke(CreateChatCompletionRequestVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? modelResponseProperties = null, + global::System.Action? createChatCompletionRequestVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateEvalItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateEvalItem.g.cs index 944de991..fc1796d7 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateEvalItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateEvalItem.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsSimpleInputMessage => SimpleInputMessage != null; + /// + /// + /// + public bool TryPickSimpleInputMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CreateEvalItemSimpleInputMessage? value) + { + value = SimpleInputMessage; + return IsSimpleInputMessage; + } + /// /// A message input to the model with a role indicating instruction following
/// hierarchy. Instructions given with the `developer` or `system` role take
@@ -46,6 +59,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(EvalMessageObject))] #endif public bool IsEvalMessageObject => EvalMessageObject != null; + + /// + /// + /// + public bool TryPickEvalMessageObject( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.EvalItem? value) + { + value = EvalMessageObject; + return IsEvalMessageObject; + } /// /// /// @@ -122,8 +148,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? simpleInputMessage = null, - global::System.Func? evalMessageObject = null, + global::System.Func? simpleInputMessage = null, + global::System.Func? evalMessageObject = null, bool validate = true) { if (validate) @@ -147,8 +173,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? simpleInputMessage = null, - global::System.Action? evalMessageObject = null, + global::System.Action? simpleInputMessage = null, + + global::System.Action? evalMessageObject = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSimpleInputMessage) + { + simpleInputMessage?.Invoke(SimpleInputMessage!); + } + else if (IsEvalMessageObject) + { + evalMessageObject?.Invoke(EvalMessageObject!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? simpleInputMessage = null, + global::System.Action? evalMessageObject = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateModelResponseProperties.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateModelResponseProperties.g.cs index 53900540..8a826727 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateModelResponseProperties.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateModelResponseProperties.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsModelResponseProperties => ModelResponseProperties != null; + /// + /// + /// + public bool TryPickModelResponseProperties( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ModelResponseProperties? value) + { + value = ModelResponseProperties; + return IsModelResponseProperties; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CreateModelResponsePropertiesVariant2))] #endif public bool IsCreateModelResponsePropertiesVariant2 => CreateModelResponsePropertiesVariant2 != null; + + /// + /// + /// + public bool TryPickCreateModelResponsePropertiesVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CreateModelResponsePropertiesVariant2? value) + { + value = CreateModelResponsePropertiesVariant2; + return IsCreateModelResponsePropertiesVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? modelResponseProperties = null, - global::System.Func? createModelResponsePropertiesVariant2 = null, + global::System.Func? modelResponseProperties = null, + global::System.Func? createModelResponsePropertiesVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? modelResponseProperties = null, - global::System.Action? createModelResponsePropertiesVariant2 = null, + global::System.Action? modelResponseProperties = null, + + global::System.Action? createModelResponsePropertiesVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsModelResponseProperties) + { + modelResponseProperties?.Invoke(ModelResponseProperties!); + } + else if (IsCreateModelResponsePropertiesVariant2) + { + createModelResponsePropertiesVariant2?.Invoke(CreateModelResponsePropertiesVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? modelResponseProperties = null, + global::System.Action? createModelResponsePropertiesVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateResponse.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateResponse.g.cs index 7e3b8de3..a1c583cb 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateResponse.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateResponse.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsModelProperties => ModelProperties != null; + /// + /// + /// + public bool TryPickModelProperties( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CreateModelResponseProperties? value) + { + value = ModelProperties; + return IsModelProperties; + } + /// /// /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsProperties => Properties != null; + /// + /// + /// + public bool TryPickProperties( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseProperties? value) + { + value = Properties; + return IsProperties; + } + /// /// /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CreateResponseVariant3))] #endif public bool IsCreateResponseVariant3 => CreateResponseVariant3 != null; + + /// + /// + /// + public bool TryPickCreateResponseVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CreateResponseVariant3? value) + { + value = CreateResponseVariant3; + return IsCreateResponseVariant3; + } /// /// /// @@ -158,8 +197,8 @@ public bool Validate() /// public TResult? Match( global::System.Func? modelProperties = null, - global::System.Func? properties = null, - global::System.Func? createResponseVariant3 = null, + global::System.Func? properties = null, + global::System.Func? createResponseVariant3 = null, bool validate = true) { if (validate) @@ -188,8 +227,38 @@ public bool Validate() /// public void Match( global::System.Action? modelProperties = null, - global::System.Action? properties = null, - global::System.Action? createResponseVariant3 = null, + + global::System.Action? properties = null, + + global::System.Action? createResponseVariant3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsModelProperties) + { + modelProperties?.Invoke(ModelProperties!); + } + else if (IsProperties) + { + properties?.Invoke(Properties!); + } + else if (IsCreateResponseVariant3) + { + createResponseVariant3?.Invoke(CreateResponseVariant3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? modelProperties = null, + global::System.Action? properties = null, + global::System.Action? createResponseVariant3 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateSpeechResponseStreamEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateSpeechResponseStreamEvent.g.cs index 36a6cb75..f5f324ac 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateSpeechResponseStreamEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateSpeechResponseStreamEvent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsSpeechAudioDelta => SpeechAudioDelta != null; + /// + /// + /// + public bool TryPickSpeechAudioDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.SpeechAudioDeltaEvent? value) + { + value = SpeechAudioDelta; + return IsSpeechAudioDelta; + } + /// /// Emitted when the speech synthesis is complete and all audio has been streamed. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SpeechAudioDone))] #endif public bool IsSpeechAudioDone => SpeechAudioDone != null; + + /// + /// + /// + public bool TryPickSpeechAudioDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.SpeechAudioDoneEvent? value) + { + value = SpeechAudioDone; + return IsSpeechAudioDone; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? speechAudioDelta = null, - global::System.Func? speechAudioDone = null, + global::System.Func? speechAudioDelta = null, + global::System.Func? speechAudioDone = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? speechAudioDelta = null, - global::System.Action? speechAudioDone = null, + global::System.Action? speechAudioDelta = null, + + global::System.Action? speechAudioDone = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSpeechAudioDelta) + { + speechAudioDelta?.Invoke(SpeechAudioDelta!); + } + else if (IsSpeechAudioDone) + { + speechAudioDone?.Invoke(SpeechAudioDone!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? speechAudioDelta = null, + global::System.Action? speechAudioDone = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateTranscriptionResponseDiarizedJsonUsage.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateTranscriptionResponseDiarizedJsonUsage.g.cs index 8183d674..3c8fe9a4 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateTranscriptionResponseDiarizedJsonUsage.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateTranscriptionResponseDiarizedJsonUsage.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsTokens => Tokens != null; + /// + /// + /// + public bool TryPickTokens( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.TranscriptTextUsageTokens? value) + { + value = Tokens; + return IsTokens; + } + /// /// Usage statistics for models billed by audio input duration. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Duration))] #endif public bool IsDuration => Duration != null; + + /// + /// + /// + public bool TryPickDuration( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.TranscriptTextUsageDuration? value) + { + value = Duration; + return IsDuration; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? tokens = null, - global::System.Func? duration = null, + global::System.Func? tokens = null, + global::System.Func? duration = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? tokens = null, - global::System.Action? duration = null, + global::System.Action? tokens = null, + + global::System.Action? duration = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTokens) + { + tokens?.Invoke(Tokens!); + } + else if (IsDuration) + { + duration?.Invoke(Duration!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? tokens = null, + global::System.Action? duration = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateTranscriptionResponseStreamEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateTranscriptionResponseStreamEvent.g.cs index 7ff47235..9089f747 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateTranscriptionResponseStreamEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateTranscriptionResponseStreamEvent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsTranscriptTextSegment => TranscriptTextSegment != null; + /// + /// + /// + public bool TryPickTranscriptTextSegment( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.TranscriptTextSegmentEvent? value) + { + value = TranscriptTextSegment; + return IsTranscriptTextSegment; + } + /// /// Emitted when there is an additional text delta. This is also the first event emitted when the transcription starts. Only emitted when you [create a transcription](/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsTranscriptTextDelta => TranscriptTextDelta != null; + /// + /// + /// + public bool TryPickTranscriptTextDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.TranscriptTextDeltaEvent? value) + { + value = TranscriptTextDelta; + return IsTranscriptTextDelta; + } + /// /// Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TranscriptTextDone))] #endif public bool IsTranscriptTextDone => TranscriptTextDone != null; + + /// + /// + /// + public bool TryPickTranscriptTextDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.TranscriptTextDoneEvent? value) + { + value = TranscriptTextDone; + return IsTranscriptTextDone; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? transcriptTextSegment = null, - global::System.Func? transcriptTextDelta = null, - global::System.Func? transcriptTextDone = null, + global::System.Func? transcriptTextSegment = null, + global::System.Func? transcriptTextDelta = null, + global::System.Func? transcriptTextDone = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? transcriptTextSegment = null, - global::System.Action? transcriptTextDelta = null, - global::System.Action? transcriptTextDone = null, + global::System.Action? transcriptTextSegment = null, + + global::System.Action? transcriptTextDelta = null, + + global::System.Action? transcriptTextDone = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTranscriptTextSegment) + { + transcriptTextSegment?.Invoke(TranscriptTextSegment!); + } + else if (IsTranscriptTextDelta) + { + transcriptTextDelta?.Invoke(TranscriptTextDelta!); + } + else if (IsTranscriptTextDone) + { + transcriptTextDone?.Invoke(TranscriptTextDone!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? transcriptTextSegment = null, + global::System.Action? transcriptTextDelta = null, + global::System.Action? transcriptTextDone = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CustomToolCallOutputResource.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CustomToolCallOutputResource.g.cs index 9562f9e5..71e6bea7 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CustomToolCallOutputResource.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CustomToolCallOutputResource.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsCustomToolCallOutput => CustomToolCallOutput != null; + /// + /// + /// + public bool TryPickCustomToolCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCallOutput? value) + { + value = CustomToolCallOutput; + return IsCustomToolCallOutput; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomToolCallOutputResourceVariant2))] #endif public bool IsCustomToolCallOutputResourceVariant2 => CustomToolCallOutputResourceVariant2 != null; + + /// + /// + /// + public bool TryPickCustomToolCallOutputResourceVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCallOutputResourceVariant2? value) + { + value = CustomToolCallOutputResourceVariant2; + return IsCustomToolCallOutputResourceVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? customToolCallOutput = null, - global::System.Func? customToolCallOutputResourceVariant2 = null, + global::System.Func? customToolCallOutput = null, + global::System.Func? customToolCallOutputResourceVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? customToolCallOutput = null, - global::System.Action? customToolCallOutputResourceVariant2 = null, + global::System.Action? customToolCallOutput = null, + + global::System.Action? customToolCallOutputResourceVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCustomToolCallOutput) + { + customToolCallOutput?.Invoke(CustomToolCallOutput!); + } + else if (IsCustomToolCallOutputResourceVariant2) + { + customToolCallOutputResourceVariant2?.Invoke(CustomToolCallOutputResourceVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? customToolCallOutput = null, + global::System.Action? customToolCallOutputResourceVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CustomToolCallResource.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CustomToolCallResource.g.cs index 0cbe21e1..f221abef 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CustomToolCallResource.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CustomToolCallResource.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsCustomToolCall => CustomToolCall != null; + /// + /// + /// + public bool TryPickCustomToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCall? value) + { + value = CustomToolCall; + return IsCustomToolCall; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomToolCallResourceVariant2))] #endif public bool IsCustomToolCallResourceVariant2 => CustomToolCallResourceVariant2 != null; + + /// + /// + /// + public bool TryPickCustomToolCallResourceVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCallResourceVariant2? value) + { + value = CustomToolCallResourceVariant2; + return IsCustomToolCallResourceVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? customToolCall = null, - global::System.Func? customToolCallResourceVariant2 = null, + global::System.Func? customToolCall = null, + global::System.Func? customToolCallResourceVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? customToolCall = null, - global::System.Action? customToolCallResourceVariant2 = null, + global::System.Action? customToolCall = null, + + global::System.Action? customToolCallResourceVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCustomToolCall) + { + customToolCall?.Invoke(CustomToolCall!); + } + else if (IsCustomToolCallResourceVariant2) + { + customToolCallResourceVariant2?.Invoke(CustomToolCallResourceVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? customToolCall = null, + global::System.Action? customToolCallResourceVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.DeletedConversation.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.DeletedConversation.g.cs index 978edda6..35b5d96c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.DeletedConversation.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.DeletedConversation.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Resource))] #endif public bool IsResource => Resource != null; + + /// + /// + /// + public bool TryPickResource( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.DeletedConversationResource? value) + { + value = Resource; + return IsResource; + } /// /// /// @@ -69,7 +82,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? resource = null, + global::System.Func? resource = null, bool validate = true) { if (validate) @@ -89,7 +102,25 @@ public bool Validate() /// /// public void Match( - global::System.Action? resource = null, + global::System.Action? resource = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsResource) + { + resource?.Invoke(Resource!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? resource = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant1.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant1.g.cs index 0b0d4e95..fc500a10 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant1.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant1.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsContainerAuto => ContainerAuto != null; + /// + /// + /// + public bool TryPickContainerAuto( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ContainerAutoParam? value) + { + value = ContainerAuto; + return IsContainerAuto; + } + /// /// /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocal => Local != null; + /// + /// + /// + public bool TryPickLocal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalEnvironmentParam? value) + { + value = Local; + return IsLocal; + } + /// /// /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ContainerReference))] #endif public bool IsContainerReference => ContainerReference != null; + + /// + /// + /// + public bool TryPickContainerReference( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ContainerReferenceParam? value) + { + value = ContainerReference; + return IsContainerReference; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? containerAuto = null, - global::System.Func? local = null, - global::System.Func? containerReference = null, + global::System.Func? containerAuto = null, + global::System.Func? local = null, + global::System.Func? containerReference = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? containerAuto = null, - global::System.Action? local = null, - global::System.Action? containerReference = null, + global::System.Action? containerAuto = null, + + global::System.Action? local = null, + + global::System.Action? containerReference = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsContainerAuto) + { + containerAuto?.Invoke(ContainerAuto!); + } + else if (IsLocal) + { + local?.Invoke(Local!); + } + else if (IsContainerReference) + { + containerReference?.Invoke(ContainerReference!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? containerAuto = null, + global::System.Action? local = null, + global::System.Action? containerReference = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant12.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant12.g.cs index b875a3e6..93b258b9 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant12.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant12.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocal => Local != null; + /// + /// + /// + public bool TryPickLocal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalEnvironmentResource? value) + { + value = Local; + return IsLocal; + } + /// /// Represents a container created with /v1/containers. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ContainerReference))] #endif public bool IsContainerReference => ContainerReference != null; + + /// + /// + /// + public bool TryPickContainerReference( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ContainerReferenceResource? value) + { + value = ContainerReference; + return IsContainerReference; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? local = null, - global::System.Func? containerReference = null, + global::System.Func? local = null, + global::System.Func? containerReference = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? local = null, - global::System.Action? containerReference = null, + global::System.Action? local = null, + + global::System.Action? containerReference = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsLocal) + { + local?.Invoke(Local!); + } + else if (IsContainerReference) + { + containerReference?.Invoke(ContainerReference!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? local = null, + global::System.Action? containerReference = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant13.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant13.g.cs index 3a13099a..fde2cfb6 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant13.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EnvironmentVariant13.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocal => Local != null; + /// + /// + /// + public bool TryPickLocal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalEnvironmentParam? value) + { + value = Local; + return IsLocal; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ContainerReference))] #endif public bool IsContainerReference => ContainerReference != null; + + /// + /// + /// + public bool TryPickContainerReference( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ContainerReferenceParam? value) + { + value = ContainerReference; + return IsContainerReference; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? local = null, - global::System.Func? containerReference = null, + global::System.Func? local = null, + global::System.Func? containerReference = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? local = null, - global::System.Action? containerReference = null, + global::System.Action? local = null, + + global::System.Action? containerReference = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsLocal) + { + local?.Invoke(Local!); + } + else if (IsContainerReference) + { + containerReference?.Invoke(ContainerReference!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? local = null, + global::System.Action? containerReference = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderLabelModel.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderLabelModel.g.cs index ca9b9622..c5cdf534 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderLabelModel.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderLabelModel.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(LabelModelGrader))] #endif public bool IsLabelModelGrader => LabelModelGrader != null; + + /// + /// + /// + public bool TryPickLabelModelGrader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.GraderLabelModel? value) + { + value = LabelModelGrader; + return IsLabelModelGrader; + } /// /// /// @@ -70,7 +83,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? labelModelGrader = null, + global::System.Func? labelModelGrader = null, bool validate = true) { if (validate) @@ -90,7 +103,25 @@ public bool Validate() /// /// public void Match( - global::System.Action? labelModelGrader = null, + global::System.Action? labelModelGrader = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsLabelModelGrader) + { + labelModelGrader?.Invoke(LabelModelGrader!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? labelModelGrader = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderPython.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderPython.g.cs index adfdc449..554d0fcd 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderPython.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderPython.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsPythonGrader => PythonGrader != null; + /// + /// + /// + public bool TryPickPythonGrader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.GraderPython? value) + { + value = PythonGrader; + return IsPythonGrader; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(EvalGraderPythonVariant2))] #endif public bool IsEvalGraderPythonVariant2 => EvalGraderPythonVariant2 != null; + + /// + /// + /// + public bool TryPickEvalGraderPythonVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.EvalGraderPythonVariant2? value) + { + value = EvalGraderPythonVariant2; + return IsEvalGraderPythonVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? pythonGrader = null, - global::System.Func? evalGraderPythonVariant2 = null, + global::System.Func? pythonGrader = null, + global::System.Func? evalGraderPythonVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? pythonGrader = null, - global::System.Action? evalGraderPythonVariant2 = null, + global::System.Action? pythonGrader = null, + + global::System.Action? evalGraderPythonVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsPythonGrader) + { + pythonGrader?.Invoke(PythonGrader!); + } + else if (IsEvalGraderPythonVariant2) + { + evalGraderPythonVariant2?.Invoke(EvalGraderPythonVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? pythonGrader = null, + global::System.Action? evalGraderPythonVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderScoreModel.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderScoreModel.g.cs index f70a20a9..cd88e720 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderScoreModel.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderScoreModel.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsScoreModelGrader => ScoreModelGrader != null; + /// + /// + /// + public bool TryPickScoreModelGrader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.GraderScoreModel? value) + { + value = ScoreModelGrader; + return IsScoreModelGrader; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(EvalGraderScoreModelVariant2))] #endif public bool IsEvalGraderScoreModelVariant2 => EvalGraderScoreModelVariant2 != null; + + /// + /// + /// + public bool TryPickEvalGraderScoreModelVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.EvalGraderScoreModelVariant2? value) + { + value = EvalGraderScoreModelVariant2; + return IsEvalGraderScoreModelVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? scoreModelGrader = null, - global::System.Func? evalGraderScoreModelVariant2 = null, + global::System.Func? scoreModelGrader = null, + global::System.Func? evalGraderScoreModelVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? scoreModelGrader = null, - global::System.Action? evalGraderScoreModelVariant2 = null, + global::System.Action? scoreModelGrader = null, + + global::System.Action? evalGraderScoreModelVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsScoreModelGrader) + { + scoreModelGrader?.Invoke(ScoreModelGrader!); + } + else if (IsEvalGraderScoreModelVariant2) + { + evalGraderScoreModelVariant2?.Invoke(EvalGraderScoreModelVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? scoreModelGrader = null, + global::System.Action? evalGraderScoreModelVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderStringCheck.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderStringCheck.g.cs index 496bb1aa..1c802726 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderStringCheck.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderStringCheck.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(StringCheckGrader))] #endif public bool IsStringCheckGrader => StringCheckGrader != null; + + /// + /// + /// + public bool TryPickStringCheckGrader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.GraderStringCheck? value) + { + value = StringCheckGrader; + return IsStringCheckGrader; + } /// /// /// @@ -69,7 +82,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? stringCheckGrader = null, + global::System.Func? stringCheckGrader = null, bool validate = true) { if (validate) @@ -89,7 +102,25 @@ public bool Validate() /// /// public void Match( - global::System.Action? stringCheckGrader = null, + global::System.Action? stringCheckGrader = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsStringCheckGrader) + { + stringCheckGrader?.Invoke(StringCheckGrader!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? stringCheckGrader = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderTextSimilarity.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderTextSimilarity.g.cs index 5eb493a8..44b407d8 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderTextSimilarity.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalGraderTextSimilarity.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsTextSimilarityGrader => TextSimilarityGrader != null; + /// + /// + /// + public bool TryPickTextSimilarityGrader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.GraderTextSimilarity? value) + { + value = TextSimilarityGrader; + return IsTextSimilarityGrader; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(EvalGraderTextSimilarityVariant2))] #endif public bool IsEvalGraderTextSimilarityVariant2 => EvalGraderTextSimilarityVariant2 != null; + + /// + /// + /// + public bool TryPickEvalGraderTextSimilarityVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.EvalGraderTextSimilarityVariant2? value) + { + value = EvalGraderTextSimilarityVariant2; + return IsEvalGraderTextSimilarityVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? textSimilarityGrader = null, - global::System.Func? evalGraderTextSimilarityVariant2 = null, + global::System.Func? textSimilarityGrader = null, + global::System.Func? evalGraderTextSimilarityVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? textSimilarityGrader = null, - global::System.Action? evalGraderTextSimilarityVariant2 = null, + global::System.Action? textSimilarityGrader = null, + + global::System.Action? evalGraderTextSimilarityVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTextSimilarityGrader) + { + textSimilarityGrader?.Invoke(TextSimilarityGrader!); + } + else if (IsEvalGraderTextSimilarityVariant2) + { + evalGraderTextSimilarityVariant2?.Invoke(EvalGraderTextSimilarityVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? textSimilarityGrader = null, + global::System.Action? evalGraderTextSimilarityVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalItemContent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalItemContent.g.cs index 8d74cf7a..247e0710 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalItemContent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalItemContent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsEvalContentItem => EvalContentItem != null; + /// + /// + /// + public bool TryPickEvalContentItem( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.EvalItemContentItem? value) + { + value = EvalContentItem; + return IsEvalContentItem; + } + /// /// A list of inputs, each of which may be either an input text, output text, input
/// image, or input audio object. @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AnArrayOfInputTextOutputTextInputImageAndInputAudio))] #endif public bool IsAnArrayOfInputTextOutputTextInputImageAndInputAudio => AnArrayOfInputTextOutputTextInputImageAndInputAudio != null; + + /// + /// + /// + public bool TryPickAnArrayOfInputTextOutputTextInputImageAndInputAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = AnArrayOfInputTextOutputTextInputImageAndInputAudio; + return IsAnArrayOfInputTextOutputTextInputImageAndInputAudio; + } /// /// /// @@ -102,7 +128,7 @@ public bool Validate() ///
public TResult? Match( global::System.Func? evalContentItem = null, - global::System.Func?, TResult>? anArrayOfInputTextOutputTextInputImageAndInputAudio = null, + global::System.Func, TResult>? anArrayOfInputTextOutputTextInputImageAndInputAudio = null, bool validate = true) { if (validate) @@ -127,7 +153,31 @@ public bool Validate() /// public void Match( global::System.Action? evalContentItem = null, - global::System.Action?>? anArrayOfInputTextOutputTextInputImageAndInputAudio = null, + + global::System.Action>? anArrayOfInputTextOutputTextInputImageAndInputAudio = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsEvalContentItem) + { + evalContentItem?.Invoke(EvalContentItem!); + } + else if (IsAnArrayOfInputTextOutputTextInputImageAndInputAudio) + { + anArrayOfInputTextOutputTextInputImageAndInputAudio?.Invoke(AnArrayOfInputTextOutputTextInputImageAndInputAudio!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? evalContentItem = null, + global::System.Action>? anArrayOfInputTextOutputTextInputImageAndInputAudio = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalItemContentItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalItemContentItem.g.cs index 4c6bb7e1..7f4a3b50 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalItemContentItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.EvalItemContentItem.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsTextInput => TextInput != null; + /// + /// + /// + public bool TryPickTextInput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = TextInput; + return IsTextInput; + } + /// /// A text input to the model. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputText => InputText != null; + /// + /// + /// + public bool TryPickInputText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputTextContent? value) + { + value = InputText; + return IsInputText; + } + /// /// A text output from the model. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsOutputText => OutputText != null; + /// + /// + /// + public bool TryPickOutputText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.EvalItemContentOutputText? value) + { + value = OutputText; + return IsOutputText; + } + /// /// An image input block used within EvalItem content arrays. /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputImage => InputImage != null; + /// + /// + /// + public bool TryPickInputImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.EvalItemInputImage? value) + { + value = InputImage; + return IsInputImage; + } + /// /// An audio input to the model. /// @@ -93,6 +145,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InputAudio))] #endif public bool IsInputAudio => InputAudio != null; + + /// + /// + /// + public bool TryPickInputAudio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputAudio? value) + { + value = InputAudio; + return IsInputAudio; + } /// /// /// @@ -235,11 +300,11 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? textInput = null, - global::System.Func? inputText = null, - global::System.Func? outputText = null, - global::System.Func? inputImage = null, - global::System.Func? inputAudio = null, + global::System.Func? textInput = null, + global::System.Func? inputText = null, + global::System.Func? outputText = null, + global::System.Func? inputImage = null, + global::System.Func? inputAudio = null, bool validate = true) { if (validate) @@ -275,11 +340,53 @@ public bool Validate() /// /// public void Match( - global::System.Action? textInput = null, - global::System.Action? inputText = null, - global::System.Action? outputText = null, - global::System.Action? inputImage = null, - global::System.Action? inputAudio = null, + global::System.Action? textInput = null, + + global::System.Action? inputText = null, + + global::System.Action? outputText = null, + + global::System.Action? inputImage = null, + + global::System.Action? inputAudio = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTextInput) + { + textInput?.Invoke(TextInput!); + } + else if (IsInputText) + { + inputText?.Invoke(InputText!); + } + else if (IsOutputText) + { + outputText?.Invoke(OutputText!); + } + else if (IsInputImage) + { + inputImage?.Invoke(InputImage!); + } + else if (IsInputAudio) + { + inputAudio?.Invoke(InputAudio!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? textInput = null, + global::System.Action? inputText = null, + global::System.Action? outputText = null, + global::System.Action? inputImage = null, + global::System.Action? inputAudio = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Filters2.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Filters2.g.cs index 7ab89670..c85f5623 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Filters2.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Filters2.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsComparisonFilter => ComparisonFilter != null; + /// + /// + /// + public bool TryPickComparisonFilter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComparisonFilter? value) + { + value = ComparisonFilter; + return IsComparisonFilter; + } + /// /// Combine multiple filters using `and` or `or`. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CompoundFilter))] #endif public bool IsCompoundFilter => CompoundFilter != null; + + /// + /// + /// + public bool TryPickCompoundFilter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CompoundFilter? value) + { + value = CompoundFilter; + return IsCompoundFilter; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? comparisonFilter = null, - global::System.Func? compoundFilter = null, + global::System.Func? comparisonFilter = null, + global::System.Func? compoundFilter = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? comparisonFilter = null, - global::System.Action? compoundFilter = null, + global::System.Action? comparisonFilter = null, + + global::System.Action? compoundFilter = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsComparisonFilter) + { + comparisonFilter?.Invoke(ComparisonFilter!); + } + else if (IsCompoundFilter) + { + compoundFilter?.Invoke(CompoundFilter!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? comparisonFilter = null, + global::System.Action? compoundFilter = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FiltersItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FiltersItem.g.cs index 610f6071..64468291 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FiltersItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FiltersItem.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsComparisonFilter => ComparisonFilter != null; + /// + /// + /// + public bool TryPickComparisonFilter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComparisonFilter? value) + { + value = ComparisonFilter; + return IsComparisonFilter; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CompoundFilterVariant2))] #endif public bool IsCompoundFilterVariant2 => CompoundFilterVariant2 != null; + + /// + /// + /// + public bool TryPickCompoundFilterVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = CompoundFilterVariant2; + return IsCompoundFilterVariant2; + } /// /// /// @@ -100,8 +126,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? comparisonFilter = null, - global::System.Func? compoundFilterVariant2 = null, + global::System.Func? comparisonFilter = null, + global::System.Func? compoundFilterVariant2 = null, bool validate = true) { if (validate) @@ -125,8 +151,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? comparisonFilter = null, - global::System.Action? compoundFilterVariant2 = null, + global::System.Action? comparisonFilter = null, + + global::System.Action? compoundFilterVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsComparisonFilter) + { + comparisonFilter?.Invoke(ComparisonFilter!); + } + else if (IsCompoundFilterVariant2) + { + compoundFilterVariant2?.Invoke(CompoundFilterVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? comparisonFilter = null, + global::System.Action? compoundFilterVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FineTuneChatCompletionRequestAssistantMessage.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FineTuneChatCompletionRequestAssistantMessage.g.cs index 37a3c9c6..3be74f28 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FineTuneChatCompletionRequestAssistantMessage.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FineTuneChatCompletionRequestAssistantMessage.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsAssistantMessage1 => AssistantMessage1 != null; + /// + /// + /// + public bool TryPickAssistantMessage1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FineTuneChatCompletionRequestAssistantMessageAssistantMessage? value) + { + value = AssistantMessage1; + return IsAssistantMessage1; + } + /// /// Messages sent by the model in response to user messages. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AssistantMessage2))] #endif public bool IsAssistantMessage2 => AssistantMessage2 != null; + + /// + /// + /// + public bool TryPickAssistantMessage2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ChatCompletionRequestAssistantMessage? value) + { + value = AssistantMessage2; + return IsAssistantMessage2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? assistantMessage1 = null, - global::System.Func? assistantMessage2 = null, + global::System.Func? assistantMessage1 = null, + global::System.Func? assistantMessage2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? assistantMessage1 = null, - global::System.Action? assistantMessage2 = null, + global::System.Action? assistantMessage1 = null, + + global::System.Action? assistantMessage2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAssistantMessage1) + { + assistantMessage1?.Invoke(AssistantMessage1!); + } + else if (IsAssistantMessage2) + { + assistantMessage2?.Invoke(AssistantMessage2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? assistantMessage1 = null, + global::System.Action? assistantMessage2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Format2.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Format2.g.cs index 68dd94fd..ac2dcb89 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Format2.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Format2.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomTextFormatParam? value) + { + value = Text; + return IsText; + } + /// /// A grammar defined by the user. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Grammar))] #endif public bool IsGrammar => Grammar != null; + + /// + /// + /// + public bool TryPickGrammar( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomGrammarFormatParam? value) + { + value = Grammar; + return IsGrammar; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? grammar = null, + global::System.Func? text = null, + global::System.Func? grammar = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? grammar = null, + global::System.Action? text = null, + + global::System.Action? grammar = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsGrammar) + { + grammar?.Invoke(Grammar!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? grammar = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionAndCustomToolCallOutput.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionAndCustomToolCallOutput.g.cs index b21ce3c5..f2695b7c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionAndCustomToolCallOutput.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionAndCustomToolCallOutput.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputText => InputText != null; + /// + /// + /// + public bool TryPickInputText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputTextContent? value) + { + value = InputText; + return IsInputText; + } + /// /// An image input to the model. Learn about [image inputs](/docs/guides/vision). /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputImage => InputImage != null; + /// + /// + /// + public bool TryPickInputImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputImageContent? value) + { + value = InputImage; + return IsInputImage; + } + /// /// A file input to the model. /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InputFile))] #endif public bool IsInputFile => InputFile != null; + + /// + /// + /// + public bool TryPickInputFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputFileContent? value) + { + value = InputFile; + return IsInputFile; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? inputText = null, - global::System.Func? inputImage = null, - global::System.Func? inputFile = null, + global::System.Func? inputText = null, + global::System.Func? inputImage = null, + global::System.Func? inputFile = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? inputText = null, - global::System.Action? inputImage = null, - global::System.Action? inputFile = null, + global::System.Action? inputText = null, + + global::System.Action? inputImage = null, + + global::System.Action? inputFile = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsInputText) + { + inputText?.Invoke(InputText!); + } + else if (IsInputImage) + { + inputImage?.Invoke(InputImage!); + } + else if (IsInputFile) + { + inputFile?.Invoke(InputFile!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? inputText = null, + global::System.Action? inputImage = null, + global::System.Action? inputFile = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionShellCallOutputOutcomeParam.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionShellCallOutputOutcomeParam.g.cs index ab196f32..b06667d1 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionShellCallOutputOutcomeParam.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionShellCallOutputOutcomeParam.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsTimeout => Timeout != null; + /// + /// + /// + public bool TryPickTimeout( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCallOutputTimeoutOutcomeParam? value) + { + value = Timeout; + return IsTimeout; + } + /// /// Indicates that the shell commands finished and returned an exit code. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Exit))] #endif public bool IsExit => Exit != null; + + /// + /// + /// + public bool TryPickExit( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCallOutputExitOutcomeParam? value) + { + value = Exit; + return IsExit; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? timeout = null, - global::System.Func? exit = null, + global::System.Func? timeout = null, + global::System.Func? exit = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? timeout = null, - global::System.Action? exit = null, + global::System.Action? timeout = null, + + global::System.Action? exit = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTimeout) + { + timeout?.Invoke(Timeout!); + } + else if (IsExit) + { + exit?.Invoke(Exit!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? timeout = null, + global::System.Action? exit = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionToolCallOutputResource.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionToolCallOutputResource.g.cs index 3b953938..702125ba 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionToolCallOutputResource.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionToolCallOutputResource.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionToolCallOutput => FunctionToolCallOutput != null; + /// + /// + /// + public bool TryPickFunctionToolCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCallOutput? value) + { + value = FunctionToolCallOutput; + return IsFunctionToolCallOutput; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FunctionToolCallOutputResourceVariant2))] #endif public bool IsFunctionToolCallOutputResourceVariant2 => FunctionToolCallOutputResourceVariant2 != null; + + /// + /// + /// + public bool TryPickFunctionToolCallOutputResourceVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCallOutputResourceVariant2? value) + { + value = FunctionToolCallOutputResourceVariant2; + return IsFunctionToolCallOutputResourceVariant2; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? functionToolCallOutput = null, - global::System.Func? functionToolCallOutputResourceVariant2 = null, + global::System.Func? functionToolCallOutput = null, + global::System.Func? functionToolCallOutputResourceVariant2 = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? functionToolCallOutput = null, - global::System.Action? functionToolCallOutputResourceVariant2 = null, + global::System.Action? functionToolCallOutput = null, + + global::System.Action? functionToolCallOutputResourceVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsFunctionToolCallOutput) + { + functionToolCallOutput?.Invoke(FunctionToolCallOutput!); + } + else if (IsFunctionToolCallOutputResourceVariant2) + { + functionToolCallOutputResourceVariant2?.Invoke(FunctionToolCallOutputResourceVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? functionToolCallOutput = null, + global::System.Action? functionToolCallOutputResourceVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionToolCallResource.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionToolCallResource.g.cs index f480d7fb..d41d580d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionToolCallResource.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FunctionToolCallResource.g.cs @@ -27,6 +27,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionToolCall => FunctionToolCall != null; + /// + /// + /// + public bool TryPickFunctionToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCall? value) + { + value = FunctionToolCall; + return IsFunctionToolCall; + } + /// /// /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FunctionToolCallResourceVariant2))] #endif public bool IsFunctionToolCallResourceVariant2 => FunctionToolCallResourceVariant2 != null; + + /// + /// + /// + public bool TryPickFunctionToolCallResourceVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCallResourceVariant2? value) + { + value = FunctionToolCallResourceVariant2; + return IsFunctionToolCallResourceVariant2; + } /// /// /// @@ -119,8 +145,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? functionToolCall = null, - global::System.Func? functionToolCallResourceVariant2 = null, + global::System.Func? functionToolCall = null, + global::System.Func? functionToolCallResourceVariant2 = null, bool validate = true) { if (validate) @@ -144,8 +170,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? functionToolCall = null, - global::System.Action? functionToolCallResourceVariant2 = null, + global::System.Action? functionToolCall = null, + + global::System.Action? functionToolCallResourceVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsFunctionToolCall) + { + functionToolCall?.Invoke(FunctionToolCall!); + } + else if (IsFunctionToolCallResourceVariant2) + { + functionToolCallResourceVariant2?.Invoke(FunctionToolCallResourceVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? functionToolCall = null, + global::System.Action? functionToolCallResourceVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageEditStreamEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageEditStreamEvent.g.cs index 045e77bb..ed4a62b5 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageEditStreamEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageEditStreamEvent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsImageEditPartialImage => ImageEditPartialImage != null; + /// + /// + /// + public bool TryPickImageEditPartialImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ImageEditPartialImageEvent? value) + { + value = ImageEditPartialImage; + return IsImageEditPartialImage; + } + /// /// Emitted when image editing has completed and the final image is available. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ImageEditCompleted))] #endif public bool IsImageEditCompleted => ImageEditCompleted != null; + + /// + /// + /// + public bool TryPickImageEditCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ImageEditCompletedEvent? value) + { + value = ImageEditCompleted; + return IsImageEditCompleted; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? imageEditPartialImage = null, - global::System.Func? imageEditCompleted = null, + global::System.Func? imageEditPartialImage = null, + global::System.Func? imageEditCompleted = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? imageEditPartialImage = null, - global::System.Action? imageEditCompleted = null, + global::System.Action? imageEditPartialImage = null, + + global::System.Action? imageEditCompleted = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsImageEditPartialImage) + { + imageEditPartialImage?.Invoke(ImageEditPartialImage!); + } + else if (IsImageEditCompleted) + { + imageEditCompleted?.Invoke(ImageEditCompleted!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? imageEditPartialImage = null, + global::System.Action? imageEditCompleted = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageGenStreamEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageGenStreamEvent.g.cs index 77eb7350..98553548 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageGenStreamEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ImageGenStreamEvent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsImageGenerationPartialImage => ImageGenerationPartialImage != null; + /// + /// + /// + public bool TryPickImageGenerationPartialImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ImageGenPartialImageEvent? value) + { + value = ImageGenerationPartialImage; + return IsImageGenerationPartialImage; + } + /// /// Emitted when image generation has completed and the final image is available. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ImageGenerationCompleted))] #endif public bool IsImageGenerationCompleted => ImageGenerationCompleted != null; + + /// + /// + /// + public bool TryPickImageGenerationCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ImageGenCompletedEvent? value) + { + value = ImageGenerationCompleted; + return IsImageGenerationCompleted; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? imageGenerationPartialImage = null, - global::System.Func? imageGenerationCompleted = null, + global::System.Func? imageGenerationPartialImage = null, + global::System.Func? imageGenerationCompleted = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? imageGenerationPartialImage = null, - global::System.Action? imageGenerationCompleted = null, + global::System.Action? imageGenerationPartialImage = null, + + global::System.Action? imageGenerationCompleted = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsImageGenerationPartialImage) + { + imageGenerationPartialImage?.Invoke(ImageGenerationPartialImage!); + } + else if (IsImageGenerationCompleted) + { + imageGenerationCompleted?.Invoke(ImageGenerationCompleted!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? imageGenerationPartialImage = null, + global::System.Action? imageGenerationCompleted = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputContent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputContent.g.cs index 2bb2daf3..f4e18dc5 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputContent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputContent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputText => InputText != null; + /// + /// + /// + public bool TryPickInputText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputTextContent? value) + { + value = InputText; + return IsInputText; + } + /// /// An image input to the model. Learn about [image inputs](/docs/guides/vision). /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputImage => InputImage != null; + /// + /// + /// + public bool TryPickInputImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputImageContent? value) + { + value = InputImage; + return IsInputImage; + } + /// /// A file input to the model. /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InputFile))] #endif public bool IsInputFile => InputFile != null; + + /// + /// + /// + public bool TryPickInputFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputFileContent? value) + { + value = InputFile; + return IsInputFile; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? inputText = null, - global::System.Func? inputImage = null, - global::System.Func? inputFile = null, + global::System.Func? inputText = null, + global::System.Func? inputImage = null, + global::System.Func? inputFile = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? inputText = null, - global::System.Action? inputImage = null, - global::System.Action? inputFile = null, + global::System.Action? inputText = null, + + global::System.Action? inputImage = null, + + global::System.Action? inputFile = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsInputText) + { + inputText?.Invoke(InputText!); + } + else if (IsInputImage) + { + inputImage?.Invoke(InputImage!); + } + else if (IsInputFile) + { + inputFile?.Invoke(InputFile!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? inputText = null, + global::System.Action? inputImage = null, + global::System.Action? inputFile = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputItem.g.cs index 9c129bf9..937d75bc 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputItem.g.cs @@ -30,6 +30,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessage => Message != null; + /// + /// + /// + public bool TryPickMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.EasyInputMessage? value) + { + value = Message; + return IsMessage; + } + /// /// An item representing part of the context for the response to be
/// generated by the model. Can contain text, images, and audio inputs,
@@ -49,6 +62,19 @@ namespace tryAGI.OpenAI #endif public bool IsItem => Item != null; + /// + /// + /// + public bool TryPickItem( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Item? value) + { + value = Item; + return IsItem; + } + /// /// An internal identifier for an item to reference. /// @@ -65,6 +91,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ItemReference))] #endif public bool IsItemReference => ItemReference != null; + + /// + /// + /// + public bool TryPickItemReference( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ItemReferenceParam? value) + { + value = ItemReference; + return IsItemReference; + } /// /// /// @@ -163,9 +202,9 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? message = null, + global::System.Func? message = null, global::System.Func? item = null, - global::System.Func? itemReference = null, + global::System.Func? itemReference = null, bool validate = true) { if (validate) @@ -193,9 +232,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? message = null, + global::System.Action? message = null, + + global::System.Action? item = null, + + global::System.Action? itemReference = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMessage) + { + message?.Invoke(Message!); + } + else if (IsItem) + { + item?.Invoke(Item!); + } + else if (IsItemReference) + { + itemReference?.Invoke(ItemReference!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? message = null, global::System.Action? item = null, - global::System.Action? itemReference = null, + global::System.Action? itemReference = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputMessageResource.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputMessageResource.g.cs index e73f1629..84771b06 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputMessageResource.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputMessageResource.g.cs @@ -28,6 +28,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputMessage => InputMessage != null; + /// + /// + /// + public bool TryPickInputMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputMessage? value) + { + value = InputMessage; + return IsInputMessage; + } + /// /// /// @@ -44,6 +57,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InputMessageResourceVariant2))] #endif public bool IsInputMessageResourceVariant2 => InputMessageResourceVariant2 != null; + + /// + /// + /// + public bool TryPickInputMessageResourceVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputMessageResourceVariant2? value) + { + value = InputMessageResourceVariant2; + return IsInputMessageResourceVariant2; + } /// /// /// @@ -120,8 +146,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? inputMessage = null, - global::System.Func? inputMessageResourceVariant2 = null, + global::System.Func? inputMessage = null, + global::System.Func? inputMessageResourceVariant2 = null, bool validate = true) { if (validate) @@ -145,8 +171,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? inputMessage = null, - global::System.Action? inputMessageResourceVariant2 = null, + global::System.Action? inputMessage = null, + + global::System.Action? inputMessageResourceVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsInputMessage) + { + inputMessage?.Invoke(InputMessage!); + } + else if (IsInputMessageResourceVariant2) + { + inputMessageResourceVariant2?.Invoke(InputMessageResourceVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? inputMessage = null, + global::System.Action? inputMessageResourceVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputParam.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputParam.g.cs index 31fe4434..e9edb013 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputParam.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputParam.g.cs @@ -33,6 +33,19 @@ namespace tryAGI.OpenAI #endif public bool IsTextInput => TextInput != null; + /// + /// + /// + public bool TryPickTextInput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = TextInput; + return IsTextInput; + } + /// /// A list of one or many input items to the model, containing
/// different content types. @@ -50,6 +63,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InputItemList))] #endif public bool IsInputItemList => InputItemList != null; + + /// + /// + /// + public bool TryPickInputItemList( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = InputItemList; + return IsInputItemList; + } /// /// /// @@ -108,8 +134,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? textInput = null, - global::System.Func?, TResult>? inputItemList = null, + global::System.Func? textInput = null, + global::System.Func, TResult>? inputItemList = null, bool validate = true) { if (validate) @@ -133,8 +159,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? textInput = null, - global::System.Action?>? inputItemList = null, + global::System.Action? textInput = null, + + global::System.Action>? inputItemList = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTextInput) + { + textInput?.Invoke(TextInput!); + } + else if (IsInputItemList) + { + inputItemList?.Invoke(InputItemList!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? textInput = null, + global::System.Action>? inputItemList = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Item.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Item.g.cs index 63603e05..ef0a181d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Item.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Item.g.cs @@ -28,6 +28,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessage1 => Message1 != null; + /// + /// + /// + public bool TryPickMessage1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputMessage? value) + { + value = Message1; + return IsMessage1; + } + /// /// An output message from the model. /// @@ -45,6 +58,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessage2 => Message2 != null; + /// + /// + /// + public bool TryPickMessage2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.OutputMessage? value) + { + value = Message2; + return IsMessage2; + } + /// /// The results of a file search tool call. See the
/// [file search guide](/docs/guides/tools-file-search) for more information. @@ -63,6 +89,19 @@ namespace tryAGI.OpenAI #endif public bool IsFileSearchCall => FileSearchCall != null; + /// + /// + /// + public bool TryPickFileSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FileSearchToolCall? value) + { + value = FileSearchCall; + return IsFileSearchCall; + } + /// /// A tool call to a computer use tool. See the
/// [computer use guide](/docs/guides/tools-computer-use) for more information. @@ -81,6 +120,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerCall => ComputerCall != null; + /// + /// + /// + public bool TryPickComputerCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerToolCall? value) + { + value = ComputerCall; + return IsComputerCall; + } + /// /// The output of a computer tool call. /// @@ -98,6 +150,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerCallOutput => ComputerCallOutput != null; + /// + /// + /// + public bool TryPickComputerCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerCallOutputItemParam? value) + { + value = ComputerCallOutput; + return IsComputerCallOutput; + } + /// /// The results of a web search tool call. See the
/// [web search guide](/docs/guides/tools-web-search) for more information. @@ -116,6 +181,19 @@ namespace tryAGI.OpenAI #endif public bool IsWebSearchCall => WebSearchCall != null; + /// + /// + /// + public bool TryPickWebSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WebSearchToolCall? value) + { + value = WebSearchCall; + return IsWebSearchCall; + } + /// /// A tool call to run a function. See the
/// [function calling guide](/docs/guides/function-calling) for more information. @@ -134,6 +212,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionCall => FunctionCall != null; + /// + /// + /// + public bool TryPickFunctionCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCall? value) + { + value = FunctionCall; + return IsFunctionCall; + } + /// /// The output of a function tool call. /// @@ -151,6 +242,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionCallOutput => FunctionCallOutput != null; + /// + /// + /// + public bool TryPickFunctionCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionCallOutputItemParam? value) + { + value = FunctionCallOutput; + return IsFunctionCallOutput; + } + /// /// /// @@ -168,6 +272,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolSearchCall => ToolSearchCall != null; + /// + /// + /// + public bool TryPickToolSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolSearchCallItemParam? value) + { + value = ToolSearchCall; + return IsToolSearchCall; + } + /// /// /// @@ -185,6 +302,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolSearchOutput => ToolSearchOutput != null; + /// + /// + /// + public bool TryPickToolSearchOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolSearchOutputItemParam? value) + { + value = ToolSearchOutput; + return IsToolSearchOutput; + } + /// /// A description of the chain of thought used by a reasoning model while generating
/// a response. Be sure to include these items in your `input` to the Responses API
@@ -205,6 +335,19 @@ namespace tryAGI.OpenAI #endif public bool IsReasoning => Reasoning != null; + /// + /// + /// + public bool TryPickReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ReasoningItem? value) + { + value = Reasoning; + return IsReasoning; + } + /// /// A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). /// @@ -222,6 +365,19 @@ namespace tryAGI.OpenAI #endif public bool IsCompaction => Compaction != null; + /// + /// + /// + public bool TryPickCompaction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CompactionSummaryItemParam? value) + { + value = Compaction; + return IsCompaction; + } + /// /// An image generation request made by the model. /// @@ -239,6 +395,19 @@ namespace tryAGI.OpenAI #endif public bool IsImageGenerationCall => ImageGenerationCall != null; + /// + /// + /// + public bool TryPickImageGenerationCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ImageGenToolCall? value) + { + value = ImageGenerationCall; + return IsImageGenerationCall; + } + /// /// A tool call to run code. /// @@ -256,6 +425,19 @@ namespace tryAGI.OpenAI #endif public bool IsCodeInterpreterCall => CodeInterpreterCall != null; + /// + /// + /// + public bool TryPickCodeInterpreterCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CodeInterpreterToolCall? value) + { + value = CodeInterpreterCall; + return IsCodeInterpreterCall; + } + /// /// A tool call to run a command on the local shell. /// @@ -273,6 +455,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocalShellCall => LocalShellCall != null; + /// + /// + /// + public bool TryPickLocalShellCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalShellToolCall? value) + { + value = LocalShellCall; + return IsLocalShellCall; + } + /// /// The output of a local shell tool call. /// @@ -290,6 +485,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocalShellCallOutput => LocalShellCallOutput != null; + /// + /// + /// + public bool TryPickLocalShellCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalShellToolCallOutput? value) + { + value = LocalShellCallOutput; + return IsLocalShellCallOutput; + } + /// /// A tool representing a request to execute one or more shell commands. /// @@ -307,6 +515,19 @@ namespace tryAGI.OpenAI #endif public bool IsShellCall => ShellCall != null; + /// + /// + /// + public bool TryPickShellCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCallItemParam? value) + { + value = ShellCall; + return IsShellCall; + } + /// /// The streamed output items emitted by a shell tool call. /// @@ -324,6 +545,19 @@ namespace tryAGI.OpenAI #endif public bool IsShellCallOutput => ShellCallOutput != null; + /// + /// + /// + public bool TryPickShellCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCallOutputItemParam? value) + { + value = ShellCallOutput; + return IsShellCallOutput; + } + /// /// A tool call representing a request to create, delete, or update files using diff patches. /// @@ -341,6 +575,19 @@ namespace tryAGI.OpenAI #endif public bool IsApplyPatchCall => ApplyPatchCall != null; + /// + /// + /// + public bool TryPickApplyPatchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchToolCallItemParam? value) + { + value = ApplyPatchCall; + return IsApplyPatchCall; + } + /// /// The streamed output emitted by an apply patch tool call. /// @@ -358,6 +605,19 @@ namespace tryAGI.OpenAI #endif public bool IsApplyPatchCallOutput => ApplyPatchCallOutput != null; + /// + /// + /// + public bool TryPickApplyPatchCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchToolCallOutputItemParam? value) + { + value = ApplyPatchCallOutput; + return IsApplyPatchCallOutput; + } + /// /// A list of tools available on an MCP server. /// @@ -375,6 +635,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpListTools => McpListTools != null; + /// + /// + /// + public bool TryPickMcpListTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPListTools? value) + { + value = McpListTools; + return IsMcpListTools; + } + /// /// A request for human approval of a tool invocation. /// @@ -392,6 +665,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpApprovalRequest => McpApprovalRequest != null; + /// + /// + /// + public bool TryPickMcpApprovalRequest( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPApprovalRequest? value) + { + value = McpApprovalRequest; + return IsMcpApprovalRequest; + } + /// /// A response to an MCP approval request. /// @@ -409,6 +695,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpApprovalResponse => McpApprovalResponse != null; + /// + /// + /// + public bool TryPickMcpApprovalResponse( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPApprovalResponse? value) + { + value = McpApprovalResponse; + return IsMcpApprovalResponse; + } + /// /// An invocation of a tool on an MCP server. /// @@ -426,6 +725,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpCall => McpCall != null; + /// + /// + /// + public bool TryPickMcpCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPToolCall? value) + { + value = McpCall; + return IsMcpCall; + } + /// /// The output of a custom tool call from your code, being sent back to the model. /// @@ -443,6 +755,19 @@ namespace tryAGI.OpenAI #endif public bool IsCustomToolCallOutput => CustomToolCallOutput != null; + /// + /// + /// + public bool TryPickCustomToolCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCallOutput? value) + { + value = CustomToolCallOutput; + return IsCustomToolCallOutput; + } + /// /// A call to a custom tool created by the model. /// @@ -459,6 +784,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomToolCall))] #endif public bool IsCustomToolCall => CustomToolCall != null; + + /// + /// + /// + public bool TryPickCustomToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCall? value) + { + value = CustomToolCall; + return IsCustomToolCall; + } /// /// /// @@ -1063,32 +1401,32 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? message1 = null, - global::System.Func? message2 = null, - global::System.Func? fileSearchCall = null, - global::System.Func? computerCall = null, - global::System.Func? computerCallOutput = null, - global::System.Func? webSearchCall = null, - global::System.Func? functionCall = null, - global::System.Func? functionCallOutput = null, - global::System.Func? toolSearchCall = null, - global::System.Func? toolSearchOutput = null, - global::System.Func? reasoning = null, - global::System.Func? compaction = null, - global::System.Func? imageGenerationCall = null, - global::System.Func? codeInterpreterCall = null, - global::System.Func? localShellCall = null, - global::System.Func? localShellCallOutput = null, - global::System.Func? shellCall = null, - global::System.Func? shellCallOutput = null, - global::System.Func? applyPatchCall = null, - global::System.Func? applyPatchCallOutput = null, - global::System.Func? mcpListTools = null, - global::System.Func? mcpApprovalRequest = null, - global::System.Func? mcpApprovalResponse = null, - global::System.Func? mcpCall = null, - global::System.Func? customToolCallOutput = null, - global::System.Func? customToolCall = null, + global::System.Func? message1 = null, + global::System.Func? message2 = null, + global::System.Func? fileSearchCall = null, + global::System.Func? computerCall = null, + global::System.Func? computerCallOutput = null, + global::System.Func? webSearchCall = null, + global::System.Func? functionCall = null, + global::System.Func? functionCallOutput = null, + global::System.Func? toolSearchCall = null, + global::System.Func? toolSearchOutput = null, + global::System.Func? reasoning = null, + global::System.Func? compaction = null, + global::System.Func? imageGenerationCall = null, + global::System.Func? codeInterpreterCall = null, + global::System.Func? localShellCall = null, + global::System.Func? localShellCallOutput = null, + global::System.Func? shellCall = null, + global::System.Func? shellCallOutput = null, + global::System.Func? applyPatchCall = null, + global::System.Func? applyPatchCallOutput = null, + global::System.Func? mcpListTools = null, + global::System.Func? mcpApprovalRequest = null, + global::System.Func? mcpApprovalResponse = null, + global::System.Func? mcpCall = null, + global::System.Func? customToolCallOutput = null, + global::System.Func? customToolCall = null, bool validate = true) { if (validate) @@ -1208,32 +1546,200 @@ public bool Validate() /// ///
public void Match( - global::System.Action? message1 = null, - global::System.Action? message2 = null, - global::System.Action? fileSearchCall = null, - global::System.Action? computerCall = null, - global::System.Action? computerCallOutput = null, - global::System.Action? webSearchCall = null, - global::System.Action? functionCall = null, - global::System.Action? functionCallOutput = null, - global::System.Action? toolSearchCall = null, - global::System.Action? toolSearchOutput = null, - global::System.Action? reasoning = null, - global::System.Action? compaction = null, - global::System.Action? imageGenerationCall = null, - global::System.Action? codeInterpreterCall = null, - global::System.Action? localShellCall = null, - global::System.Action? localShellCallOutput = null, - global::System.Action? shellCall = null, - global::System.Action? shellCallOutput = null, - global::System.Action? applyPatchCall = null, - global::System.Action? applyPatchCallOutput = null, - global::System.Action? mcpListTools = null, - global::System.Action? mcpApprovalRequest = null, - global::System.Action? mcpApprovalResponse = null, - global::System.Action? mcpCall = null, - global::System.Action? customToolCallOutput = null, - global::System.Action? customToolCall = null, + global::System.Action? message1 = null, + + global::System.Action? message2 = null, + + global::System.Action? fileSearchCall = null, + + global::System.Action? computerCall = null, + + global::System.Action? computerCallOutput = null, + + global::System.Action? webSearchCall = null, + + global::System.Action? functionCall = null, + + global::System.Action? functionCallOutput = null, + + global::System.Action? toolSearchCall = null, + + global::System.Action? toolSearchOutput = null, + + global::System.Action? reasoning = null, + + global::System.Action? compaction = null, + + global::System.Action? imageGenerationCall = null, + + global::System.Action? codeInterpreterCall = null, + + global::System.Action? localShellCall = null, + + global::System.Action? localShellCallOutput = null, + + global::System.Action? shellCall = null, + + global::System.Action? shellCallOutput = null, + + global::System.Action? applyPatchCall = null, + + global::System.Action? applyPatchCallOutput = null, + + global::System.Action? mcpListTools = null, + + global::System.Action? mcpApprovalRequest = null, + + global::System.Action? mcpApprovalResponse = null, + + global::System.Action? mcpCall = null, + + global::System.Action? customToolCallOutput = null, + + global::System.Action? customToolCall = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMessage1) + { + message1?.Invoke(Message1!); + } + else if (IsMessage2) + { + message2?.Invoke(Message2!); + } + else if (IsFileSearchCall) + { + fileSearchCall?.Invoke(FileSearchCall!); + } + else if (IsComputerCall) + { + computerCall?.Invoke(ComputerCall!); + } + else if (IsComputerCallOutput) + { + computerCallOutput?.Invoke(ComputerCallOutput!); + } + else if (IsWebSearchCall) + { + webSearchCall?.Invoke(WebSearchCall!); + } + else if (IsFunctionCall) + { + functionCall?.Invoke(FunctionCall!); + } + else if (IsFunctionCallOutput) + { + functionCallOutput?.Invoke(FunctionCallOutput!); + } + else if (IsToolSearchCall) + { + toolSearchCall?.Invoke(ToolSearchCall!); + } + else if (IsToolSearchOutput) + { + toolSearchOutput?.Invoke(ToolSearchOutput!); + } + else if (IsReasoning) + { + reasoning?.Invoke(Reasoning!); + } + else if (IsCompaction) + { + compaction?.Invoke(Compaction!); + } + else if (IsImageGenerationCall) + { + imageGenerationCall?.Invoke(ImageGenerationCall!); + } + else if (IsCodeInterpreterCall) + { + codeInterpreterCall?.Invoke(CodeInterpreterCall!); + } + else if (IsLocalShellCall) + { + localShellCall?.Invoke(LocalShellCall!); + } + else if (IsLocalShellCallOutput) + { + localShellCallOutput?.Invoke(LocalShellCallOutput!); + } + else if (IsShellCall) + { + shellCall?.Invoke(ShellCall!); + } + else if (IsShellCallOutput) + { + shellCallOutput?.Invoke(ShellCallOutput!); + } + else if (IsApplyPatchCall) + { + applyPatchCall?.Invoke(ApplyPatchCall!); + } + else if (IsApplyPatchCallOutput) + { + applyPatchCallOutput?.Invoke(ApplyPatchCallOutput!); + } + else if (IsMcpListTools) + { + mcpListTools?.Invoke(McpListTools!); + } + else if (IsMcpApprovalRequest) + { + mcpApprovalRequest?.Invoke(McpApprovalRequest!); + } + else if (IsMcpApprovalResponse) + { + mcpApprovalResponse?.Invoke(McpApprovalResponse!); + } + else if (IsMcpCall) + { + mcpCall?.Invoke(McpCall!); + } + else if (IsCustomToolCallOutput) + { + customToolCallOutput?.Invoke(CustomToolCallOutput!); + } + else if (IsCustomToolCall) + { + customToolCall?.Invoke(CustomToolCall!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? message1 = null, + global::System.Action? message2 = null, + global::System.Action? fileSearchCall = null, + global::System.Action? computerCall = null, + global::System.Action? computerCallOutput = null, + global::System.Action? webSearchCall = null, + global::System.Action? functionCall = null, + global::System.Action? functionCallOutput = null, + global::System.Action? toolSearchCall = null, + global::System.Action? toolSearchOutput = null, + global::System.Action? reasoning = null, + global::System.Action? compaction = null, + global::System.Action? imageGenerationCall = null, + global::System.Action? codeInterpreterCall = null, + global::System.Action? localShellCall = null, + global::System.Action? localShellCallOutput = null, + global::System.Action? shellCall = null, + global::System.Action? shellCallOutput = null, + global::System.Action? applyPatchCall = null, + global::System.Action? applyPatchCallOutput = null, + global::System.Action? mcpListTools = null, + global::System.Action? mcpApprovalRequest = null, + global::System.Action? mcpApprovalResponse = null, + global::System.Action? mcpCall = null, + global::System.Action? customToolCallOutput = null, + global::System.Action? customToolCall = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ItemField.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ItemField.g.cs index 01b92d45..bcd27170 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ItemField.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ItemField.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessage => Message != null; + /// + /// + /// + public bool TryPickMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Message? value) + { + value = Message; + return IsMessage; + } + /// /// A tool call to run a function. See the
/// [function calling guide](/docs/guides/function-calling) for more information. @@ -44,6 +57,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionCall => FunctionCall != null; + /// + /// + /// + public bool TryPickFunctionCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCall? value) + { + value = FunctionCall; + return IsFunctionCall; + } + /// /// /// @@ -61,6 +87,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolSearchCall => ToolSearchCall != null; + /// + /// + /// + public bool TryPickToolSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolSearchCall? value) + { + value = ToolSearchCall; + return IsToolSearchCall; + } + /// /// /// @@ -78,6 +117,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolSearchOutput => ToolSearchOutput != null; + /// + /// + /// + public bool TryPickToolSearchOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolSearchOutput? value) + { + value = ToolSearchOutput; + return IsToolSearchOutput; + } + /// /// The output of a function tool call. /// @@ -95,6 +147,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionCallOutput => FunctionCallOutput != null; + /// + /// + /// + public bool TryPickFunctionCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCallOutput? value) + { + value = FunctionCallOutput; + return IsFunctionCallOutput; + } + /// /// The results of a file search tool call. See the
/// [file search guide](/docs/guides/tools-file-search) for more information. @@ -113,6 +178,19 @@ namespace tryAGI.OpenAI #endif public bool IsFileSearchCall => FileSearchCall != null; + /// + /// + /// + public bool TryPickFileSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FileSearchToolCall? value) + { + value = FileSearchCall; + return IsFileSearchCall; + } + /// /// The results of a web search tool call. See the
/// [web search guide](/docs/guides/tools-web-search) for more information. @@ -131,6 +209,19 @@ namespace tryAGI.OpenAI #endif public bool IsWebSearchCall => WebSearchCall != null; + /// + /// + /// + public bool TryPickWebSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WebSearchToolCall? value) + { + value = WebSearchCall; + return IsWebSearchCall; + } + /// /// An image generation request made by the model. /// @@ -148,6 +239,19 @@ namespace tryAGI.OpenAI #endif public bool IsImageGenerationCall => ImageGenerationCall != null; + /// + /// + /// + public bool TryPickImageGenerationCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ImageGenToolCall? value) + { + value = ImageGenerationCall; + return IsImageGenerationCall; + } + /// /// A tool call to a computer use tool. See the
/// [computer use guide](/docs/guides/tools-computer-use) for more information. @@ -166,6 +270,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerCall => ComputerCall != null; + /// + /// + /// + public bool TryPickComputerCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerToolCall? value) + { + value = ComputerCall; + return IsComputerCall; + } + /// /// /// @@ -183,6 +300,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerToolCallOutputResource => ComputerToolCallOutputResource != null; + /// + /// + /// + public bool TryPickComputerToolCallOutputResource( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerToolCallOutputResource? value) + { + value = ComputerToolCallOutputResource; + return IsComputerToolCallOutputResource; + } + /// /// A description of the chain of thought used by a reasoning model while generating
/// a response. Be sure to include these items in your `input` to the Responses API
@@ -203,6 +333,19 @@ namespace tryAGI.OpenAI #endif public bool IsReasoning => Reasoning != null; + /// + /// + /// + public bool TryPickReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ReasoningItem? value) + { + value = Reasoning; + return IsReasoning; + } + /// /// A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). /// @@ -220,6 +363,19 @@ namespace tryAGI.OpenAI #endif public bool IsCompaction => Compaction != null; + /// + /// + /// + public bool TryPickCompaction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CompactionBody? value) + { + value = Compaction; + return IsCompaction; + } + /// /// A tool call to run code. /// @@ -237,6 +393,19 @@ namespace tryAGI.OpenAI #endif public bool IsCodeInterpreterCall => CodeInterpreterCall != null; + /// + /// + /// + public bool TryPickCodeInterpreterCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CodeInterpreterToolCall? value) + { + value = CodeInterpreterCall; + return IsCodeInterpreterCall; + } + /// /// A tool call to run a command on the local shell. /// @@ -254,6 +423,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocalShellCall => LocalShellCall != null; + /// + /// + /// + public bool TryPickLocalShellCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalShellToolCall? value) + { + value = LocalShellCall; + return IsLocalShellCall; + } + /// /// The output of a local shell tool call. /// @@ -271,6 +453,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocalShellCallOutput => LocalShellCallOutput != null; + /// + /// + /// + public bool TryPickLocalShellCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalShellToolCallOutput? value) + { + value = LocalShellCallOutput; + return IsLocalShellCallOutput; + } + /// /// A tool call that executes one or more shell commands in a managed environment. /// @@ -288,6 +483,19 @@ namespace tryAGI.OpenAI #endif public bool IsShellCall => ShellCall != null; + /// + /// + /// + public bool TryPickShellCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCall? value) + { + value = ShellCall; + return IsShellCall; + } + /// /// The output of a shell tool call that was emitted. /// @@ -305,6 +513,19 @@ namespace tryAGI.OpenAI #endif public bool IsShellCallOutput => ShellCallOutput != null; + /// + /// + /// + public bool TryPickShellCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCallOutput? value) + { + value = ShellCallOutput; + return IsShellCallOutput; + } + /// /// A tool call that applies file diffs by creating, deleting, or updating files. /// @@ -322,6 +543,19 @@ namespace tryAGI.OpenAI #endif public bool IsApplyPatchCall => ApplyPatchCall != null; + /// + /// + /// + public bool TryPickApplyPatchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchToolCall? value) + { + value = ApplyPatchCall; + return IsApplyPatchCall; + } + /// /// The output emitted by an apply patch tool call. /// @@ -339,6 +573,19 @@ namespace tryAGI.OpenAI #endif public bool IsApplyPatchCallOutput => ApplyPatchCallOutput != null; + /// + /// + /// + public bool TryPickApplyPatchCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchToolCallOutput? value) + { + value = ApplyPatchCallOutput; + return IsApplyPatchCallOutput; + } + /// /// A list of tools available on an MCP server. /// @@ -356,6 +603,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpListTools => McpListTools != null; + /// + /// + /// + public bool TryPickMcpListTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPListTools? value) + { + value = McpListTools; + return IsMcpListTools; + } + /// /// A request for human approval of a tool invocation. /// @@ -373,6 +633,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpApprovalRequest => McpApprovalRequest != null; + /// + /// + /// + public bool TryPickMcpApprovalRequest( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPApprovalRequest? value) + { + value = McpApprovalRequest; + return IsMcpApprovalRequest; + } + /// /// A response to an MCP approval request. /// @@ -390,6 +663,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpApprovalResponse => McpApprovalResponse != null; + /// + /// + /// + public bool TryPickMcpApprovalResponse( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPApprovalResponseResource? value) + { + value = McpApprovalResponse; + return IsMcpApprovalResponse; + } + /// /// An invocation of a tool on an MCP server. /// @@ -407,6 +693,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpCall => McpCall != null; + /// + /// + /// + public bool TryPickMcpCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPToolCall? value) + { + value = McpCall; + return IsMcpCall; + } + /// /// A call to a custom tool created by the model. /// @@ -424,6 +723,19 @@ namespace tryAGI.OpenAI #endif public bool IsCustomToolCall => CustomToolCall != null; + /// + /// + /// + public bool TryPickCustomToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCall? value) + { + value = CustomToolCall; + return IsCustomToolCall; + } + /// /// The output of a custom tool call from your code, being sent back to the model. /// @@ -440,6 +752,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomToolCallOutput))] #endif public bool IsCustomToolCallOutput => CustomToolCallOutput != null; + + /// + /// + /// + public bool TryPickCustomToolCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCallOutput? value) + { + value = CustomToolCallOutput; + return IsCustomToolCallOutput; + } /// /// /// @@ -1022,31 +1347,31 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? message = null, - global::System.Func? functionCall = null, - global::System.Func? toolSearchCall = null, - global::System.Func? toolSearchOutput = null, - global::System.Func? functionCallOutput = null, - global::System.Func? fileSearchCall = null, - global::System.Func? webSearchCall = null, - global::System.Func? imageGenerationCall = null, - global::System.Func? computerCall = null, + global::System.Func? message = null, + global::System.Func? functionCall = null, + global::System.Func? toolSearchCall = null, + global::System.Func? toolSearchOutput = null, + global::System.Func? functionCallOutput = null, + global::System.Func? fileSearchCall = null, + global::System.Func? webSearchCall = null, + global::System.Func? imageGenerationCall = null, + global::System.Func? computerCall = null, global::System.Func? computerToolCallOutputResource = null, - global::System.Func? reasoning = null, - global::System.Func? compaction = null, - global::System.Func? codeInterpreterCall = null, - global::System.Func? localShellCall = null, - global::System.Func? localShellCallOutput = null, - global::System.Func? shellCall = null, - global::System.Func? shellCallOutput = null, - global::System.Func? applyPatchCall = null, - global::System.Func? applyPatchCallOutput = null, - global::System.Func? mcpListTools = null, - global::System.Func? mcpApprovalRequest = null, - global::System.Func? mcpApprovalResponse = null, - global::System.Func? mcpCall = null, - global::System.Func? customToolCall = null, - global::System.Func? customToolCallOutput = null, + global::System.Func? reasoning = null, + global::System.Func? compaction = null, + global::System.Func? codeInterpreterCall = null, + global::System.Func? localShellCall = null, + global::System.Func? localShellCallOutput = null, + global::System.Func? shellCall = null, + global::System.Func? shellCallOutput = null, + global::System.Func? applyPatchCall = null, + global::System.Func? applyPatchCallOutput = null, + global::System.Func? mcpListTools = null, + global::System.Func? mcpApprovalRequest = null, + global::System.Func? mcpApprovalResponse = null, + global::System.Func? mcpCall = null, + global::System.Func? customToolCall = null, + global::System.Func? customToolCallOutput = null, bool validate = true) { if (validate) @@ -1162,31 +1487,193 @@ public bool Validate() /// ///
public void Match( - global::System.Action? message = null, - global::System.Action? functionCall = null, - global::System.Action? toolSearchCall = null, - global::System.Action? toolSearchOutput = null, - global::System.Action? functionCallOutput = null, - global::System.Action? fileSearchCall = null, - global::System.Action? webSearchCall = null, - global::System.Action? imageGenerationCall = null, - global::System.Action? computerCall = null, + global::System.Action? message = null, + + global::System.Action? functionCall = null, + + global::System.Action? toolSearchCall = null, + + global::System.Action? toolSearchOutput = null, + + global::System.Action? functionCallOutput = null, + + global::System.Action? fileSearchCall = null, + + global::System.Action? webSearchCall = null, + + global::System.Action? imageGenerationCall = null, + + global::System.Action? computerCall = null, + + global::System.Action? computerToolCallOutputResource = null, + + global::System.Action? reasoning = null, + + global::System.Action? compaction = null, + + global::System.Action? codeInterpreterCall = null, + + global::System.Action? localShellCall = null, + + global::System.Action? localShellCallOutput = null, + + global::System.Action? shellCall = null, + + global::System.Action? shellCallOutput = null, + + global::System.Action? applyPatchCall = null, + + global::System.Action? applyPatchCallOutput = null, + + global::System.Action? mcpListTools = null, + + global::System.Action? mcpApprovalRequest = null, + + global::System.Action? mcpApprovalResponse = null, + + global::System.Action? mcpCall = null, + + global::System.Action? customToolCall = null, + + global::System.Action? customToolCallOutput = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMessage) + { + message?.Invoke(Message!); + } + else if (IsFunctionCall) + { + functionCall?.Invoke(FunctionCall!); + } + else if (IsToolSearchCall) + { + toolSearchCall?.Invoke(ToolSearchCall!); + } + else if (IsToolSearchOutput) + { + toolSearchOutput?.Invoke(ToolSearchOutput!); + } + else if (IsFunctionCallOutput) + { + functionCallOutput?.Invoke(FunctionCallOutput!); + } + else if (IsFileSearchCall) + { + fileSearchCall?.Invoke(FileSearchCall!); + } + else if (IsWebSearchCall) + { + webSearchCall?.Invoke(WebSearchCall!); + } + else if (IsImageGenerationCall) + { + imageGenerationCall?.Invoke(ImageGenerationCall!); + } + else if (IsComputerCall) + { + computerCall?.Invoke(ComputerCall!); + } + else if (IsComputerToolCallOutputResource) + { + computerToolCallOutputResource?.Invoke(ComputerToolCallOutputResource!); + } + else if (IsReasoning) + { + reasoning?.Invoke(Reasoning!); + } + else if (IsCompaction) + { + compaction?.Invoke(Compaction!); + } + else if (IsCodeInterpreterCall) + { + codeInterpreterCall?.Invoke(CodeInterpreterCall!); + } + else if (IsLocalShellCall) + { + localShellCall?.Invoke(LocalShellCall!); + } + else if (IsLocalShellCallOutput) + { + localShellCallOutput?.Invoke(LocalShellCallOutput!); + } + else if (IsShellCall) + { + shellCall?.Invoke(ShellCall!); + } + else if (IsShellCallOutput) + { + shellCallOutput?.Invoke(ShellCallOutput!); + } + else if (IsApplyPatchCall) + { + applyPatchCall?.Invoke(ApplyPatchCall!); + } + else if (IsApplyPatchCallOutput) + { + applyPatchCallOutput?.Invoke(ApplyPatchCallOutput!); + } + else if (IsMcpListTools) + { + mcpListTools?.Invoke(McpListTools!); + } + else if (IsMcpApprovalRequest) + { + mcpApprovalRequest?.Invoke(McpApprovalRequest!); + } + else if (IsMcpApprovalResponse) + { + mcpApprovalResponse?.Invoke(McpApprovalResponse!); + } + else if (IsMcpCall) + { + mcpCall?.Invoke(McpCall!); + } + else if (IsCustomToolCall) + { + customToolCall?.Invoke(CustomToolCall!); + } + else if (IsCustomToolCallOutput) + { + customToolCallOutput?.Invoke(CustomToolCallOutput!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? message = null, + global::System.Action? functionCall = null, + global::System.Action? toolSearchCall = null, + global::System.Action? toolSearchOutput = null, + global::System.Action? functionCallOutput = null, + global::System.Action? fileSearchCall = null, + global::System.Action? webSearchCall = null, + global::System.Action? imageGenerationCall = null, + global::System.Action? computerCall = null, global::System.Action? computerToolCallOutputResource = null, - global::System.Action? reasoning = null, - global::System.Action? compaction = null, - global::System.Action? codeInterpreterCall = null, - global::System.Action? localShellCall = null, - global::System.Action? localShellCallOutput = null, - global::System.Action? shellCall = null, - global::System.Action? shellCallOutput = null, - global::System.Action? applyPatchCall = null, - global::System.Action? applyPatchCallOutput = null, - global::System.Action? mcpListTools = null, - global::System.Action? mcpApprovalRequest = null, - global::System.Action? mcpApprovalResponse = null, - global::System.Action? mcpCall = null, - global::System.Action? customToolCall = null, - global::System.Action? customToolCallOutput = null, + global::System.Action? reasoning = null, + global::System.Action? compaction = null, + global::System.Action? codeInterpreterCall = null, + global::System.Action? localShellCall = null, + global::System.Action? localShellCallOutput = null, + global::System.Action? shellCall = null, + global::System.Action? shellCallOutput = null, + global::System.Action? applyPatchCall = null, + global::System.Action? applyPatchCallOutput = null, + global::System.Action? mcpListTools = null, + global::System.Action? mcpApprovalRequest = null, + global::System.Action? mcpApprovalResponse = null, + global::System.Action? mcpCall = null, + global::System.Action? customToolCall = null, + global::System.Action? customToolCallOutput = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ItemResource.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ItemResource.g.cs index a91321ff..bc221ae4 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ItemResource.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ItemResource.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputMessage => InputMessage != null; + /// + /// + /// + public bool TryPickInputMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputMessageResource? value) + { + value = InputMessage; + return IsInputMessage; + } + /// /// An output message from the model. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessage => Message != null; + /// + /// + /// + public bool TryPickMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.OutputMessage? value) + { + value = Message; + return IsMessage; + } + /// /// The results of a file search tool call. See the
/// [file search guide](/docs/guides/tools-file-search) for more information. @@ -61,6 +87,19 @@ namespace tryAGI.OpenAI #endif public bool IsFileSearchCall => FileSearchCall != null; + /// + /// + /// + public bool TryPickFileSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FileSearchToolCall? value) + { + value = FileSearchCall; + return IsFileSearchCall; + } + /// /// A tool call to a computer use tool. See the
/// [computer use guide](/docs/guides/tools-computer-use) for more information. @@ -79,6 +118,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerCall => ComputerCall != null; + /// + /// + /// + public bool TryPickComputerCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerToolCall? value) + { + value = ComputerCall; + return IsComputerCall; + } + /// /// /// @@ -96,6 +148,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerToolCallOutput => ComputerToolCallOutput != null; + /// + /// + /// + public bool TryPickComputerToolCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerToolCallOutputResource? value) + { + value = ComputerToolCallOutput; + return IsComputerToolCallOutput; + } + /// /// The results of a web search tool call. See the
/// [web search guide](/docs/guides/tools-web-search) for more information. @@ -114,6 +179,19 @@ namespace tryAGI.OpenAI #endif public bool IsWebSearchCall => WebSearchCall != null; + /// + /// + /// + public bool TryPickWebSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WebSearchToolCall? value) + { + value = WebSearchCall; + return IsWebSearchCall; + } + /// /// /// @@ -131,6 +209,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionToolCall => FunctionToolCall != null; + /// + /// + /// + public bool TryPickFunctionToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCallResource? value) + { + value = FunctionToolCall; + return IsFunctionToolCall; + } + /// /// /// @@ -148,6 +239,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionToolCallOutput => FunctionToolCallOutput != null; + /// + /// + /// + public bool TryPickFunctionToolCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCallOutputResource? value) + { + value = FunctionToolCallOutput; + return IsFunctionToolCallOutput; + } + /// /// /// @@ -165,6 +269,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolSearchCall => ToolSearchCall != null; + /// + /// + /// + public bool TryPickToolSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolSearchCall? value) + { + value = ToolSearchCall; + return IsToolSearchCall; + } + /// /// /// @@ -182,6 +299,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolSearchOutput => ToolSearchOutput != null; + /// + /// + /// + public bool TryPickToolSearchOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolSearchOutput? value) + { + value = ToolSearchOutput; + return IsToolSearchOutput; + } + /// /// A description of the chain of thought used by a reasoning model while generating
/// a response. Be sure to include these items in your `input` to the Responses API
@@ -202,6 +332,19 @@ namespace tryAGI.OpenAI #endif public bool IsReasoning => Reasoning != null; + /// + /// + /// + public bool TryPickReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ReasoningItem? value) + { + value = Reasoning; + return IsReasoning; + } + /// /// A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). /// @@ -219,6 +362,19 @@ namespace tryAGI.OpenAI #endif public bool IsCompaction => Compaction != null; + /// + /// + /// + public bool TryPickCompaction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CompactionBody? value) + { + value = Compaction; + return IsCompaction; + } + /// /// An image generation request made by the model. /// @@ -236,6 +392,19 @@ namespace tryAGI.OpenAI #endif public bool IsImageGenerationCall => ImageGenerationCall != null; + /// + /// + /// + public bool TryPickImageGenerationCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ImageGenToolCall? value) + { + value = ImageGenerationCall; + return IsImageGenerationCall; + } + /// /// A tool call to run code. /// @@ -253,6 +422,19 @@ namespace tryAGI.OpenAI #endif public bool IsCodeInterpreterCall => CodeInterpreterCall != null; + /// + /// + /// + public bool TryPickCodeInterpreterCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CodeInterpreterToolCall? value) + { + value = CodeInterpreterCall; + return IsCodeInterpreterCall; + } + /// /// A tool call to run a command on the local shell. /// @@ -270,6 +452,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocalShellCall => LocalShellCall != null; + /// + /// + /// + public bool TryPickLocalShellCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalShellToolCall? value) + { + value = LocalShellCall; + return IsLocalShellCall; + } + /// /// The output of a local shell tool call. /// @@ -287,6 +482,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocalShellCallOutput => LocalShellCallOutput != null; + /// + /// + /// + public bool TryPickLocalShellCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalShellToolCallOutput? value) + { + value = LocalShellCallOutput; + return IsLocalShellCallOutput; + } + /// /// A tool call that executes one or more shell commands in a managed environment. /// @@ -304,6 +512,19 @@ namespace tryAGI.OpenAI #endif public bool IsShellCall => ShellCall != null; + /// + /// + /// + public bool TryPickShellCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCall? value) + { + value = ShellCall; + return IsShellCall; + } + /// /// The output of a shell tool call that was emitted. /// @@ -321,6 +542,19 @@ namespace tryAGI.OpenAI #endif public bool IsShellCallOutput => ShellCallOutput != null; + /// + /// + /// + public bool TryPickShellCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCallOutput? value) + { + value = ShellCallOutput; + return IsShellCallOutput; + } + /// /// A tool call that applies file diffs by creating, deleting, or updating files. /// @@ -338,6 +572,19 @@ namespace tryAGI.OpenAI #endif public bool IsApplyPatchCall => ApplyPatchCall != null; + /// + /// + /// + public bool TryPickApplyPatchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchToolCall? value) + { + value = ApplyPatchCall; + return IsApplyPatchCall; + } + /// /// The output emitted by an apply patch tool call. /// @@ -355,6 +602,19 @@ namespace tryAGI.OpenAI #endif public bool IsApplyPatchCallOutput => ApplyPatchCallOutput != null; + /// + /// + /// + public bool TryPickApplyPatchCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchToolCallOutput? value) + { + value = ApplyPatchCallOutput; + return IsApplyPatchCallOutput; + } + /// /// A list of tools available on an MCP server. /// @@ -372,6 +632,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpListTools => McpListTools != null; + /// + /// + /// + public bool TryPickMcpListTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPListTools? value) + { + value = McpListTools; + return IsMcpListTools; + } + /// /// A request for human approval of a tool invocation. /// @@ -389,6 +662,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpApprovalRequest => McpApprovalRequest != null; + /// + /// + /// + public bool TryPickMcpApprovalRequest( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPApprovalRequest? value) + { + value = McpApprovalRequest; + return IsMcpApprovalRequest; + } + /// /// A response to an MCP approval request. /// @@ -406,6 +692,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpApprovalResponse => McpApprovalResponse != null; + /// + /// + /// + public bool TryPickMcpApprovalResponse( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPApprovalResponseResource? value) + { + value = McpApprovalResponse; + return IsMcpApprovalResponse; + } + /// /// An invocation of a tool on an MCP server. /// @@ -423,6 +722,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpCall => McpCall != null; + /// + /// + /// + public bool TryPickMcpCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPToolCall? value) + { + value = McpCall; + return IsMcpCall; + } + /// /// /// @@ -440,6 +752,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCustomToolCallItem => ResponseCustomToolCallItem != null; + /// + /// + /// + public bool TryPickResponseCustomToolCallItem( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCallResource? value) + { + value = ResponseCustomToolCallItem; + return IsResponseCustomToolCallItem; + } + /// /// /// @@ -456,6 +781,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseCustomToolCallOutputItem))] #endif public bool IsResponseCustomToolCallOutputItem => ResponseCustomToolCallOutputItem != null; + + /// + /// + /// + public bool TryPickResponseCustomToolCallOutputItem( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCallOutputResource? value) + { + value = ResponseCustomToolCallOutputItem; + return IsResponseCustomToolCallOutputItem; + } /// /// /// @@ -1061,29 +1399,29 @@ public bool Validate() ///
public TResult? Match( global::System.Func? inputMessage = null, - global::System.Func? message = null, - global::System.Func? fileSearchCall = null, - global::System.Func? computerCall = null, + global::System.Func? message = null, + global::System.Func? fileSearchCall = null, + global::System.Func? computerCall = null, global::System.Func? computerToolCallOutput = null, - global::System.Func? webSearchCall = null, + global::System.Func? webSearchCall = null, global::System.Func? functionToolCall = null, global::System.Func? functionToolCallOutput = null, - global::System.Func? toolSearchCall = null, - global::System.Func? toolSearchOutput = null, - global::System.Func? reasoning = null, - global::System.Func? compaction = null, - global::System.Func? imageGenerationCall = null, - global::System.Func? codeInterpreterCall = null, - global::System.Func? localShellCall = null, - global::System.Func? localShellCallOutput = null, - global::System.Func? shellCall = null, - global::System.Func? shellCallOutput = null, - global::System.Func? applyPatchCall = null, - global::System.Func? applyPatchCallOutput = null, - global::System.Func? mcpListTools = null, - global::System.Func? mcpApprovalRequest = null, - global::System.Func? mcpApprovalResponse = null, - global::System.Func? mcpCall = null, + global::System.Func? toolSearchCall = null, + global::System.Func? toolSearchOutput = null, + global::System.Func? reasoning = null, + global::System.Func? compaction = null, + global::System.Func? imageGenerationCall = null, + global::System.Func? codeInterpreterCall = null, + global::System.Func? localShellCall = null, + global::System.Func? localShellCallOutput = null, + global::System.Func? shellCall = null, + global::System.Func? shellCallOutput = null, + global::System.Func? applyPatchCall = null, + global::System.Func? applyPatchCallOutput = null, + global::System.Func? mcpListTools = null, + global::System.Func? mcpApprovalRequest = null, + global::System.Func? mcpApprovalResponse = null, + global::System.Func? mcpCall = null, global::System.Func? responseCustomToolCallItem = null, global::System.Func? responseCustomToolCallOutputItem = null, bool validate = true) @@ -1206,29 +1544,197 @@ public bool Validate() ///
public void Match( global::System.Action? inputMessage = null, - global::System.Action? message = null, - global::System.Action? fileSearchCall = null, - global::System.Action? computerCall = null, + + global::System.Action? message = null, + + global::System.Action? fileSearchCall = null, + + global::System.Action? computerCall = null, + + global::System.Action? computerToolCallOutput = null, + + global::System.Action? webSearchCall = null, + + global::System.Action? functionToolCall = null, + + global::System.Action? functionToolCallOutput = null, + + global::System.Action? toolSearchCall = null, + + global::System.Action? toolSearchOutput = null, + + global::System.Action? reasoning = null, + + global::System.Action? compaction = null, + + global::System.Action? imageGenerationCall = null, + + global::System.Action? codeInterpreterCall = null, + + global::System.Action? localShellCall = null, + + global::System.Action? localShellCallOutput = null, + + global::System.Action? shellCall = null, + + global::System.Action? shellCallOutput = null, + + global::System.Action? applyPatchCall = null, + + global::System.Action? applyPatchCallOutput = null, + + global::System.Action? mcpListTools = null, + + global::System.Action? mcpApprovalRequest = null, + + global::System.Action? mcpApprovalResponse = null, + + global::System.Action? mcpCall = null, + + global::System.Action? responseCustomToolCallItem = null, + + global::System.Action? responseCustomToolCallOutputItem = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsInputMessage) + { + inputMessage?.Invoke(InputMessage!); + } + else if (IsMessage) + { + message?.Invoke(Message!); + } + else if (IsFileSearchCall) + { + fileSearchCall?.Invoke(FileSearchCall!); + } + else if (IsComputerCall) + { + computerCall?.Invoke(ComputerCall!); + } + else if (IsComputerToolCallOutput) + { + computerToolCallOutput?.Invoke(ComputerToolCallOutput!); + } + else if (IsWebSearchCall) + { + webSearchCall?.Invoke(WebSearchCall!); + } + else if (IsFunctionToolCall) + { + functionToolCall?.Invoke(FunctionToolCall!); + } + else if (IsFunctionToolCallOutput) + { + functionToolCallOutput?.Invoke(FunctionToolCallOutput!); + } + else if (IsToolSearchCall) + { + toolSearchCall?.Invoke(ToolSearchCall!); + } + else if (IsToolSearchOutput) + { + toolSearchOutput?.Invoke(ToolSearchOutput!); + } + else if (IsReasoning) + { + reasoning?.Invoke(Reasoning!); + } + else if (IsCompaction) + { + compaction?.Invoke(Compaction!); + } + else if (IsImageGenerationCall) + { + imageGenerationCall?.Invoke(ImageGenerationCall!); + } + else if (IsCodeInterpreterCall) + { + codeInterpreterCall?.Invoke(CodeInterpreterCall!); + } + else if (IsLocalShellCall) + { + localShellCall?.Invoke(LocalShellCall!); + } + else if (IsLocalShellCallOutput) + { + localShellCallOutput?.Invoke(LocalShellCallOutput!); + } + else if (IsShellCall) + { + shellCall?.Invoke(ShellCall!); + } + else if (IsShellCallOutput) + { + shellCallOutput?.Invoke(ShellCallOutput!); + } + else if (IsApplyPatchCall) + { + applyPatchCall?.Invoke(ApplyPatchCall!); + } + else if (IsApplyPatchCallOutput) + { + applyPatchCallOutput?.Invoke(ApplyPatchCallOutput!); + } + else if (IsMcpListTools) + { + mcpListTools?.Invoke(McpListTools!); + } + else if (IsMcpApprovalRequest) + { + mcpApprovalRequest?.Invoke(McpApprovalRequest!); + } + else if (IsMcpApprovalResponse) + { + mcpApprovalResponse?.Invoke(McpApprovalResponse!); + } + else if (IsMcpCall) + { + mcpCall?.Invoke(McpCall!); + } + else if (IsResponseCustomToolCallItem) + { + responseCustomToolCallItem?.Invoke(ResponseCustomToolCallItem!); + } + else if (IsResponseCustomToolCallOutputItem) + { + responseCustomToolCallOutputItem?.Invoke(ResponseCustomToolCallOutputItem!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? inputMessage = null, + global::System.Action? message = null, + global::System.Action? fileSearchCall = null, + global::System.Action? computerCall = null, global::System.Action? computerToolCallOutput = null, - global::System.Action? webSearchCall = null, + global::System.Action? webSearchCall = null, global::System.Action? functionToolCall = null, global::System.Action? functionToolCallOutput = null, - global::System.Action? toolSearchCall = null, - global::System.Action? toolSearchOutput = null, - global::System.Action? reasoning = null, - global::System.Action? compaction = null, - global::System.Action? imageGenerationCall = null, - global::System.Action? codeInterpreterCall = null, - global::System.Action? localShellCall = null, - global::System.Action? localShellCallOutput = null, - global::System.Action? shellCall = null, - global::System.Action? shellCallOutput = null, - global::System.Action? applyPatchCall = null, - global::System.Action? applyPatchCallOutput = null, - global::System.Action? mcpListTools = null, - global::System.Action? mcpApprovalRequest = null, - global::System.Action? mcpApprovalResponse = null, - global::System.Action? mcpCall = null, + global::System.Action? toolSearchCall = null, + global::System.Action? toolSearchOutput = null, + global::System.Action? reasoning = null, + global::System.Action? compaction = null, + global::System.Action? imageGenerationCall = null, + global::System.Action? codeInterpreterCall = null, + global::System.Action? localShellCall = null, + global::System.Action? localShellCallOutput = null, + global::System.Action? shellCall = null, + global::System.Action? shellCallOutput = null, + global::System.Action? applyPatchCall = null, + global::System.Action? applyPatchCallOutput = null, + global::System.Action? mcpListTools = null, + global::System.Action? mcpApprovalRequest = null, + global::System.Action? mcpApprovalResponse = null, + global::System.Action? mcpCall = null, global::System.Action? responseCustomToolCallItem = null, global::System.Action? responseCustomToolCallOutputItem = null, bool validate = true) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.MessageStreamEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.MessageStreamEvent.g.cs index f03054b0..6115b61d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.MessageStreamEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.MessageStreamEvent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessageStreamEventVariant1 => MessageStreamEventVariant1 != null; + /// + /// + /// + public bool TryPickMessageStreamEventVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MessageStreamEventVariant1? value) + { + value = MessageStreamEventVariant1; + return IsMessageStreamEventVariant1; + } + /// /// Occurs when a [message](/docs/api-reference/messages/object) moves to an `in_progress` state. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessageStreamEventVariant2 => MessageStreamEventVariant2 != null; + /// + /// + /// + public bool TryPickMessageStreamEventVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MessageStreamEventVariant2? value) + { + value = MessageStreamEventVariant2; + return IsMessageStreamEventVariant2; + } + /// /// Occurs when parts of a [Message](/docs/api-reference/messages/object) are being streamed. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessageStreamEventVariant3 => MessageStreamEventVariant3 != null; + /// + /// + /// + public bool TryPickMessageStreamEventVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MessageStreamEventVariant3? value) + { + value = MessageStreamEventVariant3; + return IsMessageStreamEventVariant3; + } + /// /// Occurs when a [message](/docs/api-reference/messages/object) is completed. /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessageStreamEventVariant4 => MessageStreamEventVariant4 != null; + /// + /// + /// + public bool TryPickMessageStreamEventVariant4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MessageStreamEventVariant4? value) + { + value = MessageStreamEventVariant4; + return IsMessageStreamEventVariant4; + } + /// /// Occurs when a [message](/docs/api-reference/messages/object) ends before it is completed. /// @@ -93,6 +145,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(MessageStreamEventVariant5))] #endif public bool IsMessageStreamEventVariant5 => MessageStreamEventVariant5 != null; + + /// + /// + /// + public bool TryPickMessageStreamEventVariant5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MessageStreamEventVariant5? value) + { + value = MessageStreamEventVariant5; + return IsMessageStreamEventVariant5; + } /// /// /// @@ -235,11 +300,11 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? messageStreamEventVariant1 = null, - global::System.Func? messageStreamEventVariant2 = null, - global::System.Func? messageStreamEventVariant3 = null, - global::System.Func? messageStreamEventVariant4 = null, - global::System.Func? messageStreamEventVariant5 = null, + global::System.Func? messageStreamEventVariant1 = null, + global::System.Func? messageStreamEventVariant2 = null, + global::System.Func? messageStreamEventVariant3 = null, + global::System.Func? messageStreamEventVariant4 = null, + global::System.Func? messageStreamEventVariant5 = null, bool validate = true) { if (validate) @@ -275,11 +340,53 @@ public bool Validate() /// ///
public void Match( - global::System.Action? messageStreamEventVariant1 = null, - global::System.Action? messageStreamEventVariant2 = null, - global::System.Action? messageStreamEventVariant3 = null, - global::System.Action? messageStreamEventVariant4 = null, - global::System.Action? messageStreamEventVariant5 = null, + global::System.Action? messageStreamEventVariant1 = null, + + global::System.Action? messageStreamEventVariant2 = null, + + global::System.Action? messageStreamEventVariant3 = null, + + global::System.Action? messageStreamEventVariant4 = null, + + global::System.Action? messageStreamEventVariant5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMessageStreamEventVariant1) + { + messageStreamEventVariant1?.Invoke(MessageStreamEventVariant1!); + } + else if (IsMessageStreamEventVariant2) + { + messageStreamEventVariant2?.Invoke(MessageStreamEventVariant2!); + } + else if (IsMessageStreamEventVariant3) + { + messageStreamEventVariant3?.Invoke(MessageStreamEventVariant3!); + } + else if (IsMessageStreamEventVariant4) + { + messageStreamEventVariant4?.Invoke(MessageStreamEventVariant4!); + } + else if (IsMessageStreamEventVariant5) + { + messageStreamEventVariant5?.Invoke(MessageStreamEventVariant5!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? messageStreamEventVariant1 = null, + global::System.Action? messageStreamEventVariant2 = null, + global::System.Action? messageStreamEventVariant3 = null, + global::System.Action? messageStreamEventVariant4 = null, + global::System.Action? messageStreamEventVariant5 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIds.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIds.g.cs index 1dfdf5ca..6f4d910e 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIds.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIds.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsShared => Shared != null; + /// + /// + /// + public bool TryPickShared( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ModelIdsShared? value) + { + value = Shared; + return IsShared; + } + /// /// Example: gpt-5.1 /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Responses))] #endif public bool IsResponses => Responses != null; + + /// + /// + /// + public bool TryPickResponses( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ModelIdsResponses? value) + { + value = Responses; + return IsResponses; + } /// /// /// @@ -144,6 +170,30 @@ public bool Validate() ///
public void Match( global::System.Action? shared = null, + + global::System.Action? responses = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsShared) + { + shared?.Invoke(Shared!); + } + else if (IsResponses) + { + responses?.Invoke(Responses!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? shared = null, global::System.Action? responses = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsCompaction.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsCompaction.g.cs index 66d7f629..7e5b2f85 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsCompaction.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsCompaction.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponses => Responses != null; + /// + /// + /// + public bool TryPickResponses( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ModelIdsResponses? value) + { + value = Responses; + return IsResponses; + } + /// /// /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsModelIdsCompactionVariant2 => ModelIdsCompactionVariant2 != null; + /// + /// + /// + public bool TryPickModelIdsCompactionVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = ModelIdsCompactionVariant2; + return IsModelIdsCompactionVariant2; + } + /// /// /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ModelIdsCompactionVariant3))] #endif public bool IsModelIdsCompactionVariant3 => ModelIdsCompactionVariant3 != null; + + /// + /// + /// + public bool TryPickModelIdsCompactionVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = ModelIdsCompactionVariant3; + return IsModelIdsCompactionVariant3; + } /// /// /// @@ -140,8 +179,8 @@ public bool Validate() ///
public TResult? Match( global::System.Func? responses = null, - global::System.Func? modelIdsCompactionVariant2 = null, - global::System.Func? modelIdsCompactionVariant3 = null, + global::System.Func? modelIdsCompactionVariant2 = null, + global::System.Func? modelIdsCompactionVariant3 = null, bool validate = true) { if (validate) @@ -170,8 +209,38 @@ public bool Validate() ///
public void Match( global::System.Action? responses = null, - global::System.Action? modelIdsCompactionVariant2 = null, - global::System.Action? modelIdsCompactionVariant3 = null, + + global::System.Action? modelIdsCompactionVariant2 = null, + + global::System.Action? modelIdsCompactionVariant3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsResponses) + { + responses?.Invoke(Responses!); + } + else if (IsModelIdsCompactionVariant2) + { + modelIdsCompactionVariant2?.Invoke(ModelIdsCompactionVariant2!); + } + else if (IsModelIdsCompactionVariant3) + { + modelIdsCompactionVariant3?.Invoke(ModelIdsCompactionVariant3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? responses = null, + global::System.Action? modelIdsCompactionVariant2 = null, + global::System.Action? modelIdsCompactionVariant3 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsResponses.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsResponses.g.cs index 37dcb335..ad38179b 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsResponses.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsResponses.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsShared => Shared != null; + /// + /// + /// + public bool TryPickShared( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ModelIdsShared? value) + { + value = Shared; + return IsShared; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponsesOnlyModel))] #endif public bool IsResponsesOnlyModel => ResponsesOnlyModel != null; + + /// + /// + /// + public bool TryPickResponsesOnlyModel( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ModelIdsResponsesEnum? value) + { + value = ResponsesOnlyModel; + return IsResponsesOnlyModel; + } /// /// /// @@ -144,6 +170,30 @@ public bool Validate() /// public void Match( global::System.Action? shared = null, + + global::System.Action? responsesOnlyModel = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsShared) + { + shared?.Invoke(Shared!); + } + else if (IsResponsesOnlyModel) + { + responsesOnlyModel?.Invoke(ResponsesOnlyModel!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? shared = null, global::System.Action? responsesOnlyModel = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsShared.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsShared.g.cs index 2a126f5f..13a33ee3 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsShared.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelIdsShared.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsModelIdsSharedVariant1 => ModelIdsSharedVariant1 != null; + /// + /// + /// + public bool TryPickModelIdsSharedVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = ModelIdsSharedVariant1; + return IsModelIdsSharedVariant1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Enum))] #endif public bool IsEnum => Enum != null; + + /// + /// + /// + public bool TryPickEnum( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ModelIdsSharedEnum? value) + { + value = Enum; + return IsEnum; + } /// /// /// @@ -118,7 +144,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? modelIdsSharedVariant1 = null, + global::System.Func? modelIdsSharedVariant1 = null, global::System.Func? @enum = null, bool validate = true) { @@ -143,7 +169,31 @@ public bool Validate() /// /// public void Match( - global::System.Action? modelIdsSharedVariant1 = null, + global::System.Action? modelIdsSharedVariant1 = null, + + global::System.Action? @enum = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsModelIdsSharedVariant1) + { + modelIdsSharedVariant1?.Invoke(ModelIdsSharedVariant1!); + } + else if (IsEnum) + { + @enum?.Invoke(Enum!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? modelIdsSharedVariant1 = null, global::System.Action? @enum = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy.g.cs index 1318cd53..77c6faf1 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsDisabled => Disabled != null; + /// + /// + /// + public bool TryPickDisabled( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ContainerNetworkPolicyDisabledParam? value) + { + value = Disabled; + return IsDisabled; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Allowlist))] #endif public bool IsAllowlist => Allowlist != null; + + /// + /// + /// + public bool TryPickAllowlist( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ContainerNetworkPolicyAllowlistParam? value) + { + value = Allowlist; + return IsAllowlist; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? disabled = null, - global::System.Func? allowlist = null, + global::System.Func? disabled = null, + global::System.Func? allowlist = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? disabled = null, - global::System.Action? allowlist = null, + global::System.Action? disabled = null, + + global::System.Action? allowlist = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDisabled) + { + disabled?.Invoke(Disabled!); + } + else if (IsAllowlist) + { + allowlist?.Invoke(Allowlist!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? disabled = null, + global::System.Action? allowlist = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy2.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy2.g.cs index 28d2308e..74e75d7c 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy2.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy2.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsDisabled => Disabled != null; + /// + /// + /// + public bool TryPickDisabled( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ContainerNetworkPolicyDisabledParam? value) + { + value = Disabled; + return IsDisabled; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Allowlist))] #endif public bool IsAllowlist => Allowlist != null; + + /// + /// + /// + public bool TryPickAllowlist( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ContainerNetworkPolicyAllowlistParam? value) + { + value = Allowlist; + return IsAllowlist; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? disabled = null, - global::System.Func? allowlist = null, + global::System.Func? disabled = null, + global::System.Func? allowlist = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? disabled = null, - global::System.Action? allowlist = null, + global::System.Action? disabled = null, + + global::System.Action? allowlist = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDisabled) + { + disabled?.Invoke(Disabled!); + } + else if (IsAllowlist) + { + allowlist?.Invoke(Allowlist!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? disabled = null, + global::System.Action? allowlist = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy3.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy3.g.cs index 02ad32d0..5f34beb5 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy3.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.NetworkPolicy3.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsDisabled => Disabled != null; + /// + /// + /// + public bool TryPickDisabled( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ContainerNetworkPolicyDisabledParam? value) + { + value = Disabled; + return IsDisabled; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Allowlist))] #endif public bool IsAllowlist => Allowlist != null; + + /// + /// + /// + public bool TryPickAllowlist( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ContainerNetworkPolicyAllowlistParam? value) + { + value = Allowlist; + return IsAllowlist; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? disabled = null, - global::System.Func? allowlist = null, + global::System.Func? disabled = null, + global::System.Func? allowlist = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? disabled = null, - global::System.Action? allowlist = null, + global::System.Action? disabled = null, + + global::System.Action? allowlist = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsDisabled) + { + disabled?.Invoke(Disabled!); + } + else if (IsAllowlist) + { + allowlist?.Invoke(Allowlist!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? disabled = null, + global::System.Action? allowlist = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Operation.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Operation.g.cs index 7c764e5c..501d7d3d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Operation.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Operation.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsCreateFile => CreateFile != null; + /// + /// + /// + public bool TryPickCreateFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchCreateFileOperation? value) + { + value = CreateFile; + return IsCreateFile; + } + /// /// Instruction describing how to delete a file via the apply_patch tool. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsDeleteFile => DeleteFile != null; + /// + /// + /// + public bool TryPickDeleteFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchDeleteFileOperation? value) + { + value = DeleteFile; + return IsDeleteFile; + } + /// /// Instruction describing how to update a file via the apply_patch tool. /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UpdateFile))] #endif public bool IsUpdateFile => UpdateFile != null; + + /// + /// + /// + public bool TryPickUpdateFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchUpdateFileOperation? value) + { + value = UpdateFile; + return IsUpdateFile; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? createFile = null, - global::System.Func? deleteFile = null, - global::System.Func? updateFile = null, + global::System.Func? createFile = null, + global::System.Func? deleteFile = null, + global::System.Func? updateFile = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? createFile = null, - global::System.Action? deleteFile = null, - global::System.Action? updateFile = null, + global::System.Action? createFile = null, + + global::System.Action? deleteFile = null, + + global::System.Action? updateFile = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsCreateFile) + { + createFile?.Invoke(CreateFile!); + } + else if (IsDeleteFile) + { + deleteFile?.Invoke(DeleteFile!); + } + else if (IsUpdateFile) + { + updateFile?.Invoke(UpdateFile!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? createFile = null, + global::System.Action? deleteFile = null, + global::System.Action? updateFile = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Outcome.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Outcome.g.cs index e7ad8650..be06822e 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Outcome.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Outcome.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsTimeout => Timeout != null; + /// + /// + /// + public bool TryPickTimeout( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCallOutputTimeoutOutcome? value) + { + value = Timeout; + return IsTimeout; + } + /// /// Indicates that the shell commands finished and returned an exit code. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Exit))] #endif public bool IsExit => Exit != null; + + /// + /// + /// + public bool TryPickExit( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCallOutputExitOutcome? value) + { + value = Exit; + return IsExit; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? timeout = null, - global::System.Func? exit = null, + global::System.Func? timeout = null, + global::System.Func? exit = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? timeout = null, - global::System.Action? exit = null, + global::System.Action? timeout = null, + + global::System.Action? exit = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsTimeout) + { + timeout?.Invoke(Timeout!); + } + else if (IsExit) + { + exit?.Invoke(Exit!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? timeout = null, + global::System.Action? exit = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputContent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputContent.g.cs index 661b3d10..045ddf0f 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputContent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputContent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsOutputText => OutputText != null; + /// + /// + /// + public bool TryPickOutputText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.OutputTextContent? value) + { + value = OutputText; + return IsOutputText; + } + /// /// A refusal from the model. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsRefusal => Refusal != null; + /// + /// + /// + public bool TryPickRefusal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RefusalContent? value) + { + value = Refusal; + return IsRefusal; + } + /// /// Reasoning text from the model. /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ReasoningText))] #endif public bool IsReasoningText => ReasoningText != null; + + /// + /// + /// + public bool TryPickReasoningText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ReasoningTextContent? value) + { + value = ReasoningText; + return IsReasoningText; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? outputText = null, - global::System.Func? refusal = null, - global::System.Func? reasoningText = null, + global::System.Func? outputText = null, + global::System.Func? refusal = null, + global::System.Func? reasoningText = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? outputText = null, - global::System.Action? refusal = null, - global::System.Action? reasoningText = null, + global::System.Action? outputText = null, + + global::System.Action? refusal = null, + + global::System.Action? reasoningText = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOutputText) + { + outputText?.Invoke(OutputText!); + } + else if (IsRefusal) + { + refusal?.Invoke(Refusal!); + } + else if (IsReasoningText) + { + reasoningText?.Invoke(ReasoningText!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? outputText = null, + global::System.Action? refusal = null, + global::System.Action? reasoningText = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputItem.g.cs index 7882f768..8ea0bfbf 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputItem.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessage => Message != null; + /// + /// + /// + public bool TryPickMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.OutputMessage? value) + { + value = Message; + return IsMessage; + } + /// /// The results of a file search tool call. See the
/// [file search guide](/docs/guides/tools-file-search) for more information. @@ -44,6 +57,19 @@ namespace tryAGI.OpenAI #endif public bool IsFileSearchCall => FileSearchCall != null; + /// + /// + /// + public bool TryPickFileSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FileSearchToolCall? value) + { + value = FileSearchCall; + return IsFileSearchCall; + } + /// /// A tool call to run a function. See the
/// [function calling guide](/docs/guides/function-calling) for more information. @@ -62,6 +88,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionCall => FunctionCall != null; + /// + /// + /// + public bool TryPickFunctionCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCall? value) + { + value = FunctionCall; + return IsFunctionCall; + } + /// /// /// @@ -79,6 +118,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionToolCallResource => FunctionToolCallResource != null; + /// + /// + /// + public bool TryPickFunctionToolCallResource( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolCallOutputResource? value) + { + value = FunctionToolCallResource; + return IsFunctionToolCallResource; + } + /// /// The results of a web search tool call. See the
/// [web search guide](/docs/guides/tools-web-search) for more information. @@ -97,6 +149,19 @@ namespace tryAGI.OpenAI #endif public bool IsWebSearchCall => WebSearchCall != null; + /// + /// + /// + public bool TryPickWebSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WebSearchToolCall? value) + { + value = WebSearchCall; + return IsWebSearchCall; + } + /// /// A tool call to a computer use tool. See the
/// [computer use guide](/docs/guides/tools-computer-use) for more information. @@ -115,6 +180,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerCall => ComputerCall != null; + /// + /// + /// + public bool TryPickComputerCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerToolCall? value) + { + value = ComputerCall; + return IsComputerCall; + } + /// /// /// @@ -132,6 +210,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerToolCallResource => ComputerToolCallResource != null; + /// + /// + /// + public bool TryPickComputerToolCallResource( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerToolCallOutputResource? value) + { + value = ComputerToolCallResource; + return IsComputerToolCallResource; + } + /// /// A description of the chain of thought used by a reasoning model while generating
/// a response. Be sure to include these items in your `input` to the Responses API
@@ -152,6 +243,19 @@ namespace tryAGI.OpenAI #endif public bool IsReasoning => Reasoning != null; + /// + /// + /// + public bool TryPickReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ReasoningItem? value) + { + value = Reasoning; + return IsReasoning; + } + /// /// /// @@ -169,6 +273,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolSearchCall => ToolSearchCall != null; + /// + /// + /// + public bool TryPickToolSearchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolSearchCall? value) + { + value = ToolSearchCall; + return IsToolSearchCall; + } + /// /// /// @@ -186,6 +303,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolSearchOutput => ToolSearchOutput != null; + /// + /// + /// + public bool TryPickToolSearchOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolSearchOutput? value) + { + value = ToolSearchOutput; + return IsToolSearchOutput; + } + /// /// A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). /// @@ -203,6 +333,19 @@ namespace tryAGI.OpenAI #endif public bool IsCompaction => Compaction != null; + /// + /// + /// + public bool TryPickCompaction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CompactionBody? value) + { + value = Compaction; + return IsCompaction; + } + /// /// An image generation request made by the model. /// @@ -220,6 +363,19 @@ namespace tryAGI.OpenAI #endif public bool IsImageGenerationCall => ImageGenerationCall != null; + /// + /// + /// + public bool TryPickImageGenerationCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ImageGenToolCall? value) + { + value = ImageGenerationCall; + return IsImageGenerationCall; + } + /// /// A tool call to run code. /// @@ -237,6 +393,19 @@ namespace tryAGI.OpenAI #endif public bool IsCodeInterpreterCall => CodeInterpreterCall != null; + /// + /// + /// + public bool TryPickCodeInterpreterCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CodeInterpreterToolCall? value) + { + value = CodeInterpreterCall; + return IsCodeInterpreterCall; + } + /// /// A tool call to run a command on the local shell. /// @@ -254,6 +423,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocalShellCall => LocalShellCall != null; + /// + /// + /// + public bool TryPickLocalShellCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalShellToolCall? value) + { + value = LocalShellCall; + return IsLocalShellCall; + } + /// /// The output of a local shell tool call. /// @@ -271,6 +453,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocalShellCallOutput => LocalShellCallOutput != null; + /// + /// + /// + public bool TryPickLocalShellCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalShellToolCallOutput? value) + { + value = LocalShellCallOutput; + return IsLocalShellCallOutput; + } + /// /// A tool call that executes one or more shell commands in a managed environment. /// @@ -288,6 +483,19 @@ namespace tryAGI.OpenAI #endif public bool IsShellCall => ShellCall != null; + /// + /// + /// + public bool TryPickShellCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCall? value) + { + value = ShellCall; + return IsShellCall; + } + /// /// The output of a shell tool call that was emitted. /// @@ -305,6 +513,19 @@ namespace tryAGI.OpenAI #endif public bool IsShellCallOutput => ShellCallOutput != null; + /// + /// + /// + public bool TryPickShellCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellCallOutput? value) + { + value = ShellCallOutput; + return IsShellCallOutput; + } + /// /// A tool call that applies file diffs by creating, deleting, or updating files. /// @@ -322,6 +543,19 @@ namespace tryAGI.OpenAI #endif public bool IsApplyPatchCall => ApplyPatchCall != null; + /// + /// + /// + public bool TryPickApplyPatchCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchToolCall? value) + { + value = ApplyPatchCall; + return IsApplyPatchCall; + } + /// /// The output emitted by an apply patch tool call. /// @@ -339,6 +573,19 @@ namespace tryAGI.OpenAI #endif public bool IsApplyPatchCallOutput => ApplyPatchCallOutput != null; + /// + /// + /// + public bool TryPickApplyPatchCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchToolCallOutput? value) + { + value = ApplyPatchCallOutput; + return IsApplyPatchCallOutput; + } + /// /// An invocation of a tool on an MCP server. /// @@ -356,6 +603,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpCall => McpCall != null; + /// + /// + /// + public bool TryPickMcpCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPToolCall? value) + { + value = McpCall; + return IsMcpCall; + } + /// /// A list of tools available on an MCP server. /// @@ -373,6 +633,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpListTools => McpListTools != null; + /// + /// + /// + public bool TryPickMcpListTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPListTools? value) + { + value = McpListTools; + return IsMcpListTools; + } + /// /// A request for human approval of a tool invocation. /// @@ -390,6 +663,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpApprovalRequest => McpApprovalRequest != null; + /// + /// + /// + public bool TryPickMcpApprovalRequest( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPApprovalRequest? value) + { + value = McpApprovalRequest; + return IsMcpApprovalRequest; + } + /// /// A response to an MCP approval request. /// @@ -407,6 +693,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpApprovalResponse => McpApprovalResponse != null; + /// + /// + /// + public bool TryPickMcpApprovalResponse( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPApprovalResponseResource? value) + { + value = McpApprovalResponse; + return IsMcpApprovalResponse; + } + /// /// A call to a custom tool created by the model. /// @@ -424,6 +723,19 @@ namespace tryAGI.OpenAI #endif public bool IsCustomToolCall => CustomToolCall != null; + /// + /// + /// + public bool TryPickCustomToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCall? value) + { + value = CustomToolCall; + return IsCustomToolCall; + } + /// /// /// @@ -440,6 +752,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseCustomToolCallOutputItem))] #endif public bool IsResponseCustomToolCallOutputItem => ResponseCustomToolCallOutputItem != null; + + /// + /// + /// + public bool TryPickResponseCustomToolCallOutputItem( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolCallOutputResource? value) + { + value = ResponseCustomToolCallOutputItem; + return IsResponseCustomToolCallOutputItem; + } /// /// /// @@ -1022,30 +1347,30 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? message = null, - global::System.Func? fileSearchCall = null, - global::System.Func? functionCall = null, + global::System.Func? message = null, + global::System.Func? fileSearchCall = null, + global::System.Func? functionCall = null, global::System.Func? functionToolCallResource = null, - global::System.Func? webSearchCall = null, - global::System.Func? computerCall = null, + global::System.Func? webSearchCall = null, + global::System.Func? computerCall = null, global::System.Func? computerToolCallResource = null, - global::System.Func? reasoning = null, - global::System.Func? toolSearchCall = null, - global::System.Func? toolSearchOutput = null, - global::System.Func? compaction = null, - global::System.Func? imageGenerationCall = null, - global::System.Func? codeInterpreterCall = null, - global::System.Func? localShellCall = null, - global::System.Func? localShellCallOutput = null, - global::System.Func? shellCall = null, - global::System.Func? shellCallOutput = null, - global::System.Func? applyPatchCall = null, - global::System.Func? applyPatchCallOutput = null, - global::System.Func? mcpCall = null, - global::System.Func? mcpListTools = null, - global::System.Func? mcpApprovalRequest = null, - global::System.Func? mcpApprovalResponse = null, - global::System.Func? customToolCall = null, + global::System.Func? reasoning = null, + global::System.Func? toolSearchCall = null, + global::System.Func? toolSearchOutput = null, + global::System.Func? compaction = null, + global::System.Func? imageGenerationCall = null, + global::System.Func? codeInterpreterCall = null, + global::System.Func? localShellCall = null, + global::System.Func? localShellCallOutput = null, + global::System.Func? shellCall = null, + global::System.Func? shellCallOutput = null, + global::System.Func? applyPatchCall = null, + global::System.Func? applyPatchCallOutput = null, + global::System.Func? mcpCall = null, + global::System.Func? mcpListTools = null, + global::System.Func? mcpApprovalRequest = null, + global::System.Func? mcpApprovalResponse = null, + global::System.Func? customToolCall = null, global::System.Func? responseCustomToolCallOutputItem = null, bool validate = true) { @@ -1162,30 +1487,192 @@ public bool Validate() /// ///
public void Match( - global::System.Action? message = null, - global::System.Action? fileSearchCall = null, - global::System.Action? functionCall = null, + global::System.Action? message = null, + + global::System.Action? fileSearchCall = null, + + global::System.Action? functionCall = null, + + global::System.Action? functionToolCallResource = null, + + global::System.Action? webSearchCall = null, + + global::System.Action? computerCall = null, + + global::System.Action? computerToolCallResource = null, + + global::System.Action? reasoning = null, + + global::System.Action? toolSearchCall = null, + + global::System.Action? toolSearchOutput = null, + + global::System.Action? compaction = null, + + global::System.Action? imageGenerationCall = null, + + global::System.Action? codeInterpreterCall = null, + + global::System.Action? localShellCall = null, + + global::System.Action? localShellCallOutput = null, + + global::System.Action? shellCall = null, + + global::System.Action? shellCallOutput = null, + + global::System.Action? applyPatchCall = null, + + global::System.Action? applyPatchCallOutput = null, + + global::System.Action? mcpCall = null, + + global::System.Action? mcpListTools = null, + + global::System.Action? mcpApprovalRequest = null, + + global::System.Action? mcpApprovalResponse = null, + + global::System.Action? customToolCall = null, + + global::System.Action? responseCustomToolCallOutputItem = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMessage) + { + message?.Invoke(Message!); + } + else if (IsFileSearchCall) + { + fileSearchCall?.Invoke(FileSearchCall!); + } + else if (IsFunctionCall) + { + functionCall?.Invoke(FunctionCall!); + } + else if (IsFunctionToolCallResource) + { + functionToolCallResource?.Invoke(FunctionToolCallResource!); + } + else if (IsWebSearchCall) + { + webSearchCall?.Invoke(WebSearchCall!); + } + else if (IsComputerCall) + { + computerCall?.Invoke(ComputerCall!); + } + else if (IsComputerToolCallResource) + { + computerToolCallResource?.Invoke(ComputerToolCallResource!); + } + else if (IsReasoning) + { + reasoning?.Invoke(Reasoning!); + } + else if (IsToolSearchCall) + { + toolSearchCall?.Invoke(ToolSearchCall!); + } + else if (IsToolSearchOutput) + { + toolSearchOutput?.Invoke(ToolSearchOutput!); + } + else if (IsCompaction) + { + compaction?.Invoke(Compaction!); + } + else if (IsImageGenerationCall) + { + imageGenerationCall?.Invoke(ImageGenerationCall!); + } + else if (IsCodeInterpreterCall) + { + codeInterpreterCall?.Invoke(CodeInterpreterCall!); + } + else if (IsLocalShellCall) + { + localShellCall?.Invoke(LocalShellCall!); + } + else if (IsLocalShellCallOutput) + { + localShellCallOutput?.Invoke(LocalShellCallOutput!); + } + else if (IsShellCall) + { + shellCall?.Invoke(ShellCall!); + } + else if (IsShellCallOutput) + { + shellCallOutput?.Invoke(ShellCallOutput!); + } + else if (IsApplyPatchCall) + { + applyPatchCall?.Invoke(ApplyPatchCall!); + } + else if (IsApplyPatchCallOutput) + { + applyPatchCallOutput?.Invoke(ApplyPatchCallOutput!); + } + else if (IsMcpCall) + { + mcpCall?.Invoke(McpCall!); + } + else if (IsMcpListTools) + { + mcpListTools?.Invoke(McpListTools!); + } + else if (IsMcpApprovalRequest) + { + mcpApprovalRequest?.Invoke(McpApprovalRequest!); + } + else if (IsMcpApprovalResponse) + { + mcpApprovalResponse?.Invoke(McpApprovalResponse!); + } + else if (IsCustomToolCall) + { + customToolCall?.Invoke(CustomToolCall!); + } + else if (IsResponseCustomToolCallOutputItem) + { + responseCustomToolCallOutputItem?.Invoke(ResponseCustomToolCallOutputItem!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? message = null, + global::System.Action? fileSearchCall = null, + global::System.Action? functionCall = null, global::System.Action? functionToolCallResource = null, - global::System.Action? webSearchCall = null, - global::System.Action? computerCall = null, + global::System.Action? webSearchCall = null, + global::System.Action? computerCall = null, global::System.Action? computerToolCallResource = null, - global::System.Action? reasoning = null, - global::System.Action? toolSearchCall = null, - global::System.Action? toolSearchOutput = null, - global::System.Action? compaction = null, - global::System.Action? imageGenerationCall = null, - global::System.Action? codeInterpreterCall = null, - global::System.Action? localShellCall = null, - global::System.Action? localShellCallOutput = null, - global::System.Action? shellCall = null, - global::System.Action? shellCallOutput = null, - global::System.Action? applyPatchCall = null, - global::System.Action? applyPatchCallOutput = null, - global::System.Action? mcpCall = null, - global::System.Action? mcpListTools = null, - global::System.Action? mcpApprovalRequest = null, - global::System.Action? mcpApprovalResponse = null, - global::System.Action? customToolCall = null, + global::System.Action? reasoning = null, + global::System.Action? toolSearchCall = null, + global::System.Action? toolSearchOutput = null, + global::System.Action? compaction = null, + global::System.Action? imageGenerationCall = null, + global::System.Action? codeInterpreterCall = null, + global::System.Action? localShellCall = null, + global::System.Action? localShellCallOutput = null, + global::System.Action? shellCall = null, + global::System.Action? shellCallOutput = null, + global::System.Action? applyPatchCall = null, + global::System.Action? applyPatchCallOutput = null, + global::System.Action? mcpCall = null, + global::System.Action? mcpListTools = null, + global::System.Action? mcpApprovalRequest = null, + global::System.Action? mcpApprovalResponse = null, + global::System.Action? customToolCall = null, global::System.Action? responseCustomToolCallOutputItem = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputMessageContent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputMessageContent.g.cs index d0c7d68f..bd2d91ee 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputMessageContent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputMessageContent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsOutputText => OutputText != null; + /// + /// + /// + public bool TryPickOutputText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.OutputTextContent? value) + { + value = OutputText; + return IsOutputText; + } + /// /// A refusal from the model. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Refusal))] #endif public bool IsRefusal => Refusal != null; + + /// + /// + /// + public bool TryPickRefusal( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RefusalContent? value) + { + value = Refusal; + return IsRefusal; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? outputText = null, - global::System.Func? refusal = null, + global::System.Func? outputText = null, + global::System.Func? refusal = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? outputText = null, - global::System.Action? refusal = null, + global::System.Action? outputText = null, + + global::System.Action? refusal = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOutputText) + { + outputText?.Invoke(OutputText!); + } + else if (IsRefusal) + { + refusal?.Invoke(Refusal!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? outputText = null, + global::System.Action? refusal = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputVariant2Item.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputVariant2Item.g.cs index 09b84f5a..fa737878 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputVariant2Item.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputVariant2Item.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputText => InputText != null; + /// + /// + /// + public bool TryPickInputText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputTextContentParam? value) + { + value = InputText; + return IsInputText; + } + /// /// An image input to the model. Learn about [image inputs](/docs/guides/vision) /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputImage => InputImage != null; + /// + /// + /// + public bool TryPickInputImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputImageContentParamAutoParam? value) + { + value = InputImage; + return IsInputImage; + } + /// /// A file input to the model. /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(InputFile))] #endif public bool IsInputFile => InputFile != null; + + /// + /// + /// + public bool TryPickInputFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InputFileContentParam? value) + { + value = InputFile; + return IsInputFile; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? inputText = null, - global::System.Func? inputImage = null, - global::System.Func? inputFile = null, + global::System.Func? inputText = null, + global::System.Func? inputImage = null, + global::System.Func? inputFile = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? inputText = null, - global::System.Action? inputImage = null, - global::System.Action? inputFile = null, + global::System.Action? inputText = null, + + global::System.Action? inputImage = null, + + global::System.Action? inputFile = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsInputText) + { + inputText?.Invoke(InputText!); + } + else if (IsInputImage) + { + inputImage?.Invoke(InputImage!); + } + else if (IsInputFile) + { + inputFile?.Invoke(InputFile!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? inputText = null, + global::System.Action? inputImage = null, + global::System.Action? inputFile = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputsVariant1Item.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputsVariant1Item.g.cs index 61d78cd9..6b9ecaf2 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputsVariant1Item.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.OutputsVariant1Item.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsLogs => Logs != null; + /// + /// + /// + public bool TryPickLogs( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CodeInterpreterOutputLogs? value) + { + value = Logs; + return IsLogs; + } + /// /// The image output from the code interpreter. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif public bool IsImage => Image != null; + + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CodeInterpreterOutputImage? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? logs = null, - global::System.Func? image = null, + global::System.Func? logs = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? logs = null, - global::System.Action? image = null, + global::System.Action? logs = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsLogs) + { + logs?.Invoke(Logs!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? logs = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeAudioFormats.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeAudioFormats.g.cs index d1733f7c..11bace58 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeAudioFormats.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeAudioFormats.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsPcmAudioFormat => PcmAudioFormat != null; + /// + /// + /// + public bool TryPickPcmAudioFormat( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeAudioFormatsPcmAudioFormat? value) + { + value = PcmAudioFormat; + return IsPcmAudioFormat; + } + /// /// The G.711 μ-law format. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsPcmuAudioFormat => PcmuAudioFormat != null; + /// + /// + /// + public bool TryPickPcmuAudioFormat( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeAudioFormatsPcmuAudioFormat? value) + { + value = PcmuAudioFormat; + return IsPcmuAudioFormat; + } + /// /// The G.711 A-law format. /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(PcmaAudioFormat))] #endif public bool IsPcmaAudioFormat => PcmaAudioFormat != null; + + /// + /// + /// + public bool TryPickPcmaAudioFormat( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeAudioFormatsPcmaAudioFormat? value) + { + value = PcmaAudioFormat; + return IsPcmaAudioFormat; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? pcmAudioFormat = null, - global::System.Func? pcmuAudioFormat = null, - global::System.Func? pcmaAudioFormat = null, + global::System.Func? pcmAudioFormat = null, + global::System.Func? pcmuAudioFormat = null, + global::System.Func? pcmaAudioFormat = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? pcmAudioFormat = null, - global::System.Action? pcmuAudioFormat = null, - global::System.Action? pcmaAudioFormat = null, + global::System.Action? pcmAudioFormat = null, + + global::System.Action? pcmuAudioFormat = null, + + global::System.Action? pcmaAudioFormat = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsPcmAudioFormat) + { + pcmAudioFormat?.Invoke(PcmAudioFormat!); + } + else if (IsPcmuAudioFormat) + { + pcmuAudioFormat?.Invoke(PcmuAudioFormat!); + } + else if (IsPcmaAudioFormat) + { + pcmaAudioFormat?.Invoke(PcmaAudioFormat!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? pcmAudioFormat = null, + global::System.Action? pcmuAudioFormat = null, + global::System.Action? pcmaAudioFormat = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeClientEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeClientEvent.g.cs index 49f366b4..3f176ae4 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeClientEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeClientEvent.g.cs @@ -31,6 +31,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemCreate => ConversationItemCreate != null; + /// + /// + /// + public bool TryPickConversationItemCreate( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeClientEventConversationItemCreate? value) + { + value = ConversationItemCreate; + return IsConversationItemCreate; + } + /// /// Send this event when you want to remove any item from the conversation
/// history. The server will respond with a `conversation.item.deleted` event,
@@ -51,6 +64,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemDelete => ConversationItemDelete != null; + /// + /// + /// + public bool TryPickConversationItemDelete( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeClientEventConversationItemDelete? value) + { + value = ConversationItemDelete; + return IsConversationItemDelete; + } + /// /// Send this event when you want to retrieve the server's representation of a specific item in the conversation history. This is useful, for example, to inspect user audio after noise cancellation and VAD.
/// The server will respond with a `conversation.item.retrieved` event,
@@ -71,6 +97,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemRetrieve => ConversationItemRetrieve != null; + /// + /// + /// + public bool TryPickConversationItemRetrieve( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeClientEventConversationItemRetrieve? value) + { + value = ConversationItemRetrieve; + return IsConversationItemRetrieve; + } + /// /// Send this event to truncate a previous assistant message’s audio. The server
/// will produce audio faster than realtime, so this event is useful when the user
@@ -96,6 +135,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemTruncate => ConversationItemTruncate != null; + /// + /// + /// + public bool TryPickConversationItemTruncate( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeClientEventConversationItemTruncate? value) + { + value = ConversationItemTruncate; + return IsConversationItemTruncate; + } + /// /// Send this event to append audio bytes to the input audio buffer. The audio
/// buffer is temporary storage you can write to and later commit. A "commit" will create a new
@@ -123,6 +175,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputAudioBufferAppend => InputAudioBufferAppend != null; + /// + /// + /// + public bool TryPickInputAudioBufferAppend( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeClientEventInputAudioBufferAppend? value) + { + value = InputAudioBufferAppend; + return IsInputAudioBufferAppend; + } + /// /// Send this event to clear the audio bytes in the buffer. The server will
/// respond with an `input_audio_buffer.cleared` event. @@ -141,6 +206,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputAudioBufferClear => InputAudioBufferClear != null; + /// + /// + /// + public bool TryPickInputAudioBufferClear( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeClientEventInputAudioBufferClear? value) + { + value = InputAudioBufferClear; + return IsInputAudioBufferClear; + } + /// /// **WebRTC/SIP Only:** Emit to cut off the current audio response. This will trigger the server to
/// stop generating audio and emit a `output_audio_buffer.cleared` event. This
@@ -162,6 +240,19 @@ namespace tryAGI.OpenAI #endif public bool IsOutputAudioBufferClear => OutputAudioBufferClear != null; + /// + /// + /// + public bool TryPickOutputAudioBufferClear( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeClientEventOutputAudioBufferClear? value) + { + value = OutputAudioBufferClear; + return IsOutputAudioBufferClear; + } + /// /// Send this event to commit the user input audio buffer, which will create a new user message item in the conversation. This event will produce an error if the input audio buffer is empty. When in Server VAD mode, the client does not need to send this event, the server will commit the audio buffer automatically.
/// Committing the input audio buffer will trigger input audio transcription (if enabled in session configuration), but it will not create a response from the model. The server will respond with an `input_audio_buffer.committed` event. @@ -180,6 +271,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputAudioBufferCommit => InputAudioBufferCommit != null; + /// + /// + /// + public bool TryPickInputAudioBufferCommit( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeClientEventInputAudioBufferCommit? value) + { + value = InputAudioBufferCommit; + return IsInputAudioBufferCommit; + } + /// /// Send this event to cancel an in-progress response. The server will respond
/// with a `response.done` event with a status of `response.status=cancelled`. If
@@ -201,6 +305,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCancel => ResponseCancel != null; + /// + /// + /// + public bool TryPickResponseCancel( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeClientEventResponseCancel? value) + { + value = ResponseCancel; + return IsResponseCancel; + } + /// /// This event instructs the server to create a Response, which means triggering
/// model inference. When in Server VAD mode, the server will create Responses
@@ -237,6 +354,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCreate => ResponseCreate != null; + /// + /// + /// + public bool TryPickResponseCreate( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeClientEventResponseCreate? value) + { + value = ResponseCreate; + return IsResponseCreate; + } + /// /// Send this event to update the session’s configuration.
/// The client may send this event at any time to update any field
@@ -260,6 +390,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SessionUpdate))] #endif public bool IsSessionUpdate => SessionUpdate != null; + + /// + /// + /// + public bool TryPickSessionUpdate( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeClientEventSessionUpdate? value) + { + value = SessionUpdate; + return IsSessionUpdate; + } /// /// /// @@ -534,17 +677,17 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? conversationItemCreate = null, - global::System.Func? conversationItemDelete = null, - global::System.Func? conversationItemRetrieve = null, - global::System.Func? conversationItemTruncate = null, - global::System.Func? inputAudioBufferAppend = null, - global::System.Func? inputAudioBufferClear = null, - global::System.Func? outputAudioBufferClear = null, - global::System.Func? inputAudioBufferCommit = null, - global::System.Func? responseCancel = null, - global::System.Func? responseCreate = null, - global::System.Func? sessionUpdate = null, + global::System.Func? conversationItemCreate = null, + global::System.Func? conversationItemDelete = null, + global::System.Func? conversationItemRetrieve = null, + global::System.Func? conversationItemTruncate = null, + global::System.Func? inputAudioBufferAppend = null, + global::System.Func? inputAudioBufferClear = null, + global::System.Func? outputAudioBufferClear = null, + global::System.Func? inputAudioBufferCommit = null, + global::System.Func? responseCancel = null, + global::System.Func? responseCreate = null, + global::System.Func? sessionUpdate = null, bool validate = true) { if (validate) @@ -604,17 +747,95 @@ public bool Validate() /// ///
public void Match( - global::System.Action? conversationItemCreate = null, - global::System.Action? conversationItemDelete = null, - global::System.Action? conversationItemRetrieve = null, - global::System.Action? conversationItemTruncate = null, - global::System.Action? inputAudioBufferAppend = null, - global::System.Action? inputAudioBufferClear = null, - global::System.Action? outputAudioBufferClear = null, - global::System.Action? inputAudioBufferCommit = null, - global::System.Action? responseCancel = null, - global::System.Action? responseCreate = null, - global::System.Action? sessionUpdate = null, + global::System.Action? conversationItemCreate = null, + + global::System.Action? conversationItemDelete = null, + + global::System.Action? conversationItemRetrieve = null, + + global::System.Action? conversationItemTruncate = null, + + global::System.Action? inputAudioBufferAppend = null, + + global::System.Action? inputAudioBufferClear = null, + + global::System.Action? outputAudioBufferClear = null, + + global::System.Action? inputAudioBufferCommit = null, + + global::System.Action? responseCancel = null, + + global::System.Action? responseCreate = null, + + global::System.Action? sessionUpdate = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsConversationItemCreate) + { + conversationItemCreate?.Invoke(ConversationItemCreate!); + } + else if (IsConversationItemDelete) + { + conversationItemDelete?.Invoke(ConversationItemDelete!); + } + else if (IsConversationItemRetrieve) + { + conversationItemRetrieve?.Invoke(ConversationItemRetrieve!); + } + else if (IsConversationItemTruncate) + { + conversationItemTruncate?.Invoke(ConversationItemTruncate!); + } + else if (IsInputAudioBufferAppend) + { + inputAudioBufferAppend?.Invoke(InputAudioBufferAppend!); + } + else if (IsInputAudioBufferClear) + { + inputAudioBufferClear?.Invoke(InputAudioBufferClear!); + } + else if (IsOutputAudioBufferClear) + { + outputAudioBufferClear?.Invoke(OutputAudioBufferClear!); + } + else if (IsInputAudioBufferCommit) + { + inputAudioBufferCommit?.Invoke(InputAudioBufferCommit!); + } + else if (IsResponseCancel) + { + responseCancel?.Invoke(ResponseCancel!); + } + else if (IsResponseCreate) + { + responseCreate?.Invoke(ResponseCreate!); + } + else if (IsSessionUpdate) + { + sessionUpdate?.Invoke(SessionUpdate!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? conversationItemCreate = null, + global::System.Action? conversationItemDelete = null, + global::System.Action? conversationItemRetrieve = null, + global::System.Action? conversationItemTruncate = null, + global::System.Action? inputAudioBufferAppend = null, + global::System.Action? inputAudioBufferClear = null, + global::System.Action? outputAudioBufferClear = null, + global::System.Action? inputAudioBufferCommit = null, + global::System.Action? responseCancel = null, + global::System.Action? responseCreate = null, + global::System.Action? sessionUpdate = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeConversationItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeConversationItem.g.cs index 6634e375..e6d329e9 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeConversationItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeConversationItem.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessage1 => Message1 != null; + /// + /// + /// + public bool TryPickMessage1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeConversationItemMessageSystem? value) + { + value = Message1; + return IsMessage1; + } + /// /// A user message item in a Realtime conversation. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessage2 => Message2 != null; + /// + /// + /// + public bool TryPickMessage2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeConversationItemMessageUser? value) + { + value = Message2; + return IsMessage2; + } + /// /// An assistant message item in a Realtime conversation. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsMessage3 => Message3 != null; + /// + /// + /// + public bool TryPickMessage3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeConversationItemMessageAssistant? value) + { + value = Message3; + return IsMessage3; + } + /// /// A function call item in a Realtime conversation. /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionCall => FunctionCall != null; + /// + /// + /// + public bool TryPickFunctionCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeConversationItemFunctionCall? value) + { + value = FunctionCall; + return IsFunctionCall; + } + /// /// A function call output item in a Realtime conversation. /// @@ -94,6 +146,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionCallOutput => FunctionCallOutput != null; + /// + /// + /// + public bool TryPickFunctionCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeConversationItemFunctionCallOutput? value) + { + value = FunctionCallOutput; + return IsFunctionCallOutput; + } + /// /// A Realtime item responding to an MCP approval request. /// @@ -111,6 +176,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpApprovalResponse => McpApprovalResponse != null; + /// + /// + /// + public bool TryPickMcpApprovalResponse( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeMCPApprovalResponse? value) + { + value = McpApprovalResponse; + return IsMcpApprovalResponse; + } + /// /// A Realtime item listing tools available on an MCP server. /// @@ -128,6 +206,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpListTools => McpListTools != null; + /// + /// + /// + public bool TryPickMcpListTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeMCPListTools? value) + { + value = McpListTools; + return IsMcpListTools; + } + /// /// A Realtime item representing an invocation of a tool on an MCP server. /// @@ -145,6 +236,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpCall => McpCall != null; + /// + /// + /// + public bool TryPickMcpCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeMCPToolCall? value) + { + value = McpCall; + return IsMcpCall; + } + /// /// A Realtime item requesting human approval of a tool invocation. /// @@ -161,6 +265,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(McpApprovalRequest))] #endif public bool IsMcpApprovalRequest => McpApprovalRequest != null; + + /// + /// + /// + public bool TryPickMcpApprovalRequest( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeMCPApprovalRequest? value) + { + value = McpApprovalRequest; + return IsMcpApprovalRequest; + } /// /// /// @@ -391,15 +508,15 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? message1 = null, - global::System.Func? message2 = null, - global::System.Func? message3 = null, - global::System.Func? functionCall = null, - global::System.Func? functionCallOutput = null, - global::System.Func? mcpApprovalResponse = null, - global::System.Func? mcpListTools = null, - global::System.Func? mcpCall = null, - global::System.Func? mcpApprovalRequest = null, + global::System.Func? message1 = null, + global::System.Func? message2 = null, + global::System.Func? message3 = null, + global::System.Func? functionCall = null, + global::System.Func? functionCallOutput = null, + global::System.Func? mcpApprovalResponse = null, + global::System.Func? mcpListTools = null, + global::System.Func? mcpCall = null, + global::System.Func? mcpApprovalRequest = null, bool validate = true) { if (validate) @@ -451,15 +568,81 @@ public bool Validate() /// ///
public void Match( - global::System.Action? message1 = null, - global::System.Action? message2 = null, - global::System.Action? message3 = null, - global::System.Action? functionCall = null, - global::System.Action? functionCallOutput = null, - global::System.Action? mcpApprovalResponse = null, - global::System.Action? mcpListTools = null, - global::System.Action? mcpCall = null, - global::System.Action? mcpApprovalRequest = null, + global::System.Action? message1 = null, + + global::System.Action? message2 = null, + + global::System.Action? message3 = null, + + global::System.Action? functionCall = null, + + global::System.Action? functionCallOutput = null, + + global::System.Action? mcpApprovalResponse = null, + + global::System.Action? mcpListTools = null, + + global::System.Action? mcpCall = null, + + global::System.Action? mcpApprovalRequest = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMessage1) + { + message1?.Invoke(Message1!); + } + else if (IsMessage2) + { + message2?.Invoke(Message2!); + } + else if (IsMessage3) + { + message3?.Invoke(Message3!); + } + else if (IsFunctionCall) + { + functionCall?.Invoke(FunctionCall!); + } + else if (IsFunctionCallOutput) + { + functionCallOutput?.Invoke(FunctionCallOutput!); + } + else if (IsMcpApprovalResponse) + { + mcpApprovalResponse?.Invoke(McpApprovalResponse!); + } + else if (IsMcpListTools) + { + mcpListTools?.Invoke(McpListTools!); + } + else if (IsMcpCall) + { + mcpCall?.Invoke(McpCall!); + } + else if (IsMcpApprovalRequest) + { + mcpApprovalRequest?.Invoke(McpApprovalRequest!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? message1 = null, + global::System.Action? message2 = null, + global::System.Action? message3 = null, + global::System.Action? functionCall = null, + global::System.Action? functionCallOutput = null, + global::System.Action? mcpApprovalResponse = null, + global::System.Action? mcpListTools = null, + global::System.Action? mcpCall = null, + global::System.Action? mcpApprovalRequest = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeServerEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeServerEvent.g.cs index e2924110..bd7d26c9 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeServerEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeServerEvent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationCreated => ConversationCreated != null; + /// + /// + /// + public bool TryPickConversationCreated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventConversationCreated? value) + { + value = ConversationCreated; + return IsConversationCreated; + } + /// /// Returned when a conversation item is created. There are several scenarios that produce this event:
/// - The server is generating a Response, which if successful will produce
@@ -51,6 +64,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemCreated => ConversationItemCreated != null; + /// + /// + /// + public bool TryPickConversationItemCreated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventConversationItemCreated? value) + { + value = ConversationItemCreated; + return IsConversationItemCreated; + } + /// /// Returned when an item in the conversation is deleted by the client with a
/// `conversation.item.delete` event. This event is used to synchronize the
@@ -70,6 +96,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemDeleted => ConversationItemDeleted != null; + /// + /// + /// + public bool TryPickConversationItemDeleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventConversationItemDeleted? value) + { + value = ConversationItemDeleted; + return IsConversationItemDeleted; + } + /// /// This event is the output of audio transcription for user audio written to the
/// user audio buffer. Transcription begins when the input audio buffer is
@@ -95,6 +134,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemInputAudioTranscriptionCompleted => ConversationItemInputAudioTranscriptionCompleted != null; + /// + /// + /// + public bool TryPickConversationItemInputAudioTranscriptionCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted? value) + { + value = ConversationItemInputAudioTranscriptionCompleted; + return IsConversationItemInputAudioTranscriptionCompleted; + } + /// /// Returned when the text value of an input audio transcription content part is updated with incremental transcription results. /// @@ -112,6 +164,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemInputAudioTranscriptionDelta => ConversationItemInputAudioTranscriptionDelta != null; + /// + /// + /// + public bool TryPickConversationItemInputAudioTranscriptionDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionDelta? value) + { + value = ConversationItemInputAudioTranscriptionDelta; + return IsConversationItemInputAudioTranscriptionDelta; + } + /// /// Returned when input audio transcription is configured, and a transcription
/// request for a user message failed. These events are separate from other
@@ -131,6 +196,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemInputAudioTranscriptionFailed => ConversationItemInputAudioTranscriptionFailed != null; + /// + /// + /// + public bool TryPickConversationItemInputAudioTranscriptionFailed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionFailed? value) + { + value = ConversationItemInputAudioTranscriptionFailed; + return IsConversationItemInputAudioTranscriptionFailed; + } + /// /// Returned when a conversation item is retrieved with `conversation.item.retrieve`. This is provided as a way to fetch the server's representation of an item, for example to get access to the post-processed audio data after noise cancellation and VAD. It includes the full content of the Item, including audio data. /// @@ -148,6 +226,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemRetrieved => ConversationItemRetrieved != null; + /// + /// + /// + public bool TryPickConversationItemRetrieved( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventConversationItemRetrieved? value) + { + value = ConversationItemRetrieved; + return IsConversationItemRetrieved; + } + /// /// Returned when an earlier assistant audio message item is truncated by the
/// client with a `conversation.item.truncate` event. This event is used to
@@ -169,6 +260,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemTruncated => ConversationItemTruncated != null; + /// + /// + /// + public bool TryPickConversationItemTruncated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventConversationItemTruncated? value) + { + value = ConversationItemTruncated; + return IsConversationItemTruncated; + } + /// /// Returned when an error occurs, which could be a client problem or a server
/// problem. Most errors are recoverable and the session will stay open, we
@@ -188,6 +292,19 @@ namespace tryAGI.OpenAI #endif public bool IsError => Error != null; + /// + /// + /// + public bool TryPickError( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventError? value) + { + value = Error; + return IsError; + } + /// /// Returned when the input audio buffer is cleared by the client with a
/// `input_audio_buffer.clear` event. @@ -206,6 +323,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputAudioBufferCleared => InputAudioBufferCleared != null; + /// + /// + /// + public bool TryPickInputAudioBufferCleared( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventInputAudioBufferCleared? value) + { + value = InputAudioBufferCleared; + return IsInputAudioBufferCleared; + } + /// /// Returned when an input audio buffer is committed, either by the client or
/// automatically in server VAD mode. The `item_id` property is the ID of the user
@@ -226,6 +356,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputAudioBufferCommitted => InputAudioBufferCommitted != null; + /// + /// + /// + public bool TryPickInputAudioBufferCommitted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventInputAudioBufferCommitted? value) + { + value = InputAudioBufferCommitted; + return IsInputAudioBufferCommitted; + } + /// /// **SIP Only:** Returned when an DTMF event is received. A DTMF event is a message that
/// represents a telephone keypad press (0–9, *, #, A–D). The `event` property
@@ -246,6 +389,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputAudioBufferDtmfEventReceived => InputAudioBufferDtmfEventReceived != null; + /// + /// + /// + public bool TryPickInputAudioBufferDtmfEventReceived( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventInputAudioBufferDtmfEventReceived? value) + { + value = InputAudioBufferDtmfEventReceived; + return IsInputAudioBufferDtmfEventReceived; + } + /// /// Sent by the server when in `server_vad` mode to indicate that speech has been
/// detected in the audio buffer. This can happen any time audio is added to the
@@ -271,6 +427,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputAudioBufferSpeechStarted => InputAudioBufferSpeechStarted != null; + /// + /// + /// + public bool TryPickInputAudioBufferSpeechStarted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventInputAudioBufferSpeechStarted? value) + { + value = InputAudioBufferSpeechStarted; + return IsInputAudioBufferSpeechStarted; + } + /// /// Returned in `server_vad` mode when the server detects the end of speech in
/// the audio buffer. The server will also send an `conversation.item.created`
@@ -290,6 +459,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputAudioBufferSpeechStopped => InputAudioBufferSpeechStopped != null; + /// + /// + /// + public bool TryPickInputAudioBufferSpeechStopped( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventInputAudioBufferSpeechStopped? value) + { + value = InputAudioBufferSpeechStopped; + return IsInputAudioBufferSpeechStopped; + } + /// /// Emitted at the beginning of a Response to indicate the updated rate limits.
/// When a Response is created some tokens will be "reserved" for the output
@@ -310,6 +492,19 @@ namespace tryAGI.OpenAI #endif public bool IsRateLimitsUpdated => RateLimitsUpdated != null; + /// + /// + /// + public bool TryPickRateLimitsUpdated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventRateLimitsUpdated? value) + { + value = RateLimitsUpdated; + return IsRateLimitsUpdated; + } + /// /// Returned when the model-generated audio is updated. /// @@ -327,6 +522,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputAudioDelta => ResponseOutputAudioDelta != null; + /// + /// + /// + public bool TryPickResponseOutputAudioDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseAudioDelta? value) + { + value = ResponseOutputAudioDelta; + return IsResponseOutputAudioDelta; + } + /// /// Returned when the model-generated audio is done. Also emitted when a Response
/// is interrupted, incomplete, or cancelled. @@ -345,6 +553,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputAudioDone => ResponseOutputAudioDone != null; + /// + /// + /// + public bool TryPickResponseOutputAudioDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseAudioDone? value) + { + value = ResponseOutputAudioDone; + return IsResponseOutputAudioDone; + } + /// /// Returned when the model-generated transcription of audio output is updated. /// @@ -362,6 +583,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputAudioTranscriptDelta => ResponseOutputAudioTranscriptDelta != null; + /// + /// + /// + public bool TryPickResponseOutputAudioTranscriptDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseAudioTranscriptDelta? value) + { + value = ResponseOutputAudioTranscriptDelta; + return IsResponseOutputAudioTranscriptDelta; + } + /// /// Returned when the model-generated transcription of audio output is done
/// streaming. Also emitted when a Response is interrupted, incomplete, or
@@ -381,6 +615,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputAudioTranscriptDone => ResponseOutputAudioTranscriptDone != null; + /// + /// + /// + public bool TryPickResponseOutputAudioTranscriptDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseAudioTranscriptDone? value) + { + value = ResponseOutputAudioTranscriptDone; + return IsResponseOutputAudioTranscriptDone; + } + /// /// Returned when a new content part is added to an assistant message item during
/// response generation. @@ -399,6 +646,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseContentPartAdded => ResponseContentPartAdded != null; + /// + /// + /// + public bool TryPickResponseContentPartAdded( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseContentPartAdded? value) + { + value = ResponseContentPartAdded; + return IsResponseContentPartAdded; + } + /// /// Returned when a content part is done streaming in an assistant message item.
/// Also emitted when a Response is interrupted, incomplete, or cancelled. @@ -417,6 +677,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseContentPartDone => ResponseContentPartDone != null; + /// + /// + /// + public bool TryPickResponseContentPartDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseContentPartDone? value) + { + value = ResponseContentPartDone; + return IsResponseContentPartDone; + } + /// /// Returned when a new Response is created. The first event of response creation,
/// where the response is in an initial state of `in_progress`. @@ -435,6 +708,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCreated => ResponseCreated != null; + /// + /// + /// + public bool TryPickResponseCreated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseCreated? value) + { + value = ResponseCreated; + return IsResponseCreated; + } + /// /// Returned when a Response is done streaming. Always emitted, no matter the
/// final state. The Response object included in the `response.done` event will
@@ -458,6 +744,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseDone => ResponseDone != null; + /// + /// + /// + public bool TryPickResponseDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseDone? value) + { + value = ResponseDone; + return IsResponseDone; + } + /// /// Returned when the model-generated function call arguments are updated. /// @@ -475,6 +774,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseFunctionCallArgumentsDelta => ResponseFunctionCallArgumentsDelta != null; + /// + /// + /// + public bool TryPickResponseFunctionCallArgumentsDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseFunctionCallArgumentsDelta? value) + { + value = ResponseFunctionCallArgumentsDelta; + return IsResponseFunctionCallArgumentsDelta; + } + /// /// Returned when the model-generated function call arguments are done streaming.
/// Also emitted when a Response is interrupted, incomplete, or cancelled. @@ -493,6 +805,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseFunctionCallArgumentsDone => ResponseFunctionCallArgumentsDone != null; + /// + /// + /// + public bool TryPickResponseFunctionCallArgumentsDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseFunctionCallArgumentsDone? value) + { + value = ResponseFunctionCallArgumentsDone; + return IsResponseFunctionCallArgumentsDone; + } + /// /// Returned when a new Item is created during Response generation. /// @@ -510,6 +835,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputItemAdded => ResponseOutputItemAdded != null; + /// + /// + /// + public bool TryPickResponseOutputItemAdded( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseOutputItemAdded? value) + { + value = ResponseOutputItemAdded; + return IsResponseOutputItemAdded; + } + /// /// Returned when an Item is done streaming. Also emitted when a Response is
/// interrupted, incomplete, or cancelled. @@ -528,6 +866,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputItemDone => ResponseOutputItemDone != null; + /// + /// + /// + public bool TryPickResponseOutputItemDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseOutputItemDone? value) + { + value = ResponseOutputItemDone; + return IsResponseOutputItemDone; + } + /// /// Returned when the text value of an "output_text" content part is updated. /// @@ -545,6 +896,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputTextDelta => ResponseOutputTextDelta != null; + /// + /// + /// + public bool TryPickResponseOutputTextDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseTextDelta? value) + { + value = ResponseOutputTextDelta; + return IsResponseOutputTextDelta; + } + /// /// Returned when the text value of an "output_text" content part is done streaming. Also
/// emitted when a Response is interrupted, incomplete, or cancelled. @@ -563,6 +927,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputTextDone => ResponseOutputTextDone != null; + /// + /// + /// + public bool TryPickResponseOutputTextDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseTextDone? value) + { + value = ResponseOutputTextDone; + return IsResponseOutputTextDone; + } + /// /// Returned when a Session is created. Emitted automatically when a new
/// connection is established as the first server event. This event will contain
@@ -582,6 +959,19 @@ namespace tryAGI.OpenAI #endif public bool IsSessionCreated => SessionCreated != null; + /// + /// + /// + public bool TryPickSessionCreated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventSessionCreated? value) + { + value = SessionCreated; + return IsSessionCreated; + } + /// /// Returned when a session is updated with a `session.update` event, unless
/// there is an error. @@ -600,6 +990,19 @@ namespace tryAGI.OpenAI #endif public bool IsSessionUpdated => SessionUpdated != null; + /// + /// + /// + public bool TryPickSessionUpdated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventSessionUpdated? value) + { + value = SessionUpdated; + return IsSessionUpdated; + } + /// /// **WebRTC/SIP Only:** Emitted when the server begins streaming audio to the client. This event is
/// emitted after an audio content part has been added (`response.content_part.added`)
@@ -620,6 +1023,19 @@ namespace tryAGI.OpenAI #endif public bool IsOutputAudioBufferStarted => OutputAudioBufferStarted != null; + /// + /// + /// + public bool TryPickOutputAudioBufferStarted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventOutputAudioBufferStarted? value) + { + value = OutputAudioBufferStarted; + return IsOutputAudioBufferStarted; + } + /// /// **WebRTC/SIP Only:** Emitted when the output audio buffer has been completely drained on the server,
/// and no more audio is forthcoming. This event is emitted after the full response
@@ -640,6 +1056,19 @@ namespace tryAGI.OpenAI #endif public bool IsOutputAudioBufferStopped => OutputAudioBufferStopped != null; + /// + /// + /// + public bool TryPickOutputAudioBufferStopped( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventOutputAudioBufferStopped? value) + { + value = OutputAudioBufferStopped; + return IsOutputAudioBufferStopped; + } + /// /// **WebRTC/SIP Only:** Emitted when the output audio buffer is cleared. This happens either in VAD
/// mode when the user has interrupted (`input_audio_buffer.speech_started`),
@@ -661,6 +1090,19 @@ namespace tryAGI.OpenAI #endif public bool IsOutputAudioBufferCleared => OutputAudioBufferCleared != null; + /// + /// + /// + public bool TryPickOutputAudioBufferCleared( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventOutputAudioBufferCleared? value) + { + value = OutputAudioBufferCleared; + return IsOutputAudioBufferCleared; + } + /// /// Sent by the server when an Item is added to the default Conversation. This can happen in several cases:
/// - When the client sends a `conversation.item.create` event.
@@ -682,6 +1124,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemAdded => ConversationItemAdded != null; + /// + /// + /// + public bool TryPickConversationItemAdded( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventConversationItemAdded? value) + { + value = ConversationItemAdded; + return IsConversationItemAdded; + } + /// /// Returned when a conversation item is finalized.
/// The event will include the full content of the Item except for audio data, which can be retrieved separately with a `conversation.item.retrieve` event if needed. @@ -700,6 +1155,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemDone => ConversationItemDone != null; + /// + /// + /// + public bool TryPickConversationItemDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventConversationItemDone? value) + { + value = ConversationItemDone; + return IsConversationItemDone; + } + /// /// Returned when the Server VAD timeout is triggered for the input audio buffer. This is configured
/// with `idle_timeout_ms` in the `turn_detection` settings of the session, and it indicates that
@@ -727,6 +1195,19 @@ namespace tryAGI.OpenAI #endif public bool IsInputAudioBufferTimeoutTriggered => InputAudioBufferTimeoutTriggered != null; + /// + /// + /// + public bool TryPickInputAudioBufferTimeoutTriggered( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventInputAudioBufferTimeoutTriggered? value) + { + value = InputAudioBufferTimeoutTriggered; + return IsInputAudioBufferTimeoutTriggered; + } + /// /// Returned when an input audio transcription segment is identified for an item. /// @@ -744,6 +1225,19 @@ namespace tryAGI.OpenAI #endif public bool IsConversationItemInputAudioTranscriptionSegment => ConversationItemInputAudioTranscriptionSegment != null; + /// + /// + /// + public bool TryPickConversationItemInputAudioTranscriptionSegment( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventConversationItemInputAudioTranscriptionSegment? value) + { + value = ConversationItemInputAudioTranscriptionSegment; + return IsConversationItemInputAudioTranscriptionSegment; + } + /// /// Returned when listing MCP tools is in progress for an item. /// @@ -761,6 +1255,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpListToolsInProgress => McpListToolsInProgress != null; + /// + /// + /// + public bool TryPickMcpListToolsInProgress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventMCPListToolsInProgress? value) + { + value = McpListToolsInProgress; + return IsMcpListToolsInProgress; + } + /// /// Returned when listing MCP tools has completed for an item. /// @@ -778,6 +1285,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpListToolsCompleted => McpListToolsCompleted != null; + /// + /// + /// + public bool TryPickMcpListToolsCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventMCPListToolsCompleted? value) + { + value = McpListToolsCompleted; + return IsMcpListToolsCompleted; + } + /// /// Returned when listing MCP tools has failed for an item. /// @@ -795,6 +1315,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpListToolsFailed => McpListToolsFailed != null; + /// + /// + /// + public bool TryPickMcpListToolsFailed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventMCPListToolsFailed? value) + { + value = McpListToolsFailed; + return IsMcpListToolsFailed; + } + /// /// Returned when MCP tool call arguments are updated during response generation. /// @@ -812,6 +1345,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseMcpCallArgumentsDelta => ResponseMcpCallArgumentsDelta != null; + /// + /// + /// + public bool TryPickResponseMcpCallArgumentsDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseMCPCallArgumentsDelta? value) + { + value = ResponseMcpCallArgumentsDelta; + return IsResponseMcpCallArgumentsDelta; + } + /// /// Returned when MCP tool call arguments are finalized during response generation. /// @@ -829,6 +1375,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseMcpCallArgumentsDone => ResponseMcpCallArgumentsDone != null; + /// + /// + /// + public bool TryPickResponseMcpCallArgumentsDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseMCPCallArgumentsDone? value) + { + value = ResponseMcpCallArgumentsDone; + return IsResponseMcpCallArgumentsDone; + } + /// /// Returned when an MCP tool call has started and is in progress. /// @@ -846,6 +1405,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseMcpCallInProgress => ResponseMcpCallInProgress != null; + /// + /// + /// + public bool TryPickResponseMcpCallInProgress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseMCPCallInProgress? value) + { + value = ResponseMcpCallInProgress; + return IsResponseMcpCallInProgress; + } + /// /// Returned when an MCP tool call has completed successfully. /// @@ -859,9 +1431,22 @@ namespace tryAGI.OpenAI /// ///
#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseMcpCallCompleted))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseMcpCallCompleted))] +#endif + public bool IsResponseMcpCallCompleted => ResponseMcpCallCompleted != null; + + /// + /// + /// + public bool TryPickResponseMcpCallCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] #endif - public bool IsResponseMcpCallCompleted => ResponseMcpCallCompleted != null; + out global::tryAGI.OpenAI.RealtimeServerEventResponseMCPCallCompleted? value) + { + value = ResponseMcpCallCompleted; + return IsResponseMcpCallCompleted; + } /// /// Returned when an MCP tool call has failed. @@ -879,6 +1464,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseMcpCallFailed))] #endif public bool IsResponseMcpCallFailed => ResponseMcpCallFailed != null; + + /// + /// + /// + public bool TryPickResponseMcpCallFailed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventResponseMCPCallFailed? value) + { + value = ResponseMcpCallFailed; + return IsResponseMcpCallFailed; + } /// /// /// @@ -1923,52 +2521,52 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? conversationCreated = null, - global::System.Func? conversationItemCreated = null, - global::System.Func? conversationItemDeleted = null, - global::System.Func? conversationItemInputAudioTranscriptionCompleted = null, - global::System.Func? conversationItemInputAudioTranscriptionDelta = null, - global::System.Func? conversationItemInputAudioTranscriptionFailed = null, - global::System.Func? conversationItemRetrieved = null, - global::System.Func? conversationItemTruncated = null, - global::System.Func? error = null, - global::System.Func? inputAudioBufferCleared = null, - global::System.Func? inputAudioBufferCommitted = null, - global::System.Func? inputAudioBufferDtmfEventReceived = null, - global::System.Func? inputAudioBufferSpeechStarted = null, - global::System.Func? inputAudioBufferSpeechStopped = null, - global::System.Func? rateLimitsUpdated = null, - global::System.Func? responseOutputAudioDelta = null, - global::System.Func? responseOutputAudioDone = null, - global::System.Func? responseOutputAudioTranscriptDelta = null, - global::System.Func? responseOutputAudioTranscriptDone = null, - global::System.Func? responseContentPartAdded = null, - global::System.Func? responseContentPartDone = null, - global::System.Func? responseCreated = null, - global::System.Func? responseDone = null, - global::System.Func? responseFunctionCallArgumentsDelta = null, - global::System.Func? responseFunctionCallArgumentsDone = null, - global::System.Func? responseOutputItemAdded = null, - global::System.Func? responseOutputItemDone = null, - global::System.Func? responseOutputTextDelta = null, - global::System.Func? responseOutputTextDone = null, - global::System.Func? sessionCreated = null, - global::System.Func? sessionUpdated = null, - global::System.Func? outputAudioBufferStarted = null, - global::System.Func? outputAudioBufferStopped = null, - global::System.Func? outputAudioBufferCleared = null, - global::System.Func? conversationItemAdded = null, - global::System.Func? conversationItemDone = null, - global::System.Func? inputAudioBufferTimeoutTriggered = null, - global::System.Func? conversationItemInputAudioTranscriptionSegment = null, - global::System.Func? mcpListToolsInProgress = null, - global::System.Func? mcpListToolsCompleted = null, - global::System.Func? mcpListToolsFailed = null, - global::System.Func? responseMcpCallArgumentsDelta = null, - global::System.Func? responseMcpCallArgumentsDone = null, - global::System.Func? responseMcpCallInProgress = null, - global::System.Func? responseMcpCallCompleted = null, - global::System.Func? responseMcpCallFailed = null, + global::System.Func? conversationCreated = null, + global::System.Func? conversationItemCreated = null, + global::System.Func? conversationItemDeleted = null, + global::System.Func? conversationItemInputAudioTranscriptionCompleted = null, + global::System.Func? conversationItemInputAudioTranscriptionDelta = null, + global::System.Func? conversationItemInputAudioTranscriptionFailed = null, + global::System.Func? conversationItemRetrieved = null, + global::System.Func? conversationItemTruncated = null, + global::System.Func? error = null, + global::System.Func? inputAudioBufferCleared = null, + global::System.Func? inputAudioBufferCommitted = null, + global::System.Func? inputAudioBufferDtmfEventReceived = null, + global::System.Func? inputAudioBufferSpeechStarted = null, + global::System.Func? inputAudioBufferSpeechStopped = null, + global::System.Func? rateLimitsUpdated = null, + global::System.Func? responseOutputAudioDelta = null, + global::System.Func? responseOutputAudioDone = null, + global::System.Func? responseOutputAudioTranscriptDelta = null, + global::System.Func? responseOutputAudioTranscriptDone = null, + global::System.Func? responseContentPartAdded = null, + global::System.Func? responseContentPartDone = null, + global::System.Func? responseCreated = null, + global::System.Func? responseDone = null, + global::System.Func? responseFunctionCallArgumentsDelta = null, + global::System.Func? responseFunctionCallArgumentsDone = null, + global::System.Func? responseOutputItemAdded = null, + global::System.Func? responseOutputItemDone = null, + global::System.Func? responseOutputTextDelta = null, + global::System.Func? responseOutputTextDone = null, + global::System.Func? sessionCreated = null, + global::System.Func? sessionUpdated = null, + global::System.Func? outputAudioBufferStarted = null, + global::System.Func? outputAudioBufferStopped = null, + global::System.Func? outputAudioBufferCleared = null, + global::System.Func? conversationItemAdded = null, + global::System.Func? conversationItemDone = null, + global::System.Func? inputAudioBufferTimeoutTriggered = null, + global::System.Func? conversationItemInputAudioTranscriptionSegment = null, + global::System.Func? mcpListToolsInProgress = null, + global::System.Func? mcpListToolsCompleted = null, + global::System.Func? mcpListToolsFailed = null, + global::System.Func? responseMcpCallArgumentsDelta = null, + global::System.Func? responseMcpCallArgumentsDone = null, + global::System.Func? responseMcpCallInProgress = null, + global::System.Func? responseMcpCallCompleted = null, + global::System.Func? responseMcpCallFailed = null, bool validate = true) { if (validate) @@ -2168,52 +2766,340 @@ public bool Validate() /// ///
public void Match( - global::System.Action? conversationCreated = null, - global::System.Action? conversationItemCreated = null, - global::System.Action? conversationItemDeleted = null, - global::System.Action? conversationItemInputAudioTranscriptionCompleted = null, - global::System.Action? conversationItemInputAudioTranscriptionDelta = null, - global::System.Action? conversationItemInputAudioTranscriptionFailed = null, - global::System.Action? conversationItemRetrieved = null, - global::System.Action? conversationItemTruncated = null, - global::System.Action? error = null, - global::System.Action? inputAudioBufferCleared = null, - global::System.Action? inputAudioBufferCommitted = null, - global::System.Action? inputAudioBufferDtmfEventReceived = null, - global::System.Action? inputAudioBufferSpeechStarted = null, - global::System.Action? inputAudioBufferSpeechStopped = null, - global::System.Action? rateLimitsUpdated = null, - global::System.Action? responseOutputAudioDelta = null, - global::System.Action? responseOutputAudioDone = null, - global::System.Action? responseOutputAudioTranscriptDelta = null, - global::System.Action? responseOutputAudioTranscriptDone = null, - global::System.Action? responseContentPartAdded = null, - global::System.Action? responseContentPartDone = null, - global::System.Action? responseCreated = null, - global::System.Action? responseDone = null, - global::System.Action? responseFunctionCallArgumentsDelta = null, - global::System.Action? responseFunctionCallArgumentsDone = null, - global::System.Action? responseOutputItemAdded = null, - global::System.Action? responseOutputItemDone = null, - global::System.Action? responseOutputTextDelta = null, - global::System.Action? responseOutputTextDone = null, - global::System.Action? sessionCreated = null, - global::System.Action? sessionUpdated = null, - global::System.Action? outputAudioBufferStarted = null, - global::System.Action? outputAudioBufferStopped = null, - global::System.Action? outputAudioBufferCleared = null, - global::System.Action? conversationItemAdded = null, - global::System.Action? conversationItemDone = null, - global::System.Action? inputAudioBufferTimeoutTriggered = null, - global::System.Action? conversationItemInputAudioTranscriptionSegment = null, - global::System.Action? mcpListToolsInProgress = null, - global::System.Action? mcpListToolsCompleted = null, - global::System.Action? mcpListToolsFailed = null, - global::System.Action? responseMcpCallArgumentsDelta = null, - global::System.Action? responseMcpCallArgumentsDone = null, - global::System.Action? responseMcpCallInProgress = null, - global::System.Action? responseMcpCallCompleted = null, - global::System.Action? responseMcpCallFailed = null, + global::System.Action? conversationCreated = null, + + global::System.Action? conversationItemCreated = null, + + global::System.Action? conversationItemDeleted = null, + + global::System.Action? conversationItemInputAudioTranscriptionCompleted = null, + + global::System.Action? conversationItemInputAudioTranscriptionDelta = null, + + global::System.Action? conversationItemInputAudioTranscriptionFailed = null, + + global::System.Action? conversationItemRetrieved = null, + + global::System.Action? conversationItemTruncated = null, + + global::System.Action? error = null, + + global::System.Action? inputAudioBufferCleared = null, + + global::System.Action? inputAudioBufferCommitted = null, + + global::System.Action? inputAudioBufferDtmfEventReceived = null, + + global::System.Action? inputAudioBufferSpeechStarted = null, + + global::System.Action? inputAudioBufferSpeechStopped = null, + + global::System.Action? rateLimitsUpdated = null, + + global::System.Action? responseOutputAudioDelta = null, + + global::System.Action? responseOutputAudioDone = null, + + global::System.Action? responseOutputAudioTranscriptDelta = null, + + global::System.Action? responseOutputAudioTranscriptDone = null, + + global::System.Action? responseContentPartAdded = null, + + global::System.Action? responseContentPartDone = null, + + global::System.Action? responseCreated = null, + + global::System.Action? responseDone = null, + + global::System.Action? responseFunctionCallArgumentsDelta = null, + + global::System.Action? responseFunctionCallArgumentsDone = null, + + global::System.Action? responseOutputItemAdded = null, + + global::System.Action? responseOutputItemDone = null, + + global::System.Action? responseOutputTextDelta = null, + + global::System.Action? responseOutputTextDone = null, + + global::System.Action? sessionCreated = null, + + global::System.Action? sessionUpdated = null, + + global::System.Action? outputAudioBufferStarted = null, + + global::System.Action? outputAudioBufferStopped = null, + + global::System.Action? outputAudioBufferCleared = null, + + global::System.Action? conversationItemAdded = null, + + global::System.Action? conversationItemDone = null, + + global::System.Action? inputAudioBufferTimeoutTriggered = null, + + global::System.Action? conversationItemInputAudioTranscriptionSegment = null, + + global::System.Action? mcpListToolsInProgress = null, + + global::System.Action? mcpListToolsCompleted = null, + + global::System.Action? mcpListToolsFailed = null, + + global::System.Action? responseMcpCallArgumentsDelta = null, + + global::System.Action? responseMcpCallArgumentsDone = null, + + global::System.Action? responseMcpCallInProgress = null, + + global::System.Action? responseMcpCallCompleted = null, + + global::System.Action? responseMcpCallFailed = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsConversationCreated) + { + conversationCreated?.Invoke(ConversationCreated!); + } + else if (IsConversationItemCreated) + { + conversationItemCreated?.Invoke(ConversationItemCreated!); + } + else if (IsConversationItemDeleted) + { + conversationItemDeleted?.Invoke(ConversationItemDeleted!); + } + else if (IsConversationItemInputAudioTranscriptionCompleted) + { + conversationItemInputAudioTranscriptionCompleted?.Invoke(ConversationItemInputAudioTranscriptionCompleted!); + } + else if (IsConversationItemInputAudioTranscriptionDelta) + { + conversationItemInputAudioTranscriptionDelta?.Invoke(ConversationItemInputAudioTranscriptionDelta!); + } + else if (IsConversationItemInputAudioTranscriptionFailed) + { + conversationItemInputAudioTranscriptionFailed?.Invoke(ConversationItemInputAudioTranscriptionFailed!); + } + else if (IsConversationItemRetrieved) + { + conversationItemRetrieved?.Invoke(ConversationItemRetrieved!); + } + else if (IsConversationItemTruncated) + { + conversationItemTruncated?.Invoke(ConversationItemTruncated!); + } + else if (IsError) + { + error?.Invoke(Error!); + } + else if (IsInputAudioBufferCleared) + { + inputAudioBufferCleared?.Invoke(InputAudioBufferCleared!); + } + else if (IsInputAudioBufferCommitted) + { + inputAudioBufferCommitted?.Invoke(InputAudioBufferCommitted!); + } + else if (IsInputAudioBufferDtmfEventReceived) + { + inputAudioBufferDtmfEventReceived?.Invoke(InputAudioBufferDtmfEventReceived!); + } + else if (IsInputAudioBufferSpeechStarted) + { + inputAudioBufferSpeechStarted?.Invoke(InputAudioBufferSpeechStarted!); + } + else if (IsInputAudioBufferSpeechStopped) + { + inputAudioBufferSpeechStopped?.Invoke(InputAudioBufferSpeechStopped!); + } + else if (IsRateLimitsUpdated) + { + rateLimitsUpdated?.Invoke(RateLimitsUpdated!); + } + else if (IsResponseOutputAudioDelta) + { + responseOutputAudioDelta?.Invoke(ResponseOutputAudioDelta!); + } + else if (IsResponseOutputAudioDone) + { + responseOutputAudioDone?.Invoke(ResponseOutputAudioDone!); + } + else if (IsResponseOutputAudioTranscriptDelta) + { + responseOutputAudioTranscriptDelta?.Invoke(ResponseOutputAudioTranscriptDelta!); + } + else if (IsResponseOutputAudioTranscriptDone) + { + responseOutputAudioTranscriptDone?.Invoke(ResponseOutputAudioTranscriptDone!); + } + else if (IsResponseContentPartAdded) + { + responseContentPartAdded?.Invoke(ResponseContentPartAdded!); + } + else if (IsResponseContentPartDone) + { + responseContentPartDone?.Invoke(ResponseContentPartDone!); + } + else if (IsResponseCreated) + { + responseCreated?.Invoke(ResponseCreated!); + } + else if (IsResponseDone) + { + responseDone?.Invoke(ResponseDone!); + } + else if (IsResponseFunctionCallArgumentsDelta) + { + responseFunctionCallArgumentsDelta?.Invoke(ResponseFunctionCallArgumentsDelta!); + } + else if (IsResponseFunctionCallArgumentsDone) + { + responseFunctionCallArgumentsDone?.Invoke(ResponseFunctionCallArgumentsDone!); + } + else if (IsResponseOutputItemAdded) + { + responseOutputItemAdded?.Invoke(ResponseOutputItemAdded!); + } + else if (IsResponseOutputItemDone) + { + responseOutputItemDone?.Invoke(ResponseOutputItemDone!); + } + else if (IsResponseOutputTextDelta) + { + responseOutputTextDelta?.Invoke(ResponseOutputTextDelta!); + } + else if (IsResponseOutputTextDone) + { + responseOutputTextDone?.Invoke(ResponseOutputTextDone!); + } + else if (IsSessionCreated) + { + sessionCreated?.Invoke(SessionCreated!); + } + else if (IsSessionUpdated) + { + sessionUpdated?.Invoke(SessionUpdated!); + } + else if (IsOutputAudioBufferStarted) + { + outputAudioBufferStarted?.Invoke(OutputAudioBufferStarted!); + } + else if (IsOutputAudioBufferStopped) + { + outputAudioBufferStopped?.Invoke(OutputAudioBufferStopped!); + } + else if (IsOutputAudioBufferCleared) + { + outputAudioBufferCleared?.Invoke(OutputAudioBufferCleared!); + } + else if (IsConversationItemAdded) + { + conversationItemAdded?.Invoke(ConversationItemAdded!); + } + else if (IsConversationItemDone) + { + conversationItemDone?.Invoke(ConversationItemDone!); + } + else if (IsInputAudioBufferTimeoutTriggered) + { + inputAudioBufferTimeoutTriggered?.Invoke(InputAudioBufferTimeoutTriggered!); + } + else if (IsConversationItemInputAudioTranscriptionSegment) + { + conversationItemInputAudioTranscriptionSegment?.Invoke(ConversationItemInputAudioTranscriptionSegment!); + } + else if (IsMcpListToolsInProgress) + { + mcpListToolsInProgress?.Invoke(McpListToolsInProgress!); + } + else if (IsMcpListToolsCompleted) + { + mcpListToolsCompleted?.Invoke(McpListToolsCompleted!); + } + else if (IsMcpListToolsFailed) + { + mcpListToolsFailed?.Invoke(McpListToolsFailed!); + } + else if (IsResponseMcpCallArgumentsDelta) + { + responseMcpCallArgumentsDelta?.Invoke(ResponseMcpCallArgumentsDelta!); + } + else if (IsResponseMcpCallArgumentsDone) + { + responseMcpCallArgumentsDone?.Invoke(ResponseMcpCallArgumentsDone!); + } + else if (IsResponseMcpCallInProgress) + { + responseMcpCallInProgress?.Invoke(ResponseMcpCallInProgress!); + } + else if (IsResponseMcpCallCompleted) + { + responseMcpCallCompleted?.Invoke(ResponseMcpCallCompleted!); + } + else if (IsResponseMcpCallFailed) + { + responseMcpCallFailed?.Invoke(ResponseMcpCallFailed!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? conversationCreated = null, + global::System.Action? conversationItemCreated = null, + global::System.Action? conversationItemDeleted = null, + global::System.Action? conversationItemInputAudioTranscriptionCompleted = null, + global::System.Action? conversationItemInputAudioTranscriptionDelta = null, + global::System.Action? conversationItemInputAudioTranscriptionFailed = null, + global::System.Action? conversationItemRetrieved = null, + global::System.Action? conversationItemTruncated = null, + global::System.Action? error = null, + global::System.Action? inputAudioBufferCleared = null, + global::System.Action? inputAudioBufferCommitted = null, + global::System.Action? inputAudioBufferDtmfEventReceived = null, + global::System.Action? inputAudioBufferSpeechStarted = null, + global::System.Action? inputAudioBufferSpeechStopped = null, + global::System.Action? rateLimitsUpdated = null, + global::System.Action? responseOutputAudioDelta = null, + global::System.Action? responseOutputAudioDone = null, + global::System.Action? responseOutputAudioTranscriptDelta = null, + global::System.Action? responseOutputAudioTranscriptDone = null, + global::System.Action? responseContentPartAdded = null, + global::System.Action? responseContentPartDone = null, + global::System.Action? responseCreated = null, + global::System.Action? responseDone = null, + global::System.Action? responseFunctionCallArgumentsDelta = null, + global::System.Action? responseFunctionCallArgumentsDone = null, + global::System.Action? responseOutputItemAdded = null, + global::System.Action? responseOutputItemDone = null, + global::System.Action? responseOutputTextDelta = null, + global::System.Action? responseOutputTextDone = null, + global::System.Action? sessionCreated = null, + global::System.Action? sessionUpdated = null, + global::System.Action? outputAudioBufferStarted = null, + global::System.Action? outputAudioBufferStopped = null, + global::System.Action? outputAudioBufferCleared = null, + global::System.Action? conversationItemAdded = null, + global::System.Action? conversationItemDone = null, + global::System.Action? inputAudioBufferTimeoutTriggered = null, + global::System.Action? conversationItemInputAudioTranscriptionSegment = null, + global::System.Action? mcpListToolsInProgress = null, + global::System.Action? mcpListToolsCompleted = null, + global::System.Action? mcpListToolsFailed = null, + global::System.Action? responseMcpCallArgumentsDelta = null, + global::System.Action? responseMcpCallArgumentsDone = null, + global::System.Action? responseMcpCallInProgress = null, + global::System.Action? responseMcpCallCompleted = null, + global::System.Action? responseMcpCallFailed = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranslationClientEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranslationClientEvent.g.cs index d93e6b3c..bd21c7ce 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranslationClientEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranslationClientEvent.g.cs @@ -28,6 +28,19 @@ namespace tryAGI.OpenAI #endif public bool IsSessionUpdate => SessionUpdate != null; + /// + /// + /// + public bool TryPickSessionUpdate( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTranslationClientEventSessionUpdate? value) + { + value = SessionUpdate; + return IsSessionUpdate; + } + /// /// Send this event to append audio bytes to the translation session input audio buffer.
/// WebSocket translation sessions accept base64-encoded 24 kHz PCM16 mono
@@ -56,6 +69,19 @@ namespace tryAGI.OpenAI #endif public bool IsSessionInputAudioBufferAppend => SessionInputAudioBufferAppend != null; + /// + /// + /// + public bool TryPickSessionInputAudioBufferAppend( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTranslationClientEventInputAudioBufferAppend? value) + { + value = SessionInputAudioBufferAppend; + return IsSessionInputAudioBufferAppend; + } + /// /// Gracefully close the realtime translation session. The server flushes pending
/// input audio and emits any remaining translated output before closing the
@@ -74,6 +100,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SessionClose))] #endif public bool IsSessionClose => SessionClose != null; + + /// + /// + /// + public bool TryPickSessionClose( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTranslationClientEventSessionClose? value) + { + value = SessionClose; + return IsSessionClose; + } /// /// /// @@ -172,9 +211,9 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? sessionUpdate = null, - global::System.Func? sessionInputAudioBufferAppend = null, - global::System.Func? sessionClose = null, + global::System.Func? sessionUpdate = null, + global::System.Func? sessionInputAudioBufferAppend = null, + global::System.Func? sessionClose = null, bool validate = true) { if (validate) @@ -202,9 +241,39 @@ public bool Validate() /// ///
public void Match( - global::System.Action? sessionUpdate = null, - global::System.Action? sessionInputAudioBufferAppend = null, - global::System.Action? sessionClose = null, + global::System.Action? sessionUpdate = null, + + global::System.Action? sessionInputAudioBufferAppend = null, + + global::System.Action? sessionClose = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSessionUpdate) + { + sessionUpdate?.Invoke(SessionUpdate!); + } + else if (IsSessionInputAudioBufferAppend) + { + sessionInputAudioBufferAppend?.Invoke(SessionInputAudioBufferAppend!); + } + else if (IsSessionClose) + { + sessionClose?.Invoke(SessionClose!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? sessionUpdate = null, + global::System.Action? sessionInputAudioBufferAppend = null, + global::System.Action? sessionClose = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranslationServerEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranslationServerEvent.g.cs index a1fd12cc..89b4cd60 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranslationServerEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranslationServerEvent.g.cs @@ -28,6 +28,19 @@ namespace tryAGI.OpenAI #endif public bool IsError => Error != null; + /// + /// + /// + public bool TryPickError( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeServerEventError? value) + { + value = Error; + return IsError; + } + /// /// Returned when a translation session is created. Emitted automatically when a
/// new connection is established as the first server event. This event contains
@@ -47,6 +60,19 @@ namespace tryAGI.OpenAI #endif public bool IsSessionCreated => SessionCreated != null; + /// + /// + /// + public bool TryPickSessionCreated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTranslationServerEventSessionCreated? value) + { + value = SessionCreated; + return IsSessionCreated; + } + /// /// Returned when a translation session is updated with a `session.update` event,
/// unless there is an error. @@ -65,6 +91,19 @@ namespace tryAGI.OpenAI #endif public bool IsSessionUpdated => SessionUpdated != null; + /// + /// + /// + public bool TryPickSessionUpdated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTranslationServerEventSessionUpdated? value) + { + value = SessionUpdated; + return IsSessionUpdated; + } + /// /// Returned when a realtime translation session is closed. /// @@ -82,6 +121,19 @@ namespace tryAGI.OpenAI #endif public bool IsSessionClosed => SessionClosed != null; + /// + /// + /// + public bool TryPickSessionClosed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTranslationServerEventSessionClosed? value) + { + value = SessionClosed; + return IsSessionClosed; + } + /// /// Returned when optional source-language transcript text is available. This event
/// is emitted only when `audio.input.transcription` is configured.
@@ -102,6 +154,19 @@ namespace tryAGI.OpenAI #endif public bool IsSessionInputTranscriptDelta => SessionInputTranscriptDelta != null; + /// + /// + /// + public bool TryPickSessionInputTranscriptDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTranslationServerEventSessionInputTranscriptDelta? value) + { + value = SessionInputTranscriptDelta; + return IsSessionInputTranscriptDelta; + } + /// /// Returned when translated transcript text is available.
/// Transcript deltas are append-only text fragments. Clients should not insert
@@ -121,6 +186,19 @@ namespace tryAGI.OpenAI #endif public bool IsSessionOutputTranscriptDelta => SessionOutputTranscriptDelta != null; + /// + /// + /// + public bool TryPickSessionOutputTranscriptDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTranslationServerEventSessionOutputTranscriptDelta? value) + { + value = SessionOutputTranscriptDelta; + return IsSessionOutputTranscriptDelta; + } + /// /// Returned when translated output audio is available. Output audio deltas are
/// 200 ms frames of PCM16 audio. @@ -138,6 +216,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SessionOutputAudioDelta))] #endif public bool IsSessionOutputAudioDelta => SessionOutputAudioDelta != null; + + /// + /// + /// + public bool TryPickSessionOutputAudioDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTranslationServerEventSessionOutputAudioDelta? value) + { + value = SessionOutputAudioDelta; + return IsSessionOutputAudioDelta; + } /// /// /// @@ -324,13 +415,13 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? error = null, - global::System.Func? sessionCreated = null, - global::System.Func? sessionUpdated = null, - global::System.Func? sessionClosed = null, - global::System.Func? sessionInputTranscriptDelta = null, - global::System.Func? sessionOutputTranscriptDelta = null, - global::System.Func? sessionOutputAudioDelta = null, + global::System.Func? error = null, + global::System.Func? sessionCreated = null, + global::System.Func? sessionUpdated = null, + global::System.Func? sessionClosed = null, + global::System.Func? sessionInputTranscriptDelta = null, + global::System.Func? sessionOutputTranscriptDelta = null, + global::System.Func? sessionOutputAudioDelta = null, bool validate = true) { if (validate) @@ -374,13 +465,67 @@ public bool Validate() /// ///
public void Match( - global::System.Action? error = null, - global::System.Action? sessionCreated = null, - global::System.Action? sessionUpdated = null, - global::System.Action? sessionClosed = null, - global::System.Action? sessionInputTranscriptDelta = null, - global::System.Action? sessionOutputTranscriptDelta = null, - global::System.Action? sessionOutputAudioDelta = null, + global::System.Action? error = null, + + global::System.Action? sessionCreated = null, + + global::System.Action? sessionUpdated = null, + + global::System.Action? sessionClosed = null, + + global::System.Action? sessionInputTranscriptDelta = null, + + global::System.Action? sessionOutputTranscriptDelta = null, + + global::System.Action? sessionOutputAudioDelta = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsError) + { + error?.Invoke(Error!); + } + else if (IsSessionCreated) + { + sessionCreated?.Invoke(SessionCreated!); + } + else if (IsSessionUpdated) + { + sessionUpdated?.Invoke(SessionUpdated!); + } + else if (IsSessionClosed) + { + sessionClosed?.Invoke(SessionClosed!); + } + else if (IsSessionInputTranscriptDelta) + { + sessionInputTranscriptDelta?.Invoke(SessionInputTranscriptDelta!); + } + else if (IsSessionOutputTranscriptDelta) + { + sessionOutputTranscriptDelta?.Invoke(SessionOutputTranscriptDelta!); + } + else if (IsSessionOutputAudioDelta) + { + sessionOutputAudioDelta?.Invoke(SessionOutputAudioDelta!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? error = null, + global::System.Action? sessionCreated = null, + global::System.Action? sessionUpdated = null, + global::System.Action? sessionClosed = null, + global::System.Action? sessionInputTranscriptDelta = null, + global::System.Action? sessionOutputTranscriptDelta = null, + global::System.Action? sessionOutputAudioDelta = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTruncation.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTruncation.g.cs index fb5a01fe..69411355 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTruncation.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTruncation.g.cs @@ -29,6 +29,19 @@ namespace tryAGI.OpenAI #endif public bool IsEnum => Enum != null; + /// + /// + /// + public bool TryPickEnum( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTruncationEnum? value) + { + value = Enum; + return IsEnum; + } + /// /// Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. This allows you to amortize truncations across multiple turns, which can help improve cached token usage. /// @@ -45,6 +58,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RetentionRatioTruncation))] #endif public bool IsRetentionRatioTruncation => RetentionRatioTruncation != null; + + /// + /// + /// + public bool TryPickRetentionRatioTruncation( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTruncationEnum2? value) + { + value = RetentionRatioTruncation; + return IsRetentionRatioTruncation; + } /// /// /// @@ -122,7 +148,7 @@ public bool Validate() ///
public TResult? Match( global::System.Func? @enum = null, - global::System.Func? retentionRatioTruncation = null, + global::System.Func? retentionRatioTruncation = null, bool validate = true) { if (validate) @@ -147,7 +173,31 @@ public bool Validate() ///
public void Match( global::System.Action? @enum = null, - global::System.Action? retentionRatioTruncation = null, + + global::System.Action? retentionRatioTruncation = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsEnum) + { + @enum?.Invoke(Enum!); + } + else if (IsRetentionRatioTruncation) + { + retentionRatioTruncation?.Invoke(RetentionRatioTruncation!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? @enum = null, + global::System.Action? retentionRatioTruncation = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTurnDetectionRealtimeTurnDetection1.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTurnDetectionRealtimeTurnDetection1.g.cs index 5307f740..5f60e3ca 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTurnDetectionRealtimeTurnDetection1.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTurnDetectionRealtimeTurnDetection1.g.cs @@ -30,6 +30,19 @@ namespace tryAGI.OpenAI #endif public bool IsServerVad => ServerVad != null; + /// + /// + /// + public bool TryPickServerVad( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTurnDetectionRealtimeTurnDetection1ServerVad? value) + { + value = ServerVad; + return IsServerVad; + } + /// /// Server-side semantic turn detection which uses a model to determine when the user has finished speaking. /// @@ -46,6 +59,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SemanticVad))] #endif public bool IsSemanticVad => SemanticVad != null; + + /// + /// + /// + public bool TryPickSemanticVad( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTurnDetectionRealtimeTurnDetection1SemanticVad? value) + { + value = SemanticVad; + return IsSemanticVad; + } /// /// /// @@ -122,8 +148,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? serverVad = null, - global::System.Func? semanticVad = null, + global::System.Func? serverVad = null, + global::System.Func? semanticVad = null, bool validate = true) { if (validate) @@ -147,8 +173,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? serverVad = null, - global::System.Action? semanticVad = null, + global::System.Action? serverVad = null, + + global::System.Action? semanticVad = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsServerVad) + { + serverVad?.Invoke(ServerVad!); + } + else if (IsSemanticVad) + { + semanticVad?.Invoke(SemanticVad!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? serverVad = null, + global::System.Action? semanticVad = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Response.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Response.g.cs index 9103eb40..d42f7b4a 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Response.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Response.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsModelProperties => ModelProperties != null; + /// + /// + /// + public bool TryPickModelProperties( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ModelResponseProperties? value) + { + value = ModelProperties; + return IsModelProperties; + } + /// /// /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsProperties => Properties != null; + /// + /// + /// + public bool TryPickProperties( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseProperties? value) + { + value = Properties; + return IsProperties; + } + /// /// /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseVariant3))] #endif public bool IsResponseVariant3 => ResponseVariant3 != null; + + /// + /// + /// + public bool TryPickResponseVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseVariant3? value) + { + value = ResponseVariant3; + return IsResponseVariant3; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? modelProperties = null, - global::System.Func? properties = null, - global::System.Func? responseVariant3 = null, + global::System.Func? modelProperties = null, + global::System.Func? properties = null, + global::System.Func? responseVariant3 = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// ///
public void Match( - global::System.Action? modelProperties = null, - global::System.Action? properties = null, - global::System.Action? responseVariant3 = null, + global::System.Action? modelProperties = null, + + global::System.Action? properties = null, + + global::System.Action? responseVariant3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsModelProperties) + { + modelProperties?.Invoke(ModelProperties!); + } + else if (IsProperties) + { + properties?.Invoke(Properties!); + } + else if (IsResponseVariant3) + { + responseVariant3?.Invoke(ResponseVariant3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? modelProperties = null, + global::System.Action? properties = null, + global::System.Action? responseVariant3 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseFormat.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseFormat.g.cs index 41e61956..0e294199 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseFormat.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseFormat.g.cs @@ -33,6 +33,19 @@ namespace tryAGI.OpenAI #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFormatText? value) + { + value = Text; + return IsText; + } + /// /// JSON Schema response format. Used to generate structured JSON responses.
/// Learn more about [Structured Outputs](/docs/guides/structured-outputs). @@ -51,6 +64,19 @@ namespace tryAGI.OpenAI #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFormatJsonSchema? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// JSON object response format. An older method of generating JSON responses.
/// Using `json_schema` is recommended for models that support it. Note that the
@@ -70,6 +96,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JsonObject))] #endif public bool IsJsonObject => JsonObject != null; + + /// + /// + /// + public bool TryPickJsonObject( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFormatJsonObject? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -168,9 +207,9 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? text = null, - global::System.Func? jsonSchema = null, - global::System.Func? jsonObject = null, + global::System.Func? text = null, + global::System.Func? jsonSchema = null, + global::System.Func? jsonObject = null, bool validate = true) { if (validate) @@ -198,9 +237,39 @@ public bool Validate() /// ///
public void Match( - global::System.Action? text = null, - global::System.Action? jsonSchema = null, - global::System.Action? jsonObject = null, + global::System.Action? text = null, + + global::System.Action? jsonSchema = null, + + global::System.Action? jsonObject = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsJsonSchema) + { + jsonSchema?.Invoke(JsonSchema!); + } + else if (IsJsonObject) + { + jsonObject?.Invoke(JsonObject!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? jsonSchema = null, + global::System.Action? jsonObject = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseStreamEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseStreamEvent.g.cs index c67c1a10..41fdf578 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseStreamEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseStreamEvent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseAudioDelta => ResponseAudioDelta != null; + /// + /// + /// + public bool TryPickResponseAudioDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseAudioDeltaEvent? value) + { + value = ResponseAudioDelta; + return IsResponseAudioDelta; + } + /// /// Emitted when the audio response is complete. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseAudioDone => ResponseAudioDone != null; + /// + /// + /// + public bool TryPickResponseAudioDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseAudioDoneEvent? value) + { + value = ResponseAudioDone; + return IsResponseAudioDone; + } + /// /// Emitted when there is a partial transcript of audio. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseAudioTranscriptDelta => ResponseAudioTranscriptDelta != null; + /// + /// + /// + public bool TryPickResponseAudioTranscriptDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseAudioTranscriptDeltaEvent? value) + { + value = ResponseAudioTranscriptDelta; + return IsResponseAudioTranscriptDelta; + } + /// /// Emitted when the full audio transcript is completed. /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseAudioTranscriptDone => ResponseAudioTranscriptDone != null; + /// + /// + /// + public bool TryPickResponseAudioTranscriptDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseAudioTranscriptDoneEvent? value) + { + value = ResponseAudioTranscriptDone; + return IsResponseAudioTranscriptDone; + } + /// /// Emitted when a partial code snippet is streamed by the code interpreter. /// @@ -94,6 +146,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCodeInterpreterCallCodeDelta => ResponseCodeInterpreterCallCodeDelta != null; + /// + /// + /// + public bool TryPickResponseCodeInterpreterCallCodeDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent? value) + { + value = ResponseCodeInterpreterCallCodeDelta; + return IsResponseCodeInterpreterCallCodeDelta; + } + /// /// Emitted when the code snippet is finalized by the code interpreter. /// @@ -111,6 +176,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCodeInterpreterCallCodeDone => ResponseCodeInterpreterCallCodeDone != null; + /// + /// + /// + public bool TryPickResponseCodeInterpreterCallCodeDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseCodeInterpreterCallCodeDoneEvent? value) + { + value = ResponseCodeInterpreterCallCodeDone; + return IsResponseCodeInterpreterCallCodeDone; + } + /// /// Emitted when the code interpreter call is completed. /// @@ -128,6 +206,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCodeInterpreterCallCompleted => ResponseCodeInterpreterCallCompleted != null; + /// + /// + /// + public bool TryPickResponseCodeInterpreterCallCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseCodeInterpreterCallCompletedEvent? value) + { + value = ResponseCodeInterpreterCallCompleted; + return IsResponseCodeInterpreterCallCompleted; + } + /// /// Emitted when a code interpreter call is in progress. /// @@ -145,6 +236,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCodeInterpreterCallInProgress => ResponseCodeInterpreterCallInProgress != null; + /// + /// + /// + public bool TryPickResponseCodeInterpreterCallInProgress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseCodeInterpreterCallInProgressEvent? value) + { + value = ResponseCodeInterpreterCallInProgress; + return IsResponseCodeInterpreterCallInProgress; + } + /// /// Emitted when the code interpreter is actively interpreting the code snippet. /// @@ -162,6 +266,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCodeInterpreterCallInterpreting => ResponseCodeInterpreterCallInterpreting != null; + /// + /// + /// + public bool TryPickResponseCodeInterpreterCallInterpreting( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseCodeInterpreterCallInterpretingEvent? value) + { + value = ResponseCodeInterpreterCallInterpreting; + return IsResponseCodeInterpreterCallInterpreting; + } + /// /// Emitted when the model response is complete. /// @@ -179,6 +296,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCompleted => ResponseCompleted != null; + /// + /// + /// + public bool TryPickResponseCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseCompletedEvent? value) + { + value = ResponseCompleted; + return IsResponseCompleted; + } + /// /// Emitted when a new content part is added. /// @@ -196,6 +326,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseContentPartAdded => ResponseContentPartAdded != null; + /// + /// + /// + public bool TryPickResponseContentPartAdded( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseContentPartAddedEvent? value) + { + value = ResponseContentPartAdded; + return IsResponseContentPartAdded; + } + /// /// Emitted when a content part is done. /// @@ -213,6 +356,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseContentPartDone => ResponseContentPartDone != null; + /// + /// + /// + public bool TryPickResponseContentPartDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseContentPartDoneEvent? value) + { + value = ResponseContentPartDone; + return IsResponseContentPartDone; + } + /// /// An event that is emitted when a response is created. /// @@ -230,6 +386,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCreated => ResponseCreated != null; + /// + /// + /// + public bool TryPickResponseCreated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseCreatedEvent? value) + { + value = ResponseCreated; + return IsResponseCreated; + } + /// /// Emitted when an error occurs. /// @@ -247,6 +416,19 @@ namespace tryAGI.OpenAI #endif public bool IsError => Error != null; + /// + /// + /// + public bool TryPickError( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseErrorEvent? value) + { + value = Error; + return IsError; + } + /// /// Emitted when a file search call is completed (results found). /// @@ -264,6 +446,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseFileSearchCallCompleted => ResponseFileSearchCallCompleted != null; + /// + /// + /// + public bool TryPickResponseFileSearchCallCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFileSearchCallCompletedEvent? value) + { + value = ResponseFileSearchCallCompleted; + return IsResponseFileSearchCallCompleted; + } + /// /// Emitted when a file search call is initiated. /// @@ -281,6 +476,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseFileSearchCallInProgress => ResponseFileSearchCallInProgress != null; + /// + /// + /// + public bool TryPickResponseFileSearchCallInProgress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFileSearchCallInProgressEvent? value) + { + value = ResponseFileSearchCallInProgress; + return IsResponseFileSearchCallInProgress; + } + /// /// Emitted when a file search is currently searching. /// @@ -298,6 +506,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseFileSearchCallSearching => ResponseFileSearchCallSearching != null; + /// + /// + /// + public bool TryPickResponseFileSearchCallSearching( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFileSearchCallSearchingEvent? value) + { + value = ResponseFileSearchCallSearching; + return IsResponseFileSearchCallSearching; + } + /// /// Emitted when there is a partial function-call arguments delta. /// @@ -315,6 +536,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseFunctionCallArgumentsDelta => ResponseFunctionCallArgumentsDelta != null; + /// + /// + /// + public bool TryPickResponseFunctionCallArgumentsDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFunctionCallArgumentsDeltaEvent? value) + { + value = ResponseFunctionCallArgumentsDelta; + return IsResponseFunctionCallArgumentsDelta; + } + /// /// Emitted when function-call arguments are finalized. /// @@ -332,6 +566,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseFunctionCallArgumentsDone => ResponseFunctionCallArgumentsDone != null; + /// + /// + /// + public bool TryPickResponseFunctionCallArgumentsDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFunctionCallArgumentsDoneEvent? value) + { + value = ResponseFunctionCallArgumentsDone; + return IsResponseFunctionCallArgumentsDone; + } + /// /// Emitted when the response is in progress. /// @@ -349,6 +596,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseInProgress => ResponseInProgress != null; + /// + /// + /// + public bool TryPickResponseInProgress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseInProgressEvent? value) + { + value = ResponseInProgress; + return IsResponseInProgress; + } + /// /// An event that is emitted when a response fails. /// @@ -366,6 +626,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseFailed => ResponseFailed != null; + /// + /// + /// + public bool TryPickResponseFailed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFailedEvent? value) + { + value = ResponseFailed; + return IsResponseFailed; + } + /// /// An event that is emitted when a response finishes as incomplete. /// @@ -383,6 +656,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseIncomplete => ResponseIncomplete != null; + /// + /// + /// + public bool TryPickResponseIncomplete( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseIncompleteEvent? value) + { + value = ResponseIncomplete; + return IsResponseIncomplete; + } + /// /// Emitted when a new output item is added. /// @@ -400,6 +686,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputItemAdded => ResponseOutputItemAdded != null; + /// + /// + /// + public bool TryPickResponseOutputItemAdded( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseOutputItemAddedEvent? value) + { + value = ResponseOutputItemAdded; + return IsResponseOutputItemAdded; + } + /// /// Emitted when an output item is marked done. /// @@ -417,6 +716,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputItemDone => ResponseOutputItemDone != null; + /// + /// + /// + public bool TryPickResponseOutputItemDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseOutputItemDoneEvent? value) + { + value = ResponseOutputItemDone; + return IsResponseOutputItemDone; + } + /// /// Emitted when a new reasoning summary part is added. /// @@ -434,6 +746,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseReasoningSummaryPartAdded => ResponseReasoningSummaryPartAdded != null; + /// + /// + /// + public bool TryPickResponseReasoningSummaryPartAdded( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseReasoningSummaryPartAddedEvent? value) + { + value = ResponseReasoningSummaryPartAdded; + return IsResponseReasoningSummaryPartAdded; + } + /// /// Emitted when a reasoning summary part is completed. /// @@ -451,6 +776,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseReasoningSummaryPartDone => ResponseReasoningSummaryPartDone != null; + /// + /// + /// + public bool TryPickResponseReasoningSummaryPartDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseReasoningSummaryPartDoneEvent? value) + { + value = ResponseReasoningSummaryPartDone; + return IsResponseReasoningSummaryPartDone; + } + /// /// Emitted when a delta is added to a reasoning summary text. /// @@ -468,6 +806,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseReasoningSummaryTextDelta => ResponseReasoningSummaryTextDelta != null; + /// + /// + /// + public bool TryPickResponseReasoningSummaryTextDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseReasoningSummaryTextDeltaEvent? value) + { + value = ResponseReasoningSummaryTextDelta; + return IsResponseReasoningSummaryTextDelta; + } + /// /// Emitted when a reasoning summary text is completed. /// @@ -485,6 +836,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseReasoningSummaryTextDone => ResponseReasoningSummaryTextDone != null; + /// + /// + /// + public bool TryPickResponseReasoningSummaryTextDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseReasoningSummaryTextDoneEvent? value) + { + value = ResponseReasoningSummaryTextDone; + return IsResponseReasoningSummaryTextDone; + } + /// /// Emitted when a delta is added to a reasoning text. /// @@ -502,6 +866,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseReasoningTextDelta => ResponseReasoningTextDelta != null; + /// + /// + /// + public bool TryPickResponseReasoningTextDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseReasoningTextDeltaEvent? value) + { + value = ResponseReasoningTextDelta; + return IsResponseReasoningTextDelta; + } + /// /// Emitted when a reasoning text is completed. /// @@ -519,6 +896,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseReasoningTextDone => ResponseReasoningTextDone != null; + /// + /// + /// + public bool TryPickResponseReasoningTextDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseReasoningTextDoneEvent? value) + { + value = ResponseReasoningTextDone; + return IsResponseReasoningTextDone; + } + /// /// Emitted when there is a partial refusal text. /// @@ -536,6 +926,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseRefusalDelta => ResponseRefusalDelta != null; + /// + /// + /// + public bool TryPickResponseRefusalDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseRefusalDeltaEvent? value) + { + value = ResponseRefusalDelta; + return IsResponseRefusalDelta; + } + /// /// Emitted when refusal text is finalized. /// @@ -553,6 +956,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseRefusalDone => ResponseRefusalDone != null; + /// + /// + /// + public bool TryPickResponseRefusalDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseRefusalDoneEvent? value) + { + value = ResponseRefusalDone; + return IsResponseRefusalDone; + } + /// /// Emitted when there is an additional text delta. /// @@ -570,6 +986,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputTextDelta => ResponseOutputTextDelta != null; + /// + /// + /// + public bool TryPickResponseOutputTextDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseTextDeltaEvent? value) + { + value = ResponseOutputTextDelta; + return IsResponseOutputTextDelta; + } + /// /// Emitted when text content is finalized. /// @@ -587,6 +1016,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputTextDone => ResponseOutputTextDone != null; + /// + /// + /// + public bool TryPickResponseOutputTextDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseTextDoneEvent? value) + { + value = ResponseOutputTextDone; + return IsResponseOutputTextDone; + } + /// /// Emitted when a web search call is completed. /// @@ -604,6 +1046,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseWebSearchCallCompleted => ResponseWebSearchCallCompleted != null; + /// + /// + /// + public bool TryPickResponseWebSearchCallCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseWebSearchCallCompletedEvent? value) + { + value = ResponseWebSearchCallCompleted; + return IsResponseWebSearchCallCompleted; + } + /// /// Emitted when a web search call is initiated. /// @@ -621,6 +1076,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseWebSearchCallInProgress => ResponseWebSearchCallInProgress != null; + /// + /// + /// + public bool TryPickResponseWebSearchCallInProgress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseWebSearchCallInProgressEvent? value) + { + value = ResponseWebSearchCallInProgress; + return IsResponseWebSearchCallInProgress; + } + /// /// Emitted when a web search call is executing. /// @@ -638,6 +1106,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseWebSearchCallSearching => ResponseWebSearchCallSearching != null; + /// + /// + /// + public bool TryPickResponseWebSearchCallSearching( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseWebSearchCallSearchingEvent? value) + { + value = ResponseWebSearchCallSearching; + return IsResponseWebSearchCallSearching; + } + /// /// Emitted when an image generation tool call has completed and the final image is available. /// @@ -655,6 +1136,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseImageGenerationCallCompleted => ResponseImageGenerationCallCompleted != null; + /// + /// + /// + public bool TryPickResponseImageGenerationCallCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseImageGenCallCompletedEvent? value) + { + value = ResponseImageGenerationCallCompleted; + return IsResponseImageGenerationCallCompleted; + } + /// /// Emitted when an image generation tool call is actively generating an image (intermediate state). /// @@ -672,6 +1166,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseImageGenerationCallGenerating => ResponseImageGenerationCallGenerating != null; + /// + /// + /// + public bool TryPickResponseImageGenerationCallGenerating( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseImageGenCallGeneratingEvent? value) + { + value = ResponseImageGenerationCallGenerating; + return IsResponseImageGenerationCallGenerating; + } + /// /// Emitted when an image generation tool call is in progress. /// @@ -689,6 +1196,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseImageGenerationCallInProgress => ResponseImageGenerationCallInProgress != null; + /// + /// + /// + public bool TryPickResponseImageGenerationCallInProgress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseImageGenCallInProgressEvent? value) + { + value = ResponseImageGenerationCallInProgress; + return IsResponseImageGenerationCallInProgress; + } + /// /// Emitted when a partial image is available during image generation streaming. /// @@ -706,6 +1226,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseImageGenerationCallPartialImage => ResponseImageGenerationCallPartialImage != null; + /// + /// + /// + public bool TryPickResponseImageGenerationCallPartialImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseImageGenCallPartialImageEvent? value) + { + value = ResponseImageGenerationCallPartialImage; + return IsResponseImageGenerationCallPartialImage; + } + /// /// Emitted when there is a delta (partial update) to the arguments of an MCP tool call. /// @@ -723,6 +1256,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseMcpCallArgumentsDelta => ResponseMcpCallArgumentsDelta != null; + /// + /// + /// + public bool TryPickResponseMcpCallArgumentsDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseMCPCallArgumentsDeltaEvent? value) + { + value = ResponseMcpCallArgumentsDelta; + return IsResponseMcpCallArgumentsDelta; + } + /// /// Emitted when the arguments for an MCP tool call are finalized. /// @@ -740,6 +1286,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseMcpCallArgumentsDone => ResponseMcpCallArgumentsDone != null; + /// + /// + /// + public bool TryPickResponseMcpCallArgumentsDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseMCPCallArgumentsDoneEvent? value) + { + value = ResponseMcpCallArgumentsDone; + return IsResponseMcpCallArgumentsDone; + } + /// /// Emitted when an MCP tool call has completed successfully. /// @@ -757,6 +1316,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseMcpCallCompleted => ResponseMcpCallCompleted != null; + /// + /// + /// + public bool TryPickResponseMcpCallCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseMCPCallCompletedEvent? value) + { + value = ResponseMcpCallCompleted; + return IsResponseMcpCallCompleted; + } + /// /// Emitted when an MCP tool call has failed. /// @@ -774,6 +1346,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseMcpCallFailed => ResponseMcpCallFailed != null; + /// + /// + /// + public bool TryPickResponseMcpCallFailed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseMCPCallFailedEvent? value) + { + value = ResponseMcpCallFailed; + return IsResponseMcpCallFailed; + } + /// /// Emitted when an MCP tool call is in progress. /// @@ -791,6 +1376,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseMcpCallInProgress => ResponseMcpCallInProgress != null; + /// + /// + /// + public bool TryPickResponseMcpCallInProgress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseMCPCallInProgressEvent? value) + { + value = ResponseMcpCallInProgress; + return IsResponseMcpCallInProgress; + } + /// /// Emitted when the list of available MCP tools has been successfully retrieved. /// @@ -808,6 +1406,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseMcpListToolsCompleted => ResponseMcpListToolsCompleted != null; + /// + /// + /// + public bool TryPickResponseMcpListToolsCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseMCPListToolsCompletedEvent? value) + { + value = ResponseMcpListToolsCompleted; + return IsResponseMcpListToolsCompleted; + } + /// /// Emitted when the attempt to list available MCP tools has failed. /// @@ -825,6 +1436,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseMcpListToolsFailed => ResponseMcpListToolsFailed != null; + /// + /// + /// + public bool TryPickResponseMcpListToolsFailed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseMCPListToolsFailedEvent? value) + { + value = ResponseMcpListToolsFailed; + return IsResponseMcpListToolsFailed; + } + /// /// Emitted when the system is in the process of retrieving the list of available MCP tools. /// @@ -842,6 +1466,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseMcpListToolsInProgress => ResponseMcpListToolsInProgress != null; + /// + /// + /// + public bool TryPickResponseMcpListToolsInProgress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseMCPListToolsInProgressEvent? value) + { + value = ResponseMcpListToolsInProgress; + return IsResponseMcpListToolsInProgress; + } + /// /// Emitted when an annotation is added to output text content. /// @@ -859,6 +1496,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseOutputTextAnnotationAdded => ResponseOutputTextAnnotationAdded != null; + /// + /// + /// + public bool TryPickResponseOutputTextAnnotationAdded( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseOutputTextAnnotationAddedEvent? value) + { + value = ResponseOutputTextAnnotationAdded; + return IsResponseOutputTextAnnotationAdded; + } + /// /// Emitted when a response is queued and waiting to be processed. /// @@ -876,6 +1526,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseQueued => ResponseQueued != null; + /// + /// + /// + public bool TryPickResponseQueued( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseQueuedEvent? value) + { + value = ResponseQueued; + return IsResponseQueued; + } + /// /// Event representing a delta (partial update) to the input of a custom tool call. /// @@ -893,6 +1556,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponseCustomToolCallInputDelta => ResponseCustomToolCallInputDelta != null; + /// + /// + /// + public bool TryPickResponseCustomToolCallInputDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseCustomToolCallInputDeltaEvent? value) + { + value = ResponseCustomToolCallInputDelta; + return IsResponseCustomToolCallInputDelta; + } + /// /// Event indicating that input for a custom tool call is complete. /// @@ -909,6 +1585,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseCustomToolCallInputDone))] #endif public bool IsResponseCustomToolCallInputDone => ResponseCustomToolCallInputDone != null; + + /// + /// + /// + public bool TryPickResponseCustomToolCallInputDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseCustomToolCallInputDoneEvent? value) + { + value = ResponseCustomToolCallInputDone; + return IsResponseCustomToolCallInputDone; + } /// /// /// @@ -2107,59 +2796,59 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? responseAudioDelta = null, - global::System.Func? responseAudioDone = null, - global::System.Func? responseAudioTranscriptDelta = null, - global::System.Func? responseAudioTranscriptDone = null, - global::System.Func? responseCodeInterpreterCallCodeDelta = null, - global::System.Func? responseCodeInterpreterCallCodeDone = null, - global::System.Func? responseCodeInterpreterCallCompleted = null, - global::System.Func? responseCodeInterpreterCallInProgress = null, - global::System.Func? responseCodeInterpreterCallInterpreting = null, - global::System.Func? responseCompleted = null, - global::System.Func? responseContentPartAdded = null, - global::System.Func? responseContentPartDone = null, - global::System.Func? responseCreated = null, - global::System.Func? error = null, - global::System.Func? responseFileSearchCallCompleted = null, - global::System.Func? responseFileSearchCallInProgress = null, - global::System.Func? responseFileSearchCallSearching = null, - global::System.Func? responseFunctionCallArgumentsDelta = null, - global::System.Func? responseFunctionCallArgumentsDone = null, - global::System.Func? responseInProgress = null, - global::System.Func? responseFailed = null, - global::System.Func? responseIncomplete = null, - global::System.Func? responseOutputItemAdded = null, - global::System.Func? responseOutputItemDone = null, - global::System.Func? responseReasoningSummaryPartAdded = null, - global::System.Func? responseReasoningSummaryPartDone = null, - global::System.Func? responseReasoningSummaryTextDelta = null, - global::System.Func? responseReasoningSummaryTextDone = null, - global::System.Func? responseReasoningTextDelta = null, - global::System.Func? responseReasoningTextDone = null, - global::System.Func? responseRefusalDelta = null, - global::System.Func? responseRefusalDone = null, - global::System.Func? responseOutputTextDelta = null, - global::System.Func? responseOutputTextDone = null, - global::System.Func? responseWebSearchCallCompleted = null, - global::System.Func? responseWebSearchCallInProgress = null, - global::System.Func? responseWebSearchCallSearching = null, - global::System.Func? responseImageGenerationCallCompleted = null, - global::System.Func? responseImageGenerationCallGenerating = null, - global::System.Func? responseImageGenerationCallInProgress = null, - global::System.Func? responseImageGenerationCallPartialImage = null, - global::System.Func? responseMcpCallArgumentsDelta = null, - global::System.Func? responseMcpCallArgumentsDone = null, - global::System.Func? responseMcpCallCompleted = null, - global::System.Func? responseMcpCallFailed = null, - global::System.Func? responseMcpCallInProgress = null, - global::System.Func? responseMcpListToolsCompleted = null, - global::System.Func? responseMcpListToolsFailed = null, - global::System.Func? responseMcpListToolsInProgress = null, - global::System.Func? responseOutputTextAnnotationAdded = null, - global::System.Func? responseQueued = null, - global::System.Func? responseCustomToolCallInputDelta = null, - global::System.Func? responseCustomToolCallInputDone = null, + global::System.Func? responseAudioDelta = null, + global::System.Func? responseAudioDone = null, + global::System.Func? responseAudioTranscriptDelta = null, + global::System.Func? responseAudioTranscriptDone = null, + global::System.Func? responseCodeInterpreterCallCodeDelta = null, + global::System.Func? responseCodeInterpreterCallCodeDone = null, + global::System.Func? responseCodeInterpreterCallCompleted = null, + global::System.Func? responseCodeInterpreterCallInProgress = null, + global::System.Func? responseCodeInterpreterCallInterpreting = null, + global::System.Func? responseCompleted = null, + global::System.Func? responseContentPartAdded = null, + global::System.Func? responseContentPartDone = null, + global::System.Func? responseCreated = null, + global::System.Func? error = null, + global::System.Func? responseFileSearchCallCompleted = null, + global::System.Func? responseFileSearchCallInProgress = null, + global::System.Func? responseFileSearchCallSearching = null, + global::System.Func? responseFunctionCallArgumentsDelta = null, + global::System.Func? responseFunctionCallArgumentsDone = null, + global::System.Func? responseInProgress = null, + global::System.Func? responseFailed = null, + global::System.Func? responseIncomplete = null, + global::System.Func? responseOutputItemAdded = null, + global::System.Func? responseOutputItemDone = null, + global::System.Func? responseReasoningSummaryPartAdded = null, + global::System.Func? responseReasoningSummaryPartDone = null, + global::System.Func? responseReasoningSummaryTextDelta = null, + global::System.Func? responseReasoningSummaryTextDone = null, + global::System.Func? responseReasoningTextDelta = null, + global::System.Func? responseReasoningTextDone = null, + global::System.Func? responseRefusalDelta = null, + global::System.Func? responseRefusalDone = null, + global::System.Func? responseOutputTextDelta = null, + global::System.Func? responseOutputTextDone = null, + global::System.Func? responseWebSearchCallCompleted = null, + global::System.Func? responseWebSearchCallInProgress = null, + global::System.Func? responseWebSearchCallSearching = null, + global::System.Func? responseImageGenerationCallCompleted = null, + global::System.Func? responseImageGenerationCallGenerating = null, + global::System.Func? responseImageGenerationCallInProgress = null, + global::System.Func? responseImageGenerationCallPartialImage = null, + global::System.Func? responseMcpCallArgumentsDelta = null, + global::System.Func? responseMcpCallArgumentsDone = null, + global::System.Func? responseMcpCallCompleted = null, + global::System.Func? responseMcpCallFailed = null, + global::System.Func? responseMcpCallInProgress = null, + global::System.Func? responseMcpListToolsCompleted = null, + global::System.Func? responseMcpListToolsFailed = null, + global::System.Func? responseMcpListToolsInProgress = null, + global::System.Func? responseOutputTextAnnotationAdded = null, + global::System.Func? responseQueued = null, + global::System.Func? responseCustomToolCallInputDelta = null, + global::System.Func? responseCustomToolCallInputDone = null, bool validate = true) { if (validate) @@ -2387,59 +3076,389 @@ public bool Validate() /// ///
public void Match( - global::System.Action? responseAudioDelta = null, - global::System.Action? responseAudioDone = null, - global::System.Action? responseAudioTranscriptDelta = null, - global::System.Action? responseAudioTranscriptDone = null, - global::System.Action? responseCodeInterpreterCallCodeDelta = null, - global::System.Action? responseCodeInterpreterCallCodeDone = null, - global::System.Action? responseCodeInterpreterCallCompleted = null, - global::System.Action? responseCodeInterpreterCallInProgress = null, - global::System.Action? responseCodeInterpreterCallInterpreting = null, - global::System.Action? responseCompleted = null, - global::System.Action? responseContentPartAdded = null, - global::System.Action? responseContentPartDone = null, - global::System.Action? responseCreated = null, - global::System.Action? error = null, - global::System.Action? responseFileSearchCallCompleted = null, - global::System.Action? responseFileSearchCallInProgress = null, - global::System.Action? responseFileSearchCallSearching = null, - global::System.Action? responseFunctionCallArgumentsDelta = null, - global::System.Action? responseFunctionCallArgumentsDone = null, - global::System.Action? responseInProgress = null, - global::System.Action? responseFailed = null, - global::System.Action? responseIncomplete = null, - global::System.Action? responseOutputItemAdded = null, - global::System.Action? responseOutputItemDone = null, - global::System.Action? responseReasoningSummaryPartAdded = null, - global::System.Action? responseReasoningSummaryPartDone = null, - global::System.Action? responseReasoningSummaryTextDelta = null, - global::System.Action? responseReasoningSummaryTextDone = null, - global::System.Action? responseReasoningTextDelta = null, - global::System.Action? responseReasoningTextDone = null, - global::System.Action? responseRefusalDelta = null, - global::System.Action? responseRefusalDone = null, - global::System.Action? responseOutputTextDelta = null, - global::System.Action? responseOutputTextDone = null, - global::System.Action? responseWebSearchCallCompleted = null, - global::System.Action? responseWebSearchCallInProgress = null, - global::System.Action? responseWebSearchCallSearching = null, - global::System.Action? responseImageGenerationCallCompleted = null, - global::System.Action? responseImageGenerationCallGenerating = null, - global::System.Action? responseImageGenerationCallInProgress = null, - global::System.Action? responseImageGenerationCallPartialImage = null, - global::System.Action? responseMcpCallArgumentsDelta = null, - global::System.Action? responseMcpCallArgumentsDone = null, - global::System.Action? responseMcpCallCompleted = null, - global::System.Action? responseMcpCallFailed = null, - global::System.Action? responseMcpCallInProgress = null, - global::System.Action? responseMcpListToolsCompleted = null, - global::System.Action? responseMcpListToolsFailed = null, - global::System.Action? responseMcpListToolsInProgress = null, - global::System.Action? responseOutputTextAnnotationAdded = null, - global::System.Action? responseQueued = null, - global::System.Action? responseCustomToolCallInputDelta = null, - global::System.Action? responseCustomToolCallInputDone = null, + global::System.Action? responseAudioDelta = null, + + global::System.Action? responseAudioDone = null, + + global::System.Action? responseAudioTranscriptDelta = null, + + global::System.Action? responseAudioTranscriptDone = null, + + global::System.Action? responseCodeInterpreterCallCodeDelta = null, + + global::System.Action? responseCodeInterpreterCallCodeDone = null, + + global::System.Action? responseCodeInterpreterCallCompleted = null, + + global::System.Action? responseCodeInterpreterCallInProgress = null, + + global::System.Action? responseCodeInterpreterCallInterpreting = null, + + global::System.Action? responseCompleted = null, + + global::System.Action? responseContentPartAdded = null, + + global::System.Action? responseContentPartDone = null, + + global::System.Action? responseCreated = null, + + global::System.Action? error = null, + + global::System.Action? responseFileSearchCallCompleted = null, + + global::System.Action? responseFileSearchCallInProgress = null, + + global::System.Action? responseFileSearchCallSearching = null, + + global::System.Action? responseFunctionCallArgumentsDelta = null, + + global::System.Action? responseFunctionCallArgumentsDone = null, + + global::System.Action? responseInProgress = null, + + global::System.Action? responseFailed = null, + + global::System.Action? responseIncomplete = null, + + global::System.Action? responseOutputItemAdded = null, + + global::System.Action? responseOutputItemDone = null, + + global::System.Action? responseReasoningSummaryPartAdded = null, + + global::System.Action? responseReasoningSummaryPartDone = null, + + global::System.Action? responseReasoningSummaryTextDelta = null, + + global::System.Action? responseReasoningSummaryTextDone = null, + + global::System.Action? responseReasoningTextDelta = null, + + global::System.Action? responseReasoningTextDone = null, + + global::System.Action? responseRefusalDelta = null, + + global::System.Action? responseRefusalDone = null, + + global::System.Action? responseOutputTextDelta = null, + + global::System.Action? responseOutputTextDone = null, + + global::System.Action? responseWebSearchCallCompleted = null, + + global::System.Action? responseWebSearchCallInProgress = null, + + global::System.Action? responseWebSearchCallSearching = null, + + global::System.Action? responseImageGenerationCallCompleted = null, + + global::System.Action? responseImageGenerationCallGenerating = null, + + global::System.Action? responseImageGenerationCallInProgress = null, + + global::System.Action? responseImageGenerationCallPartialImage = null, + + global::System.Action? responseMcpCallArgumentsDelta = null, + + global::System.Action? responseMcpCallArgumentsDone = null, + + global::System.Action? responseMcpCallCompleted = null, + + global::System.Action? responseMcpCallFailed = null, + + global::System.Action? responseMcpCallInProgress = null, + + global::System.Action? responseMcpListToolsCompleted = null, + + global::System.Action? responseMcpListToolsFailed = null, + + global::System.Action? responseMcpListToolsInProgress = null, + + global::System.Action? responseOutputTextAnnotationAdded = null, + + global::System.Action? responseQueued = null, + + global::System.Action? responseCustomToolCallInputDelta = null, + + global::System.Action? responseCustomToolCallInputDone = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsResponseAudioDelta) + { + responseAudioDelta?.Invoke(ResponseAudioDelta!); + } + else if (IsResponseAudioDone) + { + responseAudioDone?.Invoke(ResponseAudioDone!); + } + else if (IsResponseAudioTranscriptDelta) + { + responseAudioTranscriptDelta?.Invoke(ResponseAudioTranscriptDelta!); + } + else if (IsResponseAudioTranscriptDone) + { + responseAudioTranscriptDone?.Invoke(ResponseAudioTranscriptDone!); + } + else if (IsResponseCodeInterpreterCallCodeDelta) + { + responseCodeInterpreterCallCodeDelta?.Invoke(ResponseCodeInterpreterCallCodeDelta!); + } + else if (IsResponseCodeInterpreterCallCodeDone) + { + responseCodeInterpreterCallCodeDone?.Invoke(ResponseCodeInterpreterCallCodeDone!); + } + else if (IsResponseCodeInterpreterCallCompleted) + { + responseCodeInterpreterCallCompleted?.Invoke(ResponseCodeInterpreterCallCompleted!); + } + else if (IsResponseCodeInterpreterCallInProgress) + { + responseCodeInterpreterCallInProgress?.Invoke(ResponseCodeInterpreterCallInProgress!); + } + else if (IsResponseCodeInterpreterCallInterpreting) + { + responseCodeInterpreterCallInterpreting?.Invoke(ResponseCodeInterpreterCallInterpreting!); + } + else if (IsResponseCompleted) + { + responseCompleted?.Invoke(ResponseCompleted!); + } + else if (IsResponseContentPartAdded) + { + responseContentPartAdded?.Invoke(ResponseContentPartAdded!); + } + else if (IsResponseContentPartDone) + { + responseContentPartDone?.Invoke(ResponseContentPartDone!); + } + else if (IsResponseCreated) + { + responseCreated?.Invoke(ResponseCreated!); + } + else if (IsError) + { + error?.Invoke(Error!); + } + else if (IsResponseFileSearchCallCompleted) + { + responseFileSearchCallCompleted?.Invoke(ResponseFileSearchCallCompleted!); + } + else if (IsResponseFileSearchCallInProgress) + { + responseFileSearchCallInProgress?.Invoke(ResponseFileSearchCallInProgress!); + } + else if (IsResponseFileSearchCallSearching) + { + responseFileSearchCallSearching?.Invoke(ResponseFileSearchCallSearching!); + } + else if (IsResponseFunctionCallArgumentsDelta) + { + responseFunctionCallArgumentsDelta?.Invoke(ResponseFunctionCallArgumentsDelta!); + } + else if (IsResponseFunctionCallArgumentsDone) + { + responseFunctionCallArgumentsDone?.Invoke(ResponseFunctionCallArgumentsDone!); + } + else if (IsResponseInProgress) + { + responseInProgress?.Invoke(ResponseInProgress!); + } + else if (IsResponseFailed) + { + responseFailed?.Invoke(ResponseFailed!); + } + else if (IsResponseIncomplete) + { + responseIncomplete?.Invoke(ResponseIncomplete!); + } + else if (IsResponseOutputItemAdded) + { + responseOutputItemAdded?.Invoke(ResponseOutputItemAdded!); + } + else if (IsResponseOutputItemDone) + { + responseOutputItemDone?.Invoke(ResponseOutputItemDone!); + } + else if (IsResponseReasoningSummaryPartAdded) + { + responseReasoningSummaryPartAdded?.Invoke(ResponseReasoningSummaryPartAdded!); + } + else if (IsResponseReasoningSummaryPartDone) + { + responseReasoningSummaryPartDone?.Invoke(ResponseReasoningSummaryPartDone!); + } + else if (IsResponseReasoningSummaryTextDelta) + { + responseReasoningSummaryTextDelta?.Invoke(ResponseReasoningSummaryTextDelta!); + } + else if (IsResponseReasoningSummaryTextDone) + { + responseReasoningSummaryTextDone?.Invoke(ResponseReasoningSummaryTextDone!); + } + else if (IsResponseReasoningTextDelta) + { + responseReasoningTextDelta?.Invoke(ResponseReasoningTextDelta!); + } + else if (IsResponseReasoningTextDone) + { + responseReasoningTextDone?.Invoke(ResponseReasoningTextDone!); + } + else if (IsResponseRefusalDelta) + { + responseRefusalDelta?.Invoke(ResponseRefusalDelta!); + } + else if (IsResponseRefusalDone) + { + responseRefusalDone?.Invoke(ResponseRefusalDone!); + } + else if (IsResponseOutputTextDelta) + { + responseOutputTextDelta?.Invoke(ResponseOutputTextDelta!); + } + else if (IsResponseOutputTextDone) + { + responseOutputTextDone?.Invoke(ResponseOutputTextDone!); + } + else if (IsResponseWebSearchCallCompleted) + { + responseWebSearchCallCompleted?.Invoke(ResponseWebSearchCallCompleted!); + } + else if (IsResponseWebSearchCallInProgress) + { + responseWebSearchCallInProgress?.Invoke(ResponseWebSearchCallInProgress!); + } + else if (IsResponseWebSearchCallSearching) + { + responseWebSearchCallSearching?.Invoke(ResponseWebSearchCallSearching!); + } + else if (IsResponseImageGenerationCallCompleted) + { + responseImageGenerationCallCompleted?.Invoke(ResponseImageGenerationCallCompleted!); + } + else if (IsResponseImageGenerationCallGenerating) + { + responseImageGenerationCallGenerating?.Invoke(ResponseImageGenerationCallGenerating!); + } + else if (IsResponseImageGenerationCallInProgress) + { + responseImageGenerationCallInProgress?.Invoke(ResponseImageGenerationCallInProgress!); + } + else if (IsResponseImageGenerationCallPartialImage) + { + responseImageGenerationCallPartialImage?.Invoke(ResponseImageGenerationCallPartialImage!); + } + else if (IsResponseMcpCallArgumentsDelta) + { + responseMcpCallArgumentsDelta?.Invoke(ResponseMcpCallArgumentsDelta!); + } + else if (IsResponseMcpCallArgumentsDone) + { + responseMcpCallArgumentsDone?.Invoke(ResponseMcpCallArgumentsDone!); + } + else if (IsResponseMcpCallCompleted) + { + responseMcpCallCompleted?.Invoke(ResponseMcpCallCompleted!); + } + else if (IsResponseMcpCallFailed) + { + responseMcpCallFailed?.Invoke(ResponseMcpCallFailed!); + } + else if (IsResponseMcpCallInProgress) + { + responseMcpCallInProgress?.Invoke(ResponseMcpCallInProgress!); + } + else if (IsResponseMcpListToolsCompleted) + { + responseMcpListToolsCompleted?.Invoke(ResponseMcpListToolsCompleted!); + } + else if (IsResponseMcpListToolsFailed) + { + responseMcpListToolsFailed?.Invoke(ResponseMcpListToolsFailed!); + } + else if (IsResponseMcpListToolsInProgress) + { + responseMcpListToolsInProgress?.Invoke(ResponseMcpListToolsInProgress!); + } + else if (IsResponseOutputTextAnnotationAdded) + { + responseOutputTextAnnotationAdded?.Invoke(ResponseOutputTextAnnotationAdded!); + } + else if (IsResponseQueued) + { + responseQueued?.Invoke(ResponseQueued!); + } + else if (IsResponseCustomToolCallInputDelta) + { + responseCustomToolCallInputDelta?.Invoke(ResponseCustomToolCallInputDelta!); + } + else if (IsResponseCustomToolCallInputDone) + { + responseCustomToolCallInputDone?.Invoke(ResponseCustomToolCallInputDone!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? responseAudioDelta = null, + global::System.Action? responseAudioDone = null, + global::System.Action? responseAudioTranscriptDelta = null, + global::System.Action? responseAudioTranscriptDone = null, + global::System.Action? responseCodeInterpreterCallCodeDelta = null, + global::System.Action? responseCodeInterpreterCallCodeDone = null, + global::System.Action? responseCodeInterpreterCallCompleted = null, + global::System.Action? responseCodeInterpreterCallInProgress = null, + global::System.Action? responseCodeInterpreterCallInterpreting = null, + global::System.Action? responseCompleted = null, + global::System.Action? responseContentPartAdded = null, + global::System.Action? responseContentPartDone = null, + global::System.Action? responseCreated = null, + global::System.Action? error = null, + global::System.Action? responseFileSearchCallCompleted = null, + global::System.Action? responseFileSearchCallInProgress = null, + global::System.Action? responseFileSearchCallSearching = null, + global::System.Action? responseFunctionCallArgumentsDelta = null, + global::System.Action? responseFunctionCallArgumentsDone = null, + global::System.Action? responseInProgress = null, + global::System.Action? responseFailed = null, + global::System.Action? responseIncomplete = null, + global::System.Action? responseOutputItemAdded = null, + global::System.Action? responseOutputItemDone = null, + global::System.Action? responseReasoningSummaryPartAdded = null, + global::System.Action? responseReasoningSummaryPartDone = null, + global::System.Action? responseReasoningSummaryTextDelta = null, + global::System.Action? responseReasoningSummaryTextDone = null, + global::System.Action? responseReasoningTextDelta = null, + global::System.Action? responseReasoningTextDone = null, + global::System.Action? responseRefusalDelta = null, + global::System.Action? responseRefusalDone = null, + global::System.Action? responseOutputTextDelta = null, + global::System.Action? responseOutputTextDone = null, + global::System.Action? responseWebSearchCallCompleted = null, + global::System.Action? responseWebSearchCallInProgress = null, + global::System.Action? responseWebSearchCallSearching = null, + global::System.Action? responseImageGenerationCallCompleted = null, + global::System.Action? responseImageGenerationCallGenerating = null, + global::System.Action? responseImageGenerationCallInProgress = null, + global::System.Action? responseImageGenerationCallPartialImage = null, + global::System.Action? responseMcpCallArgumentsDelta = null, + global::System.Action? responseMcpCallArgumentsDone = null, + global::System.Action? responseMcpCallCompleted = null, + global::System.Action? responseMcpCallFailed = null, + global::System.Action? responseMcpCallInProgress = null, + global::System.Action? responseMcpListToolsCompleted = null, + global::System.Action? responseMcpListToolsFailed = null, + global::System.Action? responseMcpListToolsInProgress = null, + global::System.Action? responseOutputTextAnnotationAdded = null, + global::System.Action? responseQueued = null, + global::System.Action? responseCustomToolCallInputDelta = null, + global::System.Action? responseCustomToolCallInputDone = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesClientEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesClientEvent.g.cs index b941e5e6..e6d555e0 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesClientEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesClientEvent.g.cs @@ -29,6 +29,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseCreate))] #endif public bool IsResponseCreate => ResponseCreate != null; + + /// + /// + /// + public bool TryPickResponseCreate( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponsesClientEventResponseCreate? value) + { + value = ResponseCreate; + return IsResponseCreate; + } /// /// /// @@ -107,6 +120,24 @@ public void Match( } } + /// + /// + /// + public void Switch( + global::System.Action? responseCreate = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsResponseCreate) + { + responseCreate?.Invoke(ResponseCreate!); + } + } + /// /// /// diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesClientEventResponseCreate.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesClientEventResponseCreate.g.cs index 1efac4b7..5dac0fad 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesClientEventResponseCreate.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesClientEventResponseCreate.g.cs @@ -30,6 +30,19 @@ namespace tryAGI.OpenAI #endif public bool IsResponsesClientEventResponseCreateVariant1 => ResponsesClientEventResponseCreateVariant1 != null; + /// + /// + /// + public bool TryPickResponsesClientEventResponseCreateVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponsesClientEventResponseCreateVariant1? value) + { + value = ResponsesClientEventResponseCreateVariant1; + return IsResponsesClientEventResponseCreateVariant1; + } + /// /// /// @@ -46,6 +59,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CreateResponse))] #endif public bool IsCreateResponse => CreateResponse != null; + + /// + /// + /// + public bool TryPickCreateResponse( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CreateResponse? value) + { + value = CreateResponse; + return IsCreateResponse; + } /// /// /// @@ -122,7 +148,7 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? responsesClientEventResponseCreateVariant1 = null, + global::System.Func? responsesClientEventResponseCreateVariant1 = null, global::System.Func? createResponse = null, bool validate = true) { @@ -147,7 +173,31 @@ public bool Validate() /// ///
public void Match( - global::System.Action? responsesClientEventResponseCreateVariant1 = null, + global::System.Action? responsesClientEventResponseCreateVariant1 = null, + + global::System.Action? createResponse = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsResponsesClientEventResponseCreateVariant1) + { + responsesClientEventResponseCreateVariant1?.Invoke(ResponsesClientEventResponseCreateVariant1!); + } + else if (IsCreateResponse) + { + createResponse?.Invoke(CreateResponse!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? responsesClientEventResponseCreateVariant1 = null, global::System.Action? createResponse = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesServerEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesServerEvent.g.cs index 9e6a987c..8fb3ffc5 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesServerEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsesServerEvent.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseStream))] #endif public bool IsResponseStream => ResponseStream != null; + + /// + /// + /// + public bool TryPickResponseStream( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseStreamEvent? value) + { + value = ResponseStream; + return IsResponseStream; + } /// /// /// @@ -103,6 +116,24 @@ public void Match( } } + /// + /// + /// + public void Switch( + global::System.Action? responseStream = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsResponseStream) + { + responseStream?.Invoke(ResponseStream!); + } + } + /// /// /// diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResultsItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResultsItem.g.cs index e2876c3f..07418781 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResultsItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResultsItem.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsOrganizationUsageCompletionsResult => OrganizationUsageCompletionsResult != null; + /// + /// + /// + public bool TryPickOrganizationUsageCompletionsResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UsageCompletionsResult? value) + { + value = OrganizationUsageCompletionsResult; + return IsOrganizationUsageCompletionsResult; + } + /// /// The aggregated embeddings usage details of the specific time bucket. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsOrganizationUsageEmbeddingsResult => OrganizationUsageEmbeddingsResult != null; + /// + /// + /// + public bool TryPickOrganizationUsageEmbeddingsResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UsageEmbeddingsResult? value) + { + value = OrganizationUsageEmbeddingsResult; + return IsOrganizationUsageEmbeddingsResult; + } + /// /// The aggregated moderations usage details of the specific time bucket. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsOrganizationUsageModerationsResult => OrganizationUsageModerationsResult != null; + /// + /// + /// + public bool TryPickOrganizationUsageModerationsResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UsageModerationsResult? value) + { + value = OrganizationUsageModerationsResult; + return IsOrganizationUsageModerationsResult; + } + /// /// The aggregated images usage details of the specific time bucket. /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI #endif public bool IsOrganizationUsageImagesResult => OrganizationUsageImagesResult != null; + /// + /// + /// + public bool TryPickOrganizationUsageImagesResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UsageImagesResult? value) + { + value = OrganizationUsageImagesResult; + return IsOrganizationUsageImagesResult; + } + /// /// The aggregated audio speeches usage details of the specific time bucket. /// @@ -94,6 +146,19 @@ namespace tryAGI.OpenAI #endif public bool IsOrganizationUsageAudioSpeechesResult => OrganizationUsageAudioSpeechesResult != null; + /// + /// + /// + public bool TryPickOrganizationUsageAudioSpeechesResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UsageAudioSpeechesResult? value) + { + value = OrganizationUsageAudioSpeechesResult; + return IsOrganizationUsageAudioSpeechesResult; + } + /// /// The aggregated audio transcriptions usage details of the specific time bucket. /// @@ -111,6 +176,19 @@ namespace tryAGI.OpenAI #endif public bool IsOrganizationUsageAudioTranscriptionsResult => OrganizationUsageAudioTranscriptionsResult != null; + /// + /// + /// + public bool TryPickOrganizationUsageAudioTranscriptionsResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UsageAudioTranscriptionsResult? value) + { + value = OrganizationUsageAudioTranscriptionsResult; + return IsOrganizationUsageAudioTranscriptionsResult; + } + /// /// The aggregated vector stores usage details of the specific time bucket. /// @@ -128,6 +206,19 @@ namespace tryAGI.OpenAI #endif public bool IsOrganizationUsageVectorStoresResult => OrganizationUsageVectorStoresResult != null; + /// + /// + /// + public bool TryPickOrganizationUsageVectorStoresResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UsageVectorStoresResult? value) + { + value = OrganizationUsageVectorStoresResult; + return IsOrganizationUsageVectorStoresResult; + } + /// /// The aggregated code interpreter sessions usage details of the specific time bucket. /// @@ -145,6 +236,19 @@ namespace tryAGI.OpenAI #endif public bool IsOrganizationUsageCodeInterpreterSessionsResult => OrganizationUsageCodeInterpreterSessionsResult != null; + /// + /// + /// + public bool TryPickOrganizationUsageCodeInterpreterSessionsResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UsageCodeInterpreterSessionsResult? value) + { + value = OrganizationUsageCodeInterpreterSessionsResult; + return IsOrganizationUsageCodeInterpreterSessionsResult; + } + /// /// The aggregated costs details of the specific time bucket. /// @@ -161,6 +265,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(OrganizationCostsResult))] #endif public bool IsOrganizationCostsResult => OrganizationCostsResult != null; + + /// + /// + /// + public bool TryPickOrganizationCostsResult( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CostsResult? value) + { + value = OrganizationCostsResult; + return IsOrganizationCostsResult; + } /// /// /// @@ -391,15 +508,15 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? organizationUsageCompletionsResult = null, - global::System.Func? organizationUsageEmbeddingsResult = null, - global::System.Func? organizationUsageModerationsResult = null, - global::System.Func? organizationUsageImagesResult = null, - global::System.Func? organizationUsageAudioSpeechesResult = null, - global::System.Func? organizationUsageAudioTranscriptionsResult = null, - global::System.Func? organizationUsageVectorStoresResult = null, - global::System.Func? organizationUsageCodeInterpreterSessionsResult = null, - global::System.Func? organizationCostsResult = null, + global::System.Func? organizationUsageCompletionsResult = null, + global::System.Func? organizationUsageEmbeddingsResult = null, + global::System.Func? organizationUsageModerationsResult = null, + global::System.Func? organizationUsageImagesResult = null, + global::System.Func? organizationUsageAudioSpeechesResult = null, + global::System.Func? organizationUsageAudioTranscriptionsResult = null, + global::System.Func? organizationUsageVectorStoresResult = null, + global::System.Func? organizationUsageCodeInterpreterSessionsResult = null, + global::System.Func? organizationCostsResult = null, bool validate = true) { if (validate) @@ -451,15 +568,81 @@ public bool Validate() /// ///
public void Match( - global::System.Action? organizationUsageCompletionsResult = null, - global::System.Action? organizationUsageEmbeddingsResult = null, - global::System.Action? organizationUsageModerationsResult = null, - global::System.Action? organizationUsageImagesResult = null, - global::System.Action? organizationUsageAudioSpeechesResult = null, - global::System.Action? organizationUsageAudioTranscriptionsResult = null, - global::System.Action? organizationUsageVectorStoresResult = null, - global::System.Action? organizationUsageCodeInterpreterSessionsResult = null, - global::System.Action? organizationCostsResult = null, + global::System.Action? organizationUsageCompletionsResult = null, + + global::System.Action? organizationUsageEmbeddingsResult = null, + + global::System.Action? organizationUsageModerationsResult = null, + + global::System.Action? organizationUsageImagesResult = null, + + global::System.Action? organizationUsageAudioSpeechesResult = null, + + global::System.Action? organizationUsageAudioTranscriptionsResult = null, + + global::System.Action? organizationUsageVectorStoresResult = null, + + global::System.Action? organizationUsageCodeInterpreterSessionsResult = null, + + global::System.Action? organizationCostsResult = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOrganizationUsageCompletionsResult) + { + organizationUsageCompletionsResult?.Invoke(OrganizationUsageCompletionsResult!); + } + else if (IsOrganizationUsageEmbeddingsResult) + { + organizationUsageEmbeddingsResult?.Invoke(OrganizationUsageEmbeddingsResult!); + } + else if (IsOrganizationUsageModerationsResult) + { + organizationUsageModerationsResult?.Invoke(OrganizationUsageModerationsResult!); + } + else if (IsOrganizationUsageImagesResult) + { + organizationUsageImagesResult?.Invoke(OrganizationUsageImagesResult!); + } + else if (IsOrganizationUsageAudioSpeechesResult) + { + organizationUsageAudioSpeechesResult?.Invoke(OrganizationUsageAudioSpeechesResult!); + } + else if (IsOrganizationUsageAudioTranscriptionsResult) + { + organizationUsageAudioTranscriptionsResult?.Invoke(OrganizationUsageAudioTranscriptionsResult!); + } + else if (IsOrganizationUsageVectorStoresResult) + { + organizationUsageVectorStoresResult?.Invoke(OrganizationUsageVectorStoresResult!); + } + else if (IsOrganizationUsageCodeInterpreterSessionsResult) + { + organizationUsageCodeInterpreterSessionsResult?.Invoke(OrganizationUsageCodeInterpreterSessionsResult!); + } + else if (IsOrganizationCostsResult) + { + organizationCostsResult?.Invoke(OrganizationCostsResult!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? organizationUsageCompletionsResult = null, + global::System.Action? organizationUsageEmbeddingsResult = null, + global::System.Action? organizationUsageModerationsResult = null, + global::System.Action? organizationUsageImagesResult = null, + global::System.Action? organizationUsageAudioSpeechesResult = null, + global::System.Action? organizationUsageAudioTranscriptionsResult = null, + global::System.Action? organizationUsageVectorStoresResult = null, + global::System.Action? organizationUsageCodeInterpreterSessionsResult = null, + global::System.Action? organizationCostsResult = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RunStepStreamEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RunStepStreamEvent.g.cs index 42c6353e..21e03714 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RunStepStreamEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RunStepStreamEvent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStepStreamEventVariant1 => RunStepStreamEventVariant1 != null; + /// + /// + /// + public bool TryPickRunStepStreamEventVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStepStreamEventVariant1? value) + { + value = RunStepStreamEventVariant1; + return IsRunStepStreamEventVariant1; + } + /// /// Occurs when a [run step](/docs/api-reference/run-steps/step-object) moves to an `in_progress` state. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStepStreamEventVariant2 => RunStepStreamEventVariant2 != null; + /// + /// + /// + public bool TryPickRunStepStreamEventVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStepStreamEventVariant2? value) + { + value = RunStepStreamEventVariant2; + return IsRunStepStreamEventVariant2; + } + /// /// Occurs when parts of a [run step](/docs/api-reference/run-steps/step-object) are being streamed. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStepStreamEventVariant3 => RunStepStreamEventVariant3 != null; + /// + /// + /// + public bool TryPickRunStepStreamEventVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStepStreamEventVariant3? value) + { + value = RunStepStreamEventVariant3; + return IsRunStepStreamEventVariant3; + } + /// /// Occurs when a [run step](/docs/api-reference/run-steps/step-object) is completed. /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStepStreamEventVariant4 => RunStepStreamEventVariant4 != null; + /// + /// + /// + public bool TryPickRunStepStreamEventVariant4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStepStreamEventVariant4? value) + { + value = RunStepStreamEventVariant4; + return IsRunStepStreamEventVariant4; + } + /// /// Occurs when a [run step](/docs/api-reference/run-steps/step-object) fails. /// @@ -94,6 +146,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStepStreamEventVariant5 => RunStepStreamEventVariant5 != null; + /// + /// + /// + public bool TryPickRunStepStreamEventVariant5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStepStreamEventVariant5? value) + { + value = RunStepStreamEventVariant5; + return IsRunStepStreamEventVariant5; + } + /// /// Occurs when a [run step](/docs/api-reference/run-steps/step-object) is cancelled. /// @@ -111,6 +176,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStepStreamEventVariant6 => RunStepStreamEventVariant6 != null; + /// + /// + /// + public bool TryPickRunStepStreamEventVariant6( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStepStreamEventVariant6? value) + { + value = RunStepStreamEventVariant6; + return IsRunStepStreamEventVariant6; + } + /// /// Occurs when a [run step](/docs/api-reference/run-steps/step-object) expires. /// @@ -127,6 +205,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RunStepStreamEventVariant7))] #endif public bool IsRunStepStreamEventVariant7 => RunStepStreamEventVariant7 != null; + + /// + /// + /// + public bool TryPickRunStepStreamEventVariant7( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStepStreamEventVariant7? value) + { + value = RunStepStreamEventVariant7; + return IsRunStepStreamEventVariant7; + } /// /// /// @@ -313,13 +404,13 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? runStepStreamEventVariant1 = null, - global::System.Func? runStepStreamEventVariant2 = null, - global::System.Func? runStepStreamEventVariant3 = null, - global::System.Func? runStepStreamEventVariant4 = null, - global::System.Func? runStepStreamEventVariant5 = null, - global::System.Func? runStepStreamEventVariant6 = null, - global::System.Func? runStepStreamEventVariant7 = null, + global::System.Func? runStepStreamEventVariant1 = null, + global::System.Func? runStepStreamEventVariant2 = null, + global::System.Func? runStepStreamEventVariant3 = null, + global::System.Func? runStepStreamEventVariant4 = null, + global::System.Func? runStepStreamEventVariant5 = null, + global::System.Func? runStepStreamEventVariant6 = null, + global::System.Func? runStepStreamEventVariant7 = null, bool validate = true) { if (validate) @@ -363,13 +454,67 @@ public bool Validate() /// ///
public void Match( - global::System.Action? runStepStreamEventVariant1 = null, - global::System.Action? runStepStreamEventVariant2 = null, - global::System.Action? runStepStreamEventVariant3 = null, - global::System.Action? runStepStreamEventVariant4 = null, - global::System.Action? runStepStreamEventVariant5 = null, - global::System.Action? runStepStreamEventVariant6 = null, - global::System.Action? runStepStreamEventVariant7 = null, + global::System.Action? runStepStreamEventVariant1 = null, + + global::System.Action? runStepStreamEventVariant2 = null, + + global::System.Action? runStepStreamEventVariant3 = null, + + global::System.Action? runStepStreamEventVariant4 = null, + + global::System.Action? runStepStreamEventVariant5 = null, + + global::System.Action? runStepStreamEventVariant6 = null, + + global::System.Action? runStepStreamEventVariant7 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsRunStepStreamEventVariant1) + { + runStepStreamEventVariant1?.Invoke(RunStepStreamEventVariant1!); + } + else if (IsRunStepStreamEventVariant2) + { + runStepStreamEventVariant2?.Invoke(RunStepStreamEventVariant2!); + } + else if (IsRunStepStreamEventVariant3) + { + runStepStreamEventVariant3?.Invoke(RunStepStreamEventVariant3!); + } + else if (IsRunStepStreamEventVariant4) + { + runStepStreamEventVariant4?.Invoke(RunStepStreamEventVariant4!); + } + else if (IsRunStepStreamEventVariant5) + { + runStepStreamEventVariant5?.Invoke(RunStepStreamEventVariant5!); + } + else if (IsRunStepStreamEventVariant6) + { + runStepStreamEventVariant6?.Invoke(RunStepStreamEventVariant6!); + } + else if (IsRunStepStreamEventVariant7) + { + runStepStreamEventVariant7?.Invoke(RunStepStreamEventVariant7!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? runStepStreamEventVariant1 = null, + global::System.Action? runStepStreamEventVariant2 = null, + global::System.Action? runStepStreamEventVariant3 = null, + global::System.Action? runStepStreamEventVariant4 = null, + global::System.Action? runStepStreamEventVariant5 = null, + global::System.Action? runStepStreamEventVariant6 = null, + global::System.Action? runStepStreamEventVariant7 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RunStreamEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RunStreamEvent.g.cs index b04a4a59..5515ab5f 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RunStreamEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RunStreamEvent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStreamEventVariant1 => RunStreamEventVariant1 != null; + /// + /// + /// + public bool TryPickRunStreamEventVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStreamEventVariant1? value) + { + value = RunStreamEventVariant1; + return IsRunStreamEventVariant1; + } + /// /// Occurs when a [run](/docs/api-reference/runs/object) moves to a `queued` status. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStreamEventVariant2 => RunStreamEventVariant2 != null; + /// + /// + /// + public bool TryPickRunStreamEventVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStreamEventVariant2? value) + { + value = RunStreamEventVariant2; + return IsRunStreamEventVariant2; + } + /// /// Occurs when a [run](/docs/api-reference/runs/object) moves to an `in_progress` status. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStreamEventVariant3 => RunStreamEventVariant3 != null; + /// + /// + /// + public bool TryPickRunStreamEventVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStreamEventVariant3? value) + { + value = RunStreamEventVariant3; + return IsRunStreamEventVariant3; + } + /// /// Occurs when a [run](/docs/api-reference/runs/object) moves to a `requires_action` status. /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStreamEventVariant4 => RunStreamEventVariant4 != null; + /// + /// + /// + public bool TryPickRunStreamEventVariant4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStreamEventVariant4? value) + { + value = RunStreamEventVariant4; + return IsRunStreamEventVariant4; + } + /// /// Occurs when a [run](/docs/api-reference/runs/object) is completed. /// @@ -94,6 +146,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStreamEventVariant5 => RunStreamEventVariant5 != null; + /// + /// + /// + public bool TryPickRunStreamEventVariant5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStreamEventVariant5? value) + { + value = RunStreamEventVariant5; + return IsRunStreamEventVariant5; + } + /// /// Occurs when a [run](/docs/api-reference/runs/object) ends with status `incomplete`. /// @@ -111,6 +176,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStreamEventVariant6 => RunStreamEventVariant6 != null; + /// + /// + /// + public bool TryPickRunStreamEventVariant6( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStreamEventVariant6? value) + { + value = RunStreamEventVariant6; + return IsRunStreamEventVariant6; + } + /// /// Occurs when a [run](/docs/api-reference/runs/object) fails. /// @@ -128,6 +206,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStreamEventVariant7 => RunStreamEventVariant7 != null; + /// + /// + /// + public bool TryPickRunStreamEventVariant7( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStreamEventVariant7? value) + { + value = RunStreamEventVariant7; + return IsRunStreamEventVariant7; + } + /// /// Occurs when a [run](/docs/api-reference/runs/object) moves to a `cancelling` status. /// @@ -145,6 +236,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStreamEventVariant8 => RunStreamEventVariant8 != null; + /// + /// + /// + public bool TryPickRunStreamEventVariant8( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStreamEventVariant8? value) + { + value = RunStreamEventVariant8; + return IsRunStreamEventVariant8; + } + /// /// Occurs when a [run](/docs/api-reference/runs/object) is cancelled. /// @@ -162,6 +266,19 @@ namespace tryAGI.OpenAI #endif public bool IsRunStreamEventVariant9 => RunStreamEventVariant9 != null; + /// + /// + /// + public bool TryPickRunStreamEventVariant9( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStreamEventVariant9? value) + { + value = RunStreamEventVariant9; + return IsRunStreamEventVariant9; + } + /// /// Occurs when a [run](/docs/api-reference/runs/object) expires. /// @@ -178,6 +295,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RunStreamEventVariant10))] #endif public bool IsRunStreamEventVariant10 => RunStreamEventVariant10 != null; + + /// + /// + /// + public bool TryPickRunStreamEventVariant10( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RunStreamEventVariant10? value) + { + value = RunStreamEventVariant10; + return IsRunStreamEventVariant10; + } /// /// /// @@ -430,16 +560,16 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? runStreamEventVariant1 = null, - global::System.Func? runStreamEventVariant2 = null, - global::System.Func? runStreamEventVariant3 = null, - global::System.Func? runStreamEventVariant4 = null, - global::System.Func? runStreamEventVariant5 = null, - global::System.Func? runStreamEventVariant6 = null, - global::System.Func? runStreamEventVariant7 = null, - global::System.Func? runStreamEventVariant8 = null, - global::System.Func? runStreamEventVariant9 = null, - global::System.Func? runStreamEventVariant10 = null, + global::System.Func? runStreamEventVariant1 = null, + global::System.Func? runStreamEventVariant2 = null, + global::System.Func? runStreamEventVariant3 = null, + global::System.Func? runStreamEventVariant4 = null, + global::System.Func? runStreamEventVariant5 = null, + global::System.Func? runStreamEventVariant6 = null, + global::System.Func? runStreamEventVariant7 = null, + global::System.Func? runStreamEventVariant8 = null, + global::System.Func? runStreamEventVariant9 = null, + global::System.Func? runStreamEventVariant10 = null, bool validate = true) { if (validate) @@ -495,16 +625,88 @@ public bool Validate() /// ///
public void Match( - global::System.Action? runStreamEventVariant1 = null, - global::System.Action? runStreamEventVariant2 = null, - global::System.Action? runStreamEventVariant3 = null, - global::System.Action? runStreamEventVariant4 = null, - global::System.Action? runStreamEventVariant5 = null, - global::System.Action? runStreamEventVariant6 = null, - global::System.Action? runStreamEventVariant7 = null, - global::System.Action? runStreamEventVariant8 = null, - global::System.Action? runStreamEventVariant9 = null, - global::System.Action? runStreamEventVariant10 = null, + global::System.Action? runStreamEventVariant1 = null, + + global::System.Action? runStreamEventVariant2 = null, + + global::System.Action? runStreamEventVariant3 = null, + + global::System.Action? runStreamEventVariant4 = null, + + global::System.Action? runStreamEventVariant5 = null, + + global::System.Action? runStreamEventVariant6 = null, + + global::System.Action? runStreamEventVariant7 = null, + + global::System.Action? runStreamEventVariant8 = null, + + global::System.Action? runStreamEventVariant9 = null, + + global::System.Action? runStreamEventVariant10 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsRunStreamEventVariant1) + { + runStreamEventVariant1?.Invoke(RunStreamEventVariant1!); + } + else if (IsRunStreamEventVariant2) + { + runStreamEventVariant2?.Invoke(RunStreamEventVariant2!); + } + else if (IsRunStreamEventVariant3) + { + runStreamEventVariant3?.Invoke(RunStreamEventVariant3!); + } + else if (IsRunStreamEventVariant4) + { + runStreamEventVariant4?.Invoke(RunStreamEventVariant4!); + } + else if (IsRunStreamEventVariant5) + { + runStreamEventVariant5?.Invoke(RunStreamEventVariant5!); + } + else if (IsRunStreamEventVariant6) + { + runStreamEventVariant6?.Invoke(RunStreamEventVariant6!); + } + else if (IsRunStreamEventVariant7) + { + runStreamEventVariant7?.Invoke(RunStreamEventVariant7!); + } + else if (IsRunStreamEventVariant8) + { + runStreamEventVariant8?.Invoke(RunStreamEventVariant8!); + } + else if (IsRunStreamEventVariant9) + { + runStreamEventVariant9?.Invoke(RunStreamEventVariant9!); + } + else if (IsRunStreamEventVariant10) + { + runStreamEventVariant10?.Invoke(RunStreamEventVariant10!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? runStreamEventVariant1 = null, + global::System.Action? runStreamEventVariant2 = null, + global::System.Action? runStreamEventVariant3 = null, + global::System.Action? runStreamEventVariant4 = null, + global::System.Action? runStreamEventVariant5 = null, + global::System.Action? runStreamEventVariant6 = null, + global::System.Action? runStreamEventVariant7 = null, + global::System.Action? runStreamEventVariant8 = null, + global::System.Action? runStreamEventVariant9 = null, + global::System.Action? runStreamEventVariant10 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Session2.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Session2.g.cs index b181f7ca..5dff6425 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Session2.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Session2.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsRealtime => Realtime != null; + /// + /// + /// + public bool TryPickRealtime( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeSessionCreateResponseGA? value) + { + value = Realtime; + return IsRealtime; + } + /// /// A Realtime transcription session configuration object. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Transcription))] #endif public bool IsTranscription => Transcription != null; + + /// + /// + /// + public bool TryPickTranscription( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.RealtimeTranscriptionSessionCreateResponseGA? value) + { + value = Transcription; + return IsTranscription; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? realtime = null, - global::System.Func? transcription = null, + global::System.Func? realtime = null, + global::System.Func? transcription = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? realtime = null, - global::System.Action? transcription = null, + global::System.Action? realtime = null, + + global::System.Action? transcription = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsRealtime) + { + realtime?.Invoke(Realtime!); + } + else if (IsTranscription) + { + transcription?.Invoke(Transcription!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? realtime = null, + global::System.Action? transcription = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SkillsItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SkillsItem.g.cs index afc8c88e..e7f7efe0 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SkillsItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SkillsItem.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsSkillReference => SkillReference != null; + /// + /// + /// + public bool TryPickSkillReference( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.SkillReferenceParam? value) + { + value = SkillReference; + return IsSkillReference; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Inline))] #endif public bool IsInline => Inline != null; + + /// + /// + /// + public bool TryPickInline( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InlineSkillParam? value) + { + value = Inline; + return IsInline; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? skillReference = null, - global::System.Func? inline = null, + global::System.Func? skillReference = null, + global::System.Func? inline = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? skillReference = null, - global::System.Action? inline = null, + global::System.Action? skillReference = null, + + global::System.Action? inline = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSkillReference) + { + skillReference?.Invoke(SkillReference!); + } + else if (IsInline) + { + inline?.Invoke(Inline!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? skillReference = null, + global::System.Action? inline = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SkillsItem2.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SkillsItem2.g.cs index 77a7cc9a..fa865771 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SkillsItem2.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SkillsItem2.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsSkillReference => SkillReference != null; + /// + /// + /// + public bool TryPickSkillReference( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.SkillReferenceParam? value) + { + value = SkillReference; + return IsSkillReference; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Inline))] #endif public bool IsInline => Inline != null; + + /// + /// + /// + public bool TryPickInline( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.InlineSkillParam? value) + { + value = Inline; + return IsInline; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? skillReference = null, - global::System.Func? inline = null, + global::System.Func? skillReference = null, + global::System.Func? inline = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? skillReference = null, - global::System.Action? inline = null, + global::System.Action? skillReference = null, + + global::System.Action? inline = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSkillReference) + { + skillReference?.Invoke(SkillReference!); + } + else if (IsInline) + { + inline?.Invoke(Inline!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? skillReference = null, + global::System.Action? inline = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Status.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Status.g.cs index 23715356..dba8a20a 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Status.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Status.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsActive => Active != null; + /// + /// + /// + public bool TryPickActive( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ActiveStatus? value) + { + value = Active; + return IsActive; + } + /// /// Indicates that a thread is locked and cannot accept new input. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocked => Locked != null; + /// + /// + /// + public bool TryPickLocked( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LockedStatus? value) + { + value = Locked; + return IsLocked; + } + /// /// Indicates that a thread has been closed. /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Closed))] #endif public bool IsClosed => Closed != null; + + /// + /// + /// + public bool TryPickClosed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ClosedStatus? value) + { + value = Closed; + return IsClosed; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? active = null, - global::System.Func? locked = null, - global::System.Func? closed = null, + global::System.Func? active = null, + global::System.Func? locked = null, + global::System.Func? closed = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// ///
public void Match( - global::System.Action? active = null, - global::System.Action? locked = null, - global::System.Action? closed = null, + global::System.Action? active = null, + + global::System.Action? locked = null, + + global::System.Action? closed = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsActive) + { + active?.Invoke(Active!); + } + else if (IsLocked) + { + locked?.Invoke(Locked!); + } + else if (IsClosed) + { + closed?.Invoke(Closed!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? active = null, + global::System.Action? locked = null, + global::System.Action? closed = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.StopConfiguration.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.StopConfiguration.g.cs index f502037a..a8bdebeb 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.StopConfiguration.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.StopConfiguration.g.cs @@ -29,6 +29,19 @@ namespace tryAGI.OpenAI #endif public bool IsStopConfigurationVariant1 => StopConfigurationVariant1 != null; + /// + /// + /// + public bool TryPickStopConfigurationVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = StopConfigurationVariant1; + return IsStopConfigurationVariant1; + } + /// /// /// @@ -45,6 +58,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(StopConfigurationVariant2))] #endif public bool IsStopConfigurationVariant2 => StopConfigurationVariant2 != null; + + /// + /// + /// + public bool TryPickStopConfigurationVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = StopConfigurationVariant2; + return IsStopConfigurationVariant2; + } /// /// /// @@ -103,8 +129,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? stopConfigurationVariant1 = null, - global::System.Func?, TResult>? stopConfigurationVariant2 = null, + global::System.Func? stopConfigurationVariant1 = null, + global::System.Func, TResult>? stopConfigurationVariant2 = null, bool validate = true) { if (validate) @@ -128,8 +154,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? stopConfigurationVariant1 = null, - global::System.Action?>? stopConfigurationVariant2 = null, + global::System.Action? stopConfigurationVariant1 = null, + + global::System.Action>? stopConfigurationVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsStopConfigurationVariant1) + { + stopConfigurationVariant1?.Invoke(StopConfigurationVariant1!); + } + else if (IsStopConfigurationVariant2) + { + stopConfigurationVariant2?.Invoke(StopConfigurationVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? stopConfigurationVariant1 = null, + global::System.Action>? stopConfigurationVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TextResponseFormatConfiguration.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TextResponseFormatConfiguration.g.cs index ea6bf519..a62d4853 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TextResponseFormatConfiguration.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TextResponseFormatConfiguration.g.cs @@ -34,6 +34,19 @@ namespace tryAGI.OpenAI #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFormatText? value) + { + value = Text; + return IsText; + } + /// /// JSON Schema response format. Used to generate structured JSON responses.
/// Learn more about [Structured Outputs](/docs/guides/structured-outputs). @@ -52,6 +65,19 @@ namespace tryAGI.OpenAI #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.TextResponseFormatJsonSchema? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// JSON object response format. An older method of generating JSON responses.
/// Using `json_schema` is recommended for models that support it. Note that the
@@ -71,6 +97,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JsonObject))] #endif public bool IsJsonObject => JsonObject != null; + + /// + /// + /// + public bool TryPickJsonObject( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ResponseFormatJsonObject? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -169,9 +208,9 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? text = null, - global::System.Func? jsonSchema = null, - global::System.Func? jsonObject = null, + global::System.Func? text = null, + global::System.Func? jsonSchema = null, + global::System.Func? jsonObject = null, bool validate = true) { if (validate) @@ -199,9 +238,39 @@ public bool Validate() /// ///
public void Match( - global::System.Action? text = null, - global::System.Action? jsonSchema = null, - global::System.Action? jsonObject = null, + global::System.Action? text = null, + + global::System.Action? jsonSchema = null, + + global::System.Action? jsonObject = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsJsonSchema) + { + jsonSchema?.Invoke(JsonSchema!); + } + else if (IsJsonObject) + { + jsonObject?.Invoke(JsonObject!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? jsonSchema = null, + global::System.Action? jsonObject = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ThreadItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ThreadItem.g.cs index 384b064c..713e3701 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ThreadItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ThreadItem.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsChatkitUserMessage => ChatkitUserMessage != null; + /// + /// + /// + public bool TryPickChatkitUserMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.UserMessageItem? value) + { + value = ChatkitUserMessage; + return IsChatkitUserMessage; + } + /// /// Assistant-authored message within a thread. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsChatkitAssistantMessage => ChatkitAssistantMessage != null; + /// + /// + /// + public bool TryPickChatkitAssistantMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.AssistantMessageItem? value) + { + value = ChatkitAssistantMessage; + return IsChatkitAssistantMessage; + } + /// /// Thread item that renders a widget payload. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsChatkitWidget => ChatkitWidget != null; + /// + /// + /// + public bool TryPickChatkitWidget( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WidgetMessageItem? value) + { + value = ChatkitWidget; + return IsChatkitWidget; + } + /// /// Record of a client side tool invocation initiated by the assistant. /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI #endif public bool IsChatkitClientToolCall => ChatkitClientToolCall != null; + /// + /// + /// + public bool TryPickChatkitClientToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ClientToolCallItem? value) + { + value = ChatkitClientToolCall; + return IsChatkitClientToolCall; + } + /// /// Task emitted by the workflow to show progress and status updates. /// @@ -94,6 +146,19 @@ namespace tryAGI.OpenAI #endif public bool IsChatkitTask => ChatkitTask != null; + /// + /// + /// + public bool TryPickChatkitTask( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.TaskItem? value) + { + value = ChatkitTask; + return IsChatkitTask; + } + /// /// Collection of workflow tasks grouped together in the thread. /// @@ -110,6 +175,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatkitTaskGroup))] #endif public bool IsChatkitTaskGroup => ChatkitTaskGroup != null; + + /// + /// + /// + public bool TryPickChatkitTaskGroup( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.TaskGroupItem? value) + { + value = ChatkitTaskGroup; + return IsChatkitTaskGroup; + } /// /// /// @@ -274,12 +352,12 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? chatkitUserMessage = null, - global::System.Func? chatkitAssistantMessage = null, - global::System.Func? chatkitWidget = null, - global::System.Func? chatkitClientToolCall = null, - global::System.Func? chatkitTask = null, - global::System.Func? chatkitTaskGroup = null, + global::System.Func? chatkitUserMessage = null, + global::System.Func? chatkitAssistantMessage = null, + global::System.Func? chatkitWidget = null, + global::System.Func? chatkitClientToolCall = null, + global::System.Func? chatkitTask = null, + global::System.Func? chatkitTaskGroup = null, bool validate = true) { if (validate) @@ -319,12 +397,60 @@ public bool Validate() /// ///
public void Match( - global::System.Action? chatkitUserMessage = null, - global::System.Action? chatkitAssistantMessage = null, - global::System.Action? chatkitWidget = null, - global::System.Action? chatkitClientToolCall = null, - global::System.Action? chatkitTask = null, - global::System.Action? chatkitTaskGroup = null, + global::System.Action? chatkitUserMessage = null, + + global::System.Action? chatkitAssistantMessage = null, + + global::System.Action? chatkitWidget = null, + + global::System.Action? chatkitClientToolCall = null, + + global::System.Action? chatkitTask = null, + + global::System.Action? chatkitTaskGroup = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsChatkitUserMessage) + { + chatkitUserMessage?.Invoke(ChatkitUserMessage!); + } + else if (IsChatkitAssistantMessage) + { + chatkitAssistantMessage?.Invoke(ChatkitAssistantMessage!); + } + else if (IsChatkitWidget) + { + chatkitWidget?.Invoke(ChatkitWidget!); + } + else if (IsChatkitClientToolCall) + { + chatkitClientToolCall?.Invoke(ChatkitClientToolCall!); + } + else if (IsChatkitTask) + { + chatkitTask?.Invoke(ChatkitTask!); + } + else if (IsChatkitTaskGroup) + { + chatkitTaskGroup?.Invoke(ChatkitTaskGroup!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? chatkitUserMessage = null, + global::System.Action? chatkitAssistantMessage = null, + global::System.Action? chatkitWidget = null, + global::System.Action? chatkitClientToolCall = null, + global::System.Action? chatkitTask = null, + global::System.Action? chatkitTaskGroup = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ThreadStreamEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ThreadStreamEvent.g.cs index 814eb730..d7225c44 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ThreadStreamEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ThreadStreamEvent.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ThreadStreamEventVariant1))] #endif public bool IsThreadStreamEventVariant1 => ThreadStreamEventVariant1 != null; + + /// + /// + /// + public bool TryPickThreadStreamEventVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ThreadStreamEventVariant1? value) + { + value = ThreadStreamEventVariant1; + return IsThreadStreamEventVariant1; + } /// /// /// @@ -69,7 +82,7 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? threadStreamEventVariant1 = null, + global::System.Func? threadStreamEventVariant1 = null, bool validate = true) { if (validate) @@ -89,7 +102,25 @@ public bool Validate() /// ///
public void Match( - global::System.Action? threadStreamEventVariant1 = null, + global::System.Action? threadStreamEventVariant1 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsThreadStreamEventVariant1) + { + threadStreamEventVariant1?.Invoke(ThreadStreamEventVariant1!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? threadStreamEventVariant1 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Tool.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Tool.g.cs index 3b00816b..2b193314 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Tool.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Tool.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunction => Function != null; + /// + /// + /// + public bool TryPickFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionTool? value) + { + value = Function; + return IsFunction; + } + /// /// A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI #endif public bool IsFileSearch => FileSearch != null; + /// + /// + /// + public bool TryPickFileSearch( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FileSearchTool? value) + { + value = FileSearch; + return IsFileSearch; + } + /// /// A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputer => Computer != null; + /// + /// + /// + public bool TryPickComputer( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerTool? value) + { + value = Computer; + return IsComputer; + } + /// /// A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI #endif public bool IsComputerUsePreview => ComputerUsePreview != null; + /// + /// + /// + public bool TryPickComputerUsePreview( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ComputerUsePreviewTool? value) + { + value = ComputerUsePreview; + return IsComputerUsePreview; + } + /// /// Search the Internet for sources related to the prompt. Learn more about the
/// [web search tool](/docs/guides/tools-web-search). @@ -95,6 +147,19 @@ namespace tryAGI.OpenAI #endif public bool IsWebSearch => WebSearch != null; + /// + /// + /// + public bool TryPickWebSearch( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WebSearchTool? value) + { + value = WebSearch; + return IsWebSearch; + } + /// /// Give the model access to additional tools via remote Model Context Protocol
/// (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). @@ -113,6 +178,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcp => Mcp != null; + /// + /// + /// + public bool TryPickMcp( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.MCPTool? value) + { + value = Mcp; + return IsMcp; + } + /// /// A tool that runs Python code to help generate a response to a prompt. /// @@ -130,6 +208,19 @@ namespace tryAGI.OpenAI #endif public bool IsCodeInterpreter => CodeInterpreter != null; + /// + /// + /// + public bool TryPickCodeInterpreter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CodeInterpreterTool? value) + { + value = CodeInterpreter; + return IsCodeInterpreter; + } + /// /// A tool that generates images using the GPT image models. /// @@ -147,6 +238,19 @@ namespace tryAGI.OpenAI #endif public bool IsImageGeneration => ImageGeneration != null; + /// + /// + /// + public bool TryPickImageGeneration( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ImageGenTool? value) + { + value = ImageGeneration; + return IsImageGeneration; + } + /// /// A tool that allows the model to execute shell commands in a local environment. /// @@ -164,6 +268,19 @@ namespace tryAGI.OpenAI #endif public bool IsLocalShell => LocalShell != null; + /// + /// + /// + public bool TryPickLocalShell( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.LocalShellToolParam? value) + { + value = LocalShell; + return IsLocalShell; + } + /// /// A tool that allows the model to execute shell commands. /// @@ -181,6 +298,19 @@ namespace tryAGI.OpenAI #endif public bool IsShell => Shell != null; + /// + /// + /// + public bool TryPickShell( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionShellToolParam? value) + { + value = Shell; + return IsShell; + } + /// /// A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) /// @@ -198,6 +328,19 @@ namespace tryAGI.OpenAI #endif public bool IsCustom => Custom != null; + /// + /// + /// + public bool TryPickCustom( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolParam? value) + { + value = Custom; + return IsCustom; + } + /// /// Groups function/custom tools under a shared namespace. /// @@ -215,6 +358,19 @@ namespace tryAGI.OpenAI #endif public bool IsNamespace => Namespace != null; + /// + /// + /// + public bool TryPickNamespace( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.NamespaceToolParam? value) + { + value = Namespace; + return IsNamespace; + } + /// /// Hosted or BYOT tool search configuration for deferred tools. /// @@ -232,6 +388,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolSearch => ToolSearch != null; + /// + /// + /// + public bool TryPickToolSearch( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolSearchToolParam? value) + { + value = ToolSearch; + return IsToolSearch; + } + /// /// This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). /// @@ -249,6 +418,19 @@ namespace tryAGI.OpenAI #endif public bool IsWebSearchPreview => WebSearchPreview != null; + /// + /// + /// + public bool TryPickWebSearchPreview( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WebSearchPreviewTool? value) + { + value = WebSearchPreview; + return IsWebSearchPreview; + } + /// /// Allows the assistant to create, delete, or update files using unified diffs. /// @@ -265,6 +447,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ApplyPatch))] #endif public bool IsApplyPatch => ApplyPatch != null; + + /// + /// + /// + public bool TryPickApplyPatch( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ApplyPatchToolParam? value) + { + value = ApplyPatch; + return IsApplyPatch; + } /// /// /// @@ -627,21 +822,21 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? function = null, - global::System.Func? fileSearch = null, - global::System.Func? computer = null, - global::System.Func? computerUsePreview = null, - global::System.Func? webSearch = null, - global::System.Func? mcp = null, - global::System.Func? codeInterpreter = null, - global::System.Func? imageGeneration = null, - global::System.Func? localShell = null, - global::System.Func? shell = null, - global::System.Func? custom = null, - global::System.Func? @namespace = null, - global::System.Func? toolSearch = null, - global::System.Func? webSearchPreview = null, - global::System.Func? applyPatch = null, + global::System.Func? function = null, + global::System.Func? fileSearch = null, + global::System.Func? computer = null, + global::System.Func? computerUsePreview = null, + global::System.Func? webSearch = null, + global::System.Func? mcp = null, + global::System.Func? codeInterpreter = null, + global::System.Func? imageGeneration = null, + global::System.Func? localShell = null, + global::System.Func? shell = null, + global::System.Func? custom = null, + global::System.Func? @namespace = null, + global::System.Func? toolSearch = null, + global::System.Func? webSearchPreview = null, + global::System.Func? applyPatch = null, bool validate = true) { if (validate) @@ -717,21 +912,123 @@ public bool Validate() /// ///
public void Match( - global::System.Action? function = null, - global::System.Action? fileSearch = null, - global::System.Action? computer = null, - global::System.Action? computerUsePreview = null, - global::System.Action? webSearch = null, - global::System.Action? mcp = null, - global::System.Action? codeInterpreter = null, - global::System.Action? imageGeneration = null, - global::System.Action? localShell = null, - global::System.Action? shell = null, - global::System.Action? custom = null, - global::System.Action? @namespace = null, - global::System.Action? toolSearch = null, - global::System.Action? webSearchPreview = null, - global::System.Action? applyPatch = null, + global::System.Action? function = null, + + global::System.Action? fileSearch = null, + + global::System.Action? computer = null, + + global::System.Action? computerUsePreview = null, + + global::System.Action? webSearch = null, + + global::System.Action? mcp = null, + + global::System.Action? codeInterpreter = null, + + global::System.Action? imageGeneration = null, + + global::System.Action? localShell = null, + + global::System.Action? shell = null, + + global::System.Action? custom = null, + + global::System.Action? @namespace = null, + + global::System.Action? toolSearch = null, + + global::System.Action? webSearchPreview = null, + + global::System.Action? applyPatch = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsFunction) + { + function?.Invoke(Function!); + } + else if (IsFileSearch) + { + fileSearch?.Invoke(FileSearch!); + } + else if (IsComputer) + { + computer?.Invoke(Computer!); + } + else if (IsComputerUsePreview) + { + computerUsePreview?.Invoke(ComputerUsePreview!); + } + else if (IsWebSearch) + { + webSearch?.Invoke(WebSearch!); + } + else if (IsMcp) + { + mcp?.Invoke(Mcp!); + } + else if (IsCodeInterpreter) + { + codeInterpreter?.Invoke(CodeInterpreter!); + } + else if (IsImageGeneration) + { + imageGeneration?.Invoke(ImageGeneration!); + } + else if (IsLocalShell) + { + localShell?.Invoke(LocalShell!); + } + else if (IsShell) + { + shell?.Invoke(Shell!); + } + else if (IsCustom) + { + custom?.Invoke(Custom!); + } + else if (IsNamespace) + { + @namespace?.Invoke(Namespace!); + } + else if (IsToolSearch) + { + toolSearch?.Invoke(ToolSearch!); + } + else if (IsWebSearchPreview) + { + webSearchPreview?.Invoke(WebSearchPreview!); + } + else if (IsApplyPatch) + { + applyPatch?.Invoke(ApplyPatch!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? function = null, + global::System.Action? fileSearch = null, + global::System.Action? computer = null, + global::System.Action? computerUsePreview = null, + global::System.Action? webSearch = null, + global::System.Action? mcp = null, + global::System.Action? codeInterpreter = null, + global::System.Action? imageGeneration = null, + global::System.Action? localShell = null, + global::System.Action? shell = null, + global::System.Action? custom = null, + global::System.Action? @namespace = null, + global::System.Action? toolSearch = null, + global::System.Action? webSearchPreview = null, + global::System.Action? applyPatch = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ToolChoiceParam.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ToolChoiceParam.g.cs index 0bf8bb53..b47bc4c8 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ToolChoiceParam.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ToolChoiceParam.g.cs @@ -32,6 +32,19 @@ namespace tryAGI.OpenAI #endif public bool IsToolChoiceMode => ToolChoiceMode != null; + /// + /// + /// + public bool TryPickToolChoiceMode( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolChoiceOptions? value) + { + value = ToolChoiceMode; + return IsToolChoiceMode; + } + /// /// Constrains the tools available to the model to a pre-defined set. /// @@ -49,6 +62,19 @@ namespace tryAGI.OpenAI #endif public bool IsAllowedTools => AllowedTools != null; + /// + /// + /// + public bool TryPickAllowedTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolChoiceAllowed? value) + { + value = AllowedTools; + return IsAllowedTools; + } + /// /// Indicates that the model should use a built-in tool to generate a response.
/// [Learn more about built-in tools](/docs/guides/tools). @@ -67,6 +93,19 @@ namespace tryAGI.OpenAI #endif public bool IsHostedTool => HostedTool != null; + /// + /// + /// + public bool TryPickHostedTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolChoiceTypes? value) + { + value = HostedTool; + return IsHostedTool; + } + /// /// Use this option to force the model to call a specific function. /// @@ -84,6 +123,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunctionTool => FunctionTool != null; + /// + /// + /// + public bool TryPickFunctionTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolChoiceFunction? value) + { + value = FunctionTool; + return IsFunctionTool; + } + /// /// Use this option to force the model to call a specific tool on a remote MCP server. /// @@ -101,6 +153,19 @@ namespace tryAGI.OpenAI #endif public bool IsMcpTool => McpTool != null; + /// + /// + /// + public bool TryPickMcpTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolChoiceMCP? value) + { + value = McpTool; + return IsMcpTool; + } + /// /// Use this option to force the model to call a specific custom tool. /// @@ -118,6 +183,19 @@ namespace tryAGI.OpenAI #endif public bool IsCustomTool => CustomTool != null; + /// + /// + /// + public bool TryPickCustomTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.ToolChoiceCustom? value) + { + value = CustomTool; + return IsCustomTool; + } + /// /// Forces the model to call the apply_patch tool when executing a tool call. /// @@ -135,6 +213,19 @@ namespace tryAGI.OpenAI #endif public bool IsSpecificApplyPatchToolChoice => SpecificApplyPatchToolChoice != null; + /// + /// + /// + public bool TryPickSpecificApplyPatchToolChoice( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.SpecificApplyPatchParam? value) + { + value = SpecificApplyPatchToolChoice; + return IsSpecificApplyPatchToolChoice; + } + /// /// Forces the model to call the shell tool when a tool call is required. /// @@ -151,6 +242,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SpecificShellToolChoice))] #endif public bool IsSpecificShellToolChoice => SpecificShellToolChoice != null; + + /// + /// + /// + public bool TryPickSpecificShellToolChoice( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.SpecificFunctionShellParam? value) + { + value = SpecificShellToolChoice; + return IsSpecificShellToolChoice; + } /// /// /// @@ -360,13 +464,13 @@ public bool Validate() ///
public TResult? Match( global::System.Func? toolChoiceMode = null, - global::System.Func? allowedTools = null, - global::System.Func? hostedTool = null, - global::System.Func? functionTool = null, - global::System.Func? mcpTool = null, - global::System.Func? customTool = null, - global::System.Func? specificApplyPatchToolChoice = null, - global::System.Func? specificShellToolChoice = null, + global::System.Func? allowedTools = null, + global::System.Func? hostedTool = null, + global::System.Func? functionTool = null, + global::System.Func? mcpTool = null, + global::System.Func? customTool = null, + global::System.Func? specificApplyPatchToolChoice = null, + global::System.Func? specificShellToolChoice = null, bool validate = true) { if (validate) @@ -415,13 +519,73 @@ public bool Validate() ///
public void Match( global::System.Action? toolChoiceMode = null, - global::System.Action? allowedTools = null, - global::System.Action? hostedTool = null, - global::System.Action? functionTool = null, - global::System.Action? mcpTool = null, - global::System.Action? customTool = null, - global::System.Action? specificApplyPatchToolChoice = null, - global::System.Action? specificShellToolChoice = null, + + global::System.Action? allowedTools = null, + + global::System.Action? hostedTool = null, + + global::System.Action? functionTool = null, + + global::System.Action? mcpTool = null, + + global::System.Action? customTool = null, + + global::System.Action? specificApplyPatchToolChoice = null, + + global::System.Action? specificShellToolChoice = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsToolChoiceMode) + { + toolChoiceMode?.Invoke(ToolChoiceMode!); + } + else if (IsAllowedTools) + { + allowedTools?.Invoke(AllowedTools!); + } + else if (IsHostedTool) + { + hostedTool?.Invoke(HostedTool!); + } + else if (IsFunctionTool) + { + functionTool?.Invoke(FunctionTool!); + } + else if (IsMcpTool) + { + mcpTool?.Invoke(McpTool!); + } + else if (IsCustomTool) + { + customTool?.Invoke(CustomTool!); + } + else if (IsSpecificApplyPatchToolChoice) + { + specificApplyPatchToolChoice?.Invoke(SpecificApplyPatchToolChoice!); + } + else if (IsSpecificShellToolChoice) + { + specificShellToolChoice?.Invoke(SpecificShellToolChoice!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? toolChoiceMode = null, + global::System.Action? allowedTools = null, + global::System.Action? hostedTool = null, + global::System.Action? functionTool = null, + global::System.Action? mcpTool = null, + global::System.Action? customTool = null, + global::System.Action? specificApplyPatchToolChoice = null, + global::System.Action? specificShellToolChoice = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ToolsItem13.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ToolsItem13.g.cs index e1654c4c..fce8fbb7 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ToolsItem13.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ToolsItem13.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsFunction => Function != null; + /// + /// + /// + public bool TryPickFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.FunctionToolParam? value) + { + value = Function; + return IsFunction; + } + /// /// A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Custom))] #endif public bool IsCustom => Custom != null; + + /// + /// + /// + public bool TryPickCustom( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.CustomToolParam? value) + { + value = Custom; + return IsCustom; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? function = null, - global::System.Func? custom = null, + global::System.Func? function = null, + global::System.Func? custom = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? function = null, - global::System.Action? custom = null, + global::System.Action? function = null, + + global::System.Action? custom = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsFunction) + { + function?.Invoke(Function!); + } + else if (IsCustom) + { + custom?.Invoke(Custom!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? function = null, + global::System.Action? custom = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptionChunkingStrategy.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptionChunkingStrategy.g.cs index 8048ec13..16e1c8cf 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptionChunkingStrategy.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptionChunkingStrategy.g.cs @@ -30,6 +30,19 @@ namespace tryAGI.OpenAI #endif public bool IsEnum => Enum != null; + /// + /// + /// + public bool TryPickEnum( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.TranscriptionChunkingStrategyEnum? value) + { + value = Enum; + return IsEnum; + } + /// /// /// @@ -46,6 +59,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VadConfig))] #endif public bool IsVadConfig => VadConfig != null; + + /// + /// + /// + public bool TryPickVadConfig( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.VadConfig? value) + { + value = VadConfig; + return IsVadConfig; + } /// /// /// @@ -123,7 +149,7 @@ public bool Validate() ///
public TResult? Match( global::System.Func? @enum = null, - global::System.Func? vadConfig = null, + global::System.Func? vadConfig = null, bool validate = true) { if (validate) @@ -148,7 +174,31 @@ public bool Validate() ///
public void Match( global::System.Action? @enum = null, - global::System.Action? vadConfig = null, + + global::System.Action? vadConfig = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsEnum) + { + @enum?.Invoke(Enum!); + } + else if (IsVadConfig) + { + vadConfig?.Invoke(VadConfig!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? @enum = null, + global::System.Action? vadConfig = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VideoModel.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VideoModel.g.cs index 8c7754c0..83a7a08a 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VideoModel.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VideoModel.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsVideoModelVariant1 => VideoModelVariant1 != null; + /// + /// + /// + public bool TryPickVideoModelVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = VideoModelVariant1; + return IsVideoModelVariant1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Enum))] #endif public bool IsEnum => Enum != null; + + /// + /// + /// + public bool TryPickEnum( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.VideoModelEnum? value) + { + value = Enum; + return IsEnum; + } /// /// /// @@ -118,7 +144,7 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? videoModelVariant1 = null, + global::System.Func? videoModelVariant1 = null, global::System.Func? @enum = null, bool validate = true) { @@ -143,7 +169,31 @@ public bool Validate() /// /// public void Match( - global::System.Action? videoModelVariant1 = null, + global::System.Action? videoModelVariant1 = null, + + global::System.Action? @enum = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsVideoModelVariant1) + { + videoModelVariant1?.Invoke(VideoModelVariant1!); + } + else if (IsEnum) + { + @enum?.Invoke(Enum!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? videoModelVariant1 = null, global::System.Action? @enum = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VoiceIdsOrCustomVoice.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VoiceIdsOrCustomVoice.g.cs index 1920ef0e..cd415efb 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VoiceIdsOrCustomVoice.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VoiceIdsOrCustomVoice.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsShared => Shared != null; + /// + /// + /// + public bool TryPickShared( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.VoiceIdsShared? value) + { + value = Shared; + return IsShared; + } + /// /// Custom voice reference. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VoiceIdsOrCustomVoiceVariant2))] #endif public bool IsVoiceIdsOrCustomVoiceVariant2 => VoiceIdsOrCustomVoiceVariant2 != null; + + /// + /// + /// + public bool TryPickVoiceIdsOrCustomVoiceVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.VoiceIdsOrCustomVoiceVariant2? value) + { + value = VoiceIdsOrCustomVoiceVariant2; + return IsVoiceIdsOrCustomVoiceVariant2; + } /// /// /// @@ -119,7 +145,7 @@ public bool Validate() /// public TResult? Match( global::System.Func? shared = null, - global::System.Func? voiceIdsOrCustomVoiceVariant2 = null, + global::System.Func? voiceIdsOrCustomVoiceVariant2 = null, bool validate = true) { if (validate) @@ -144,7 +170,31 @@ public bool Validate() /// public void Match( global::System.Action? shared = null, - global::System.Action? voiceIdsOrCustomVoiceVariant2 = null, + + global::System.Action? voiceIdsOrCustomVoiceVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsShared) + { + shared?.Invoke(Shared!); + } + else if (IsVoiceIdsOrCustomVoiceVariant2) + { + voiceIdsOrCustomVoiceVariant2?.Invoke(VoiceIdsOrCustomVoiceVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? shared = null, + global::System.Action? voiceIdsOrCustomVoiceVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VoiceIdsShared.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VoiceIdsShared.g.cs index f0e20c5f..ca94ed62 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VoiceIdsShared.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.VoiceIdsShared.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI #endif public bool IsVoiceIdsSharedVariant1 => VoiceIdsSharedVariant1 != null; + /// + /// + /// + public bool TryPickVoiceIdsSharedVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = VoiceIdsSharedVariant1; + return IsVoiceIdsSharedVariant1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Enum))] #endif public bool IsEnum => Enum != null; + + /// + /// + /// + public bool TryPickEnum( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.VoiceIdsSharedEnum? value) + { + value = Enum; + return IsEnum; + } /// /// /// @@ -118,7 +144,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? voiceIdsSharedVariant1 = null, + global::System.Func? voiceIdsSharedVariant1 = null, global::System.Func? @enum = null, bool validate = true) { @@ -143,7 +169,31 @@ public bool Validate() /// /// public void Match( - global::System.Action? voiceIdsSharedVariant1 = null, + global::System.Action? voiceIdsSharedVariant1 = null, + + global::System.Action? @enum = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsVoiceIdsSharedVariant1) + { + voiceIdsSharedVariant1?.Invoke(VoiceIdsSharedVariant1!); + } + else if (IsEnum) + { + @enum?.Invoke(Enum!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? voiceIdsSharedVariant1 = null, global::System.Action? @enum = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.WebSearchToolCallAction.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.WebSearchToolCallAction.g.cs index cac51c81..c889ba8b 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.WebSearchToolCallAction.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.WebSearchToolCallAction.g.cs @@ -27,6 +27,19 @@ namespace tryAGI.OpenAI #endif public bool IsSearch => Search != null; + /// + /// + /// + public bool TryPickSearch( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WebSearchActionSearch? value) + { + value = Search; + return IsSearch; + } + /// /// Action type "open_page" - Opens a specific URL from search results. /// @@ -44,6 +57,19 @@ namespace tryAGI.OpenAI #endif public bool IsOpenPage => OpenPage != null; + /// + /// + /// + public bool TryPickOpenPage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WebSearchActionOpenPage? value) + { + value = OpenPage; + return IsOpenPage; + } + /// /// Action type "find_in_page": Searches for a pattern within a loaded page. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FindInPage))] #endif public bool IsFindInPage => FindInPage != null; + + /// + /// + /// + public bool TryPickFindInPage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.WebSearchActionFind? value) + { + value = FindInPage; + return IsFindInPage; + } /// /// /// @@ -158,9 +197,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? search = null, - global::System.Func? openPage = null, - global::System.Func? findInPage = null, + global::System.Func? search = null, + global::System.Func? openPage = null, + global::System.Func? findInPage = null, bool validate = true) { if (validate) @@ -188,9 +227,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? search = null, - global::System.Action? openPage = null, - global::System.Action? findInPage = null, + global::System.Action? search = null, + + global::System.Action? openPage = null, + + global::System.Action? findInPage = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSearch) + { + search?.Invoke(Search!); + } + else if (IsOpenPage) + { + openPage?.Invoke(OpenPage!); + } + else if (IsFindInPage) + { + findInPage?.Invoke(FindInPage!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? search = null, + global::System.Action? openPage = null, + global::System.Action? findInPage = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.2.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.2.g.cs index 23c85365..e36cadfc 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.2.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.2.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + /// /// /// @@ -41,6 +54,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] #endif public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } /// /// /// @@ -143,6 +169,30 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.3.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.3.g.cs index 4ad02ec9..7032c2e7 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.3.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.3.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + /// /// /// @@ -58,6 +84,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] #endif public bool IsValue3 => Value3 != null; + + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } /// /// /// @@ -187,6 +226,36 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, bool validate = true) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.4.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.4.g.cs index 2a04552a..7939ec88 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.4.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.4.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + /// /// /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue3 => Value3 != null; + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + /// /// /// @@ -75,6 +114,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] #endif public bool IsValue4 => Value4 != null; + + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } /// /// /// @@ -231,6 +283,42 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, global::System.Action? value4 = null, diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.5.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.5.g.cs index ab0ad5a5..c76280b0 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.5.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OneOf.5.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + /// /// /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue3 => Value3 != null; + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + /// /// /// @@ -76,6 +115,19 @@ namespace tryAGI.OpenAI #endif public bool IsValue4 => Value4 != null; + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } + /// /// /// @@ -92,6 +144,19 @@ namespace tryAGI.OpenAI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] #endif public bool IsValue5 => Value5 != null; + + /// + /// + /// + public bool TryPickValue5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T5? value) + { + value = Value5; + return IsValue5; + } /// /// /// @@ -275,6 +340,48 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + + global::System.Action? value5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + else if (IsValue5) + { + value5?.Invoke(Value5!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, global::System.Action? value4 = null, diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.Constructors.Bearer.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.Constructors.Bearer.g.cs index 464c6204..9f8fa0fb 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.Constructors.Bearer.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.OpenAiClient.Constructors.Bearer.g.cs @@ -26,5 +26,6 @@ partial void Authorizing( ref string apiKey); partial void Authorized( global::System.Net.Http.HttpClient client); + } } \ No newline at end of file diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.AnyOf.2.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.AnyOf.2.g.cs index 60597bd6..e07e7b0d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.AnyOf.2.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.AnyOf.2.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + /// /// /// @@ -41,6 +54,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] #endif public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } /// /// /// @@ -143,6 +169,30 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeAudioFormats.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeAudioFormats.g.cs index f44867b5..517db659 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeAudioFormats.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeAudioFormats.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsPcmAudioFormat => PcmAudioFormat != null; + /// + /// + /// + public bool TryPickPcmAudioFormat( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeAudioFormatsPcmAudioFormat? value) + { + value = PcmAudioFormat; + return IsPcmAudioFormat; + } + /// /// The G.711 μ-law format. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsPcmuAudioFormat => PcmuAudioFormat != null; + /// + /// + /// + public bool TryPickPcmuAudioFormat( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeAudioFormatsPcmuAudioFormat? value) + { + value = PcmuAudioFormat; + return IsPcmuAudioFormat; + } + /// /// The G.711 A-law format. /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(PcmaAudioFormat))] #endif public bool IsPcmaAudioFormat => PcmaAudioFormat != null; + + /// + /// + /// + public bool TryPickPcmaAudioFormat( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeAudioFormatsPcmaAudioFormat? value) + { + value = PcmaAudioFormat; + return IsPcmaAudioFormat; + } /// /// /// @@ -157,9 +196,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? pcmAudioFormat = null, - global::System.Func? pcmuAudioFormat = null, - global::System.Func? pcmaAudioFormat = null, + global::System.Func? pcmAudioFormat = null, + global::System.Func? pcmuAudioFormat = null, + global::System.Func? pcmaAudioFormat = null, bool validate = true) { if (validate) @@ -187,9 +226,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? pcmAudioFormat = null, - global::System.Action? pcmuAudioFormat = null, - global::System.Action? pcmaAudioFormat = null, + global::System.Action? pcmAudioFormat = null, + + global::System.Action? pcmuAudioFormat = null, + + global::System.Action? pcmaAudioFormat = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsPcmAudioFormat) + { + pcmAudioFormat?.Invoke(PcmAudioFormat!); + } + else if (IsPcmuAudioFormat) + { + pcmuAudioFormat?.Invoke(PcmuAudioFormat!); + } + else if (IsPcmaAudioFormat) + { + pcmaAudioFormat?.Invoke(PcmaAudioFormat!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? pcmAudioFormat = null, + global::System.Action? pcmuAudioFormat = null, + global::System.Action? pcmaAudioFormat = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeClientEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeClientEvent.g.cs index 1617b57e..f2891a8d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeClientEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeClientEvent.g.cs @@ -31,6 +31,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemCreate => ConversationItemCreate != null; + /// + /// + /// + public bool TryPickConversationItemCreate( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeClientEventConversationItemCreate? value) + { + value = ConversationItemCreate; + return IsConversationItemCreate; + } + /// /// Send this event when you want to remove any item from the conversation
/// history. The server will respond with a `conversation.item.deleted` event,
@@ -51,6 +64,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemDelete => ConversationItemDelete != null; + /// + /// + /// + public bool TryPickConversationItemDelete( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeClientEventConversationItemDelete? value) + { + value = ConversationItemDelete; + return IsConversationItemDelete; + } + /// /// Send this event when you want to retrieve the server's representation of a specific item in the conversation history. This is useful, for example, to inspect user audio after noise cancellation and VAD.
/// The server will respond with a `conversation.item.retrieved` event,
@@ -71,6 +97,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemRetrieve => ConversationItemRetrieve != null; + /// + /// + /// + public bool TryPickConversationItemRetrieve( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeClientEventConversationItemRetrieve? value) + { + value = ConversationItemRetrieve; + return IsConversationItemRetrieve; + } + /// /// Send this event to truncate a previous assistant message’s audio. The server
/// will produce audio faster than realtime, so this event is useful when the user
@@ -96,6 +135,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemTruncate => ConversationItemTruncate != null; + /// + /// + /// + public bool TryPickConversationItemTruncate( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeClientEventConversationItemTruncate? value) + { + value = ConversationItemTruncate; + return IsConversationItemTruncate; + } + /// /// Send this event to append audio bytes to the input audio buffer. The audio
/// buffer is temporary storage you can write to and later commit. A "commit" will create a new
@@ -123,6 +175,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsInputAudioBufferAppend => InputAudioBufferAppend != null; + /// + /// + /// + public bool TryPickInputAudioBufferAppend( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeClientEventInputAudioBufferAppend? value) + { + value = InputAudioBufferAppend; + return IsInputAudioBufferAppend; + } + /// /// Send this event to clear the audio bytes in the buffer. The server will
/// respond with an `input_audio_buffer.cleared` event. @@ -141,6 +206,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsInputAudioBufferClear => InputAudioBufferClear != null; + /// + /// + /// + public bool TryPickInputAudioBufferClear( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeClientEventInputAudioBufferClear? value) + { + value = InputAudioBufferClear; + return IsInputAudioBufferClear; + } + /// /// **WebRTC/SIP Only:** Emit to cut off the current audio response. This will trigger the server to
/// stop generating audio and emit a `output_audio_buffer.cleared` event. This
@@ -162,6 +240,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsOutputAudioBufferClear => OutputAudioBufferClear != null; + /// + /// + /// + public bool TryPickOutputAudioBufferClear( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeClientEventOutputAudioBufferClear? value) + { + value = OutputAudioBufferClear; + return IsOutputAudioBufferClear; + } + /// /// Send this event to commit the user input audio buffer, which will create a new user message item in the conversation. This event will produce an error if the input audio buffer is empty. When in Server VAD mode, the client does not need to send this event, the server will commit the audio buffer automatically.
/// Committing the input audio buffer will trigger input audio transcription (if enabled in session configuration), but it will not create a response from the model. The server will respond with an `input_audio_buffer.committed` event. @@ -180,6 +271,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsInputAudioBufferCommit => InputAudioBufferCommit != null; + /// + /// + /// + public bool TryPickInputAudioBufferCommit( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeClientEventInputAudioBufferCommit? value) + { + value = InputAudioBufferCommit; + return IsInputAudioBufferCommit; + } + /// /// Send this event to cancel an in-progress response. The server will respond
/// with a `response.done` event with a status of `response.status=cancelled`. If
@@ -201,6 +305,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseCancel => ResponseCancel != null; + /// + /// + /// + public bool TryPickResponseCancel( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeClientEventResponseCancel? value) + { + value = ResponseCancel; + return IsResponseCancel; + } + /// /// This event instructs the server to create a Response, which means triggering
/// model inference. When in Server VAD mode, the server will create Responses
@@ -237,6 +354,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseCreate => ResponseCreate != null; + /// + /// + /// + public bool TryPickResponseCreate( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeClientEventResponseCreate? value) + { + value = ResponseCreate; + return IsResponseCreate; + } + /// /// Send this event to update the session’s configuration.
/// The client may send this event at any time to update any field
@@ -260,6 +390,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SessionUpdate))] #endif public bool IsSessionUpdate => SessionUpdate != null; + + /// + /// + /// + public bool TryPickSessionUpdate( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeClientEventSessionUpdate? value) + { + value = SessionUpdate; + return IsSessionUpdate; + } /// /// /// @@ -534,17 +677,17 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? conversationItemCreate = null, - global::System.Func? conversationItemDelete = null, - global::System.Func? conversationItemRetrieve = null, - global::System.Func? conversationItemTruncate = null, - global::System.Func? inputAudioBufferAppend = null, - global::System.Func? inputAudioBufferClear = null, - global::System.Func? outputAudioBufferClear = null, - global::System.Func? inputAudioBufferCommit = null, - global::System.Func? responseCancel = null, - global::System.Func? responseCreate = null, - global::System.Func? sessionUpdate = null, + global::System.Func? conversationItemCreate = null, + global::System.Func? conversationItemDelete = null, + global::System.Func? conversationItemRetrieve = null, + global::System.Func? conversationItemTruncate = null, + global::System.Func? inputAudioBufferAppend = null, + global::System.Func? inputAudioBufferClear = null, + global::System.Func? outputAudioBufferClear = null, + global::System.Func? inputAudioBufferCommit = null, + global::System.Func? responseCancel = null, + global::System.Func? responseCreate = null, + global::System.Func? sessionUpdate = null, bool validate = true) { if (validate) @@ -604,17 +747,95 @@ public bool Validate() /// ///
public void Match( - global::System.Action? conversationItemCreate = null, - global::System.Action? conversationItemDelete = null, - global::System.Action? conversationItemRetrieve = null, - global::System.Action? conversationItemTruncate = null, - global::System.Action? inputAudioBufferAppend = null, - global::System.Action? inputAudioBufferClear = null, - global::System.Action? outputAudioBufferClear = null, - global::System.Action? inputAudioBufferCommit = null, - global::System.Action? responseCancel = null, - global::System.Action? responseCreate = null, - global::System.Action? sessionUpdate = null, + global::System.Action? conversationItemCreate = null, + + global::System.Action? conversationItemDelete = null, + + global::System.Action? conversationItemRetrieve = null, + + global::System.Action? conversationItemTruncate = null, + + global::System.Action? inputAudioBufferAppend = null, + + global::System.Action? inputAudioBufferClear = null, + + global::System.Action? outputAudioBufferClear = null, + + global::System.Action? inputAudioBufferCommit = null, + + global::System.Action? responseCancel = null, + + global::System.Action? responseCreate = null, + + global::System.Action? sessionUpdate = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsConversationItemCreate) + { + conversationItemCreate?.Invoke(ConversationItemCreate!); + } + else if (IsConversationItemDelete) + { + conversationItemDelete?.Invoke(ConversationItemDelete!); + } + else if (IsConversationItemRetrieve) + { + conversationItemRetrieve?.Invoke(ConversationItemRetrieve!); + } + else if (IsConversationItemTruncate) + { + conversationItemTruncate?.Invoke(ConversationItemTruncate!); + } + else if (IsInputAudioBufferAppend) + { + inputAudioBufferAppend?.Invoke(InputAudioBufferAppend!); + } + else if (IsInputAudioBufferClear) + { + inputAudioBufferClear?.Invoke(InputAudioBufferClear!); + } + else if (IsOutputAudioBufferClear) + { + outputAudioBufferClear?.Invoke(OutputAudioBufferClear!); + } + else if (IsInputAudioBufferCommit) + { + inputAudioBufferCommit?.Invoke(InputAudioBufferCommit!); + } + else if (IsResponseCancel) + { + responseCancel?.Invoke(ResponseCancel!); + } + else if (IsResponseCreate) + { + responseCreate?.Invoke(ResponseCreate!); + } + else if (IsSessionUpdate) + { + sessionUpdate?.Invoke(SessionUpdate!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? conversationItemCreate = null, + global::System.Action? conversationItemDelete = null, + global::System.Action? conversationItemRetrieve = null, + global::System.Action? conversationItemTruncate = null, + global::System.Action? inputAudioBufferAppend = null, + global::System.Action? inputAudioBufferClear = null, + global::System.Action? outputAudioBufferClear = null, + global::System.Action? inputAudioBufferCommit = null, + global::System.Action? responseCancel = null, + global::System.Action? responseCreate = null, + global::System.Action? sessionUpdate = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeConversationItem.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeConversationItem.g.cs index 80a0460b..fb368cad 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeConversationItem.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeConversationItem.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsMessage1 => Message1 != null; + /// + /// + /// + public bool TryPickMessage1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeConversationItemMessageSystem? value) + { + value = Message1; + return IsMessage1; + } + /// /// A user message item in a Realtime conversation. /// @@ -43,6 +56,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsMessage2 => Message2 != null; + /// + /// + /// + public bool TryPickMessage2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeConversationItemMessageUser? value) + { + value = Message2; + return IsMessage2; + } + /// /// An assistant message item in a Realtime conversation. /// @@ -60,6 +86,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsMessage3 => Message3 != null; + /// + /// + /// + public bool TryPickMessage3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeConversationItemMessageAssistant? value) + { + value = Message3; + return IsMessage3; + } + /// /// A function call item in a Realtime conversation. /// @@ -77,6 +116,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsFunctionCall => FunctionCall != null; + /// + /// + /// + public bool TryPickFunctionCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeConversationItemFunctionCall? value) + { + value = FunctionCall; + return IsFunctionCall; + } + /// /// A function call output item in a Realtime conversation. /// @@ -94,6 +146,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsFunctionCallOutput => FunctionCallOutput != null; + /// + /// + /// + public bool TryPickFunctionCallOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeConversationItemFunctionCallOutput? value) + { + value = FunctionCallOutput; + return IsFunctionCallOutput; + } + /// /// A Realtime item responding to an MCP approval request. /// @@ -111,6 +176,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsMcpApprovalResponse => McpApprovalResponse != null; + /// + /// + /// + public bool TryPickMcpApprovalResponse( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeMCPApprovalResponse? value) + { + value = McpApprovalResponse; + return IsMcpApprovalResponse; + } + /// /// A Realtime item listing tools available on an MCP server. /// @@ -128,6 +206,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsMcpListTools => McpListTools != null; + /// + /// + /// + public bool TryPickMcpListTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeMCPListTools? value) + { + value = McpListTools; + return IsMcpListTools; + } + /// /// A Realtime item representing an invocation of a tool on an MCP server. /// @@ -145,6 +236,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsMcpCall => McpCall != null; + /// + /// + /// + public bool TryPickMcpCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeMCPToolCall? value) + { + value = McpCall; + return IsMcpCall; + } + /// /// A Realtime item requesting human approval of a tool invocation. /// @@ -161,6 +265,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(McpApprovalRequest))] #endif public bool IsMcpApprovalRequest => McpApprovalRequest != null; + + /// + /// + /// + public bool TryPickMcpApprovalRequest( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeMCPApprovalRequest? value) + { + value = McpApprovalRequest; + return IsMcpApprovalRequest; + } /// /// /// @@ -391,15 +508,15 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? message1 = null, - global::System.Func? message2 = null, - global::System.Func? message3 = null, - global::System.Func? functionCall = null, - global::System.Func? functionCallOutput = null, - global::System.Func? mcpApprovalResponse = null, - global::System.Func? mcpListTools = null, - global::System.Func? mcpCall = null, - global::System.Func? mcpApprovalRequest = null, + global::System.Func? message1 = null, + global::System.Func? message2 = null, + global::System.Func? message3 = null, + global::System.Func? functionCall = null, + global::System.Func? functionCallOutput = null, + global::System.Func? mcpApprovalResponse = null, + global::System.Func? mcpListTools = null, + global::System.Func? mcpCall = null, + global::System.Func? mcpApprovalRequest = null, bool validate = true) { if (validate) @@ -451,15 +568,81 @@ public bool Validate() /// ///
public void Match( - global::System.Action? message1 = null, - global::System.Action? message2 = null, - global::System.Action? message3 = null, - global::System.Action? functionCall = null, - global::System.Action? functionCallOutput = null, - global::System.Action? mcpApprovalResponse = null, - global::System.Action? mcpListTools = null, - global::System.Action? mcpCall = null, - global::System.Action? mcpApprovalRequest = null, + global::System.Action? message1 = null, + + global::System.Action? message2 = null, + + global::System.Action? message3 = null, + + global::System.Action? functionCall = null, + + global::System.Action? functionCallOutput = null, + + global::System.Action? mcpApprovalResponse = null, + + global::System.Action? mcpListTools = null, + + global::System.Action? mcpCall = null, + + global::System.Action? mcpApprovalRequest = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsMessage1) + { + message1?.Invoke(Message1!); + } + else if (IsMessage2) + { + message2?.Invoke(Message2!); + } + else if (IsMessage3) + { + message3?.Invoke(Message3!); + } + else if (IsFunctionCall) + { + functionCall?.Invoke(FunctionCall!); + } + else if (IsFunctionCallOutput) + { + functionCallOutput?.Invoke(FunctionCallOutput!); + } + else if (IsMcpApprovalResponse) + { + mcpApprovalResponse?.Invoke(McpApprovalResponse!); + } + else if (IsMcpListTools) + { + mcpListTools?.Invoke(McpListTools!); + } + else if (IsMcpCall) + { + mcpCall?.Invoke(McpCall!); + } + else if (IsMcpApprovalRequest) + { + mcpApprovalRequest?.Invoke(McpApprovalRequest!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? message1 = null, + global::System.Action? message2 = null, + global::System.Action? message3 = null, + global::System.Action? functionCall = null, + global::System.Action? functionCallOutput = null, + global::System.Action? mcpApprovalResponse = null, + global::System.Action? mcpListTools = null, + global::System.Action? mcpCall = null, + global::System.Action? mcpApprovalRequest = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeServerEvent.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeServerEvent.g.cs index 06ba9d4f..312165a6 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeServerEvent.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeServerEvent.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationCreated => ConversationCreated != null; + /// + /// + /// + public bool TryPickConversationCreated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventConversationCreated? value) + { + value = ConversationCreated; + return IsConversationCreated; + } + /// /// Returned when a conversation item is created. There are several scenarios that produce this event:
/// - The server is generating a Response, which if successful will produce
@@ -51,6 +64,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemCreated => ConversationItemCreated != null; + /// + /// + /// + public bool TryPickConversationItemCreated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventConversationItemCreated? value) + { + value = ConversationItemCreated; + return IsConversationItemCreated; + } + /// /// Returned when an item in the conversation is deleted by the client with a
/// `conversation.item.delete` event. This event is used to synchronize the
@@ -70,6 +96,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemDeleted => ConversationItemDeleted != null; + /// + /// + /// + public bool TryPickConversationItemDeleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventConversationItemDeleted? value) + { + value = ConversationItemDeleted; + return IsConversationItemDeleted; + } + /// /// This event is the output of audio transcription for user audio written to the
/// user audio buffer. Transcription begins when the input audio buffer is
@@ -95,6 +134,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemInputAudioTranscriptionCompleted => ConversationItemInputAudioTranscriptionCompleted != null; + /// + /// + /// + public bool TryPickConversationItemInputAudioTranscriptionCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted? value) + { + value = ConversationItemInputAudioTranscriptionCompleted; + return IsConversationItemInputAudioTranscriptionCompleted; + } + /// /// Returned when the text value of an input audio transcription content part is updated with incremental transcription results. /// @@ -112,6 +164,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemInputAudioTranscriptionDelta => ConversationItemInputAudioTranscriptionDelta != null; + /// + /// + /// + public bool TryPickConversationItemInputAudioTranscriptionDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventConversationItemInputAudioTranscriptionDelta? value) + { + value = ConversationItemInputAudioTranscriptionDelta; + return IsConversationItemInputAudioTranscriptionDelta; + } + /// /// Returned when input audio transcription is configured, and a transcription
/// request for a user message failed. These events are separate from other
@@ -131,6 +196,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemInputAudioTranscriptionFailed => ConversationItemInputAudioTranscriptionFailed != null; + /// + /// + /// + public bool TryPickConversationItemInputAudioTranscriptionFailed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventConversationItemInputAudioTranscriptionFailed? value) + { + value = ConversationItemInputAudioTranscriptionFailed; + return IsConversationItemInputAudioTranscriptionFailed; + } + /// /// Returned when a conversation item is retrieved with `conversation.item.retrieve`. This is provided as a way to fetch the server's representation of an item, for example to get access to the post-processed audio data after noise cancellation and VAD. It includes the full content of the Item, including audio data. /// @@ -148,6 +226,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemRetrieved => ConversationItemRetrieved != null; + /// + /// + /// + public bool TryPickConversationItemRetrieved( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventConversationItemRetrieved? value) + { + value = ConversationItemRetrieved; + return IsConversationItemRetrieved; + } + /// /// Returned when an earlier assistant audio message item is truncated by the
/// client with a `conversation.item.truncate` event. This event is used to
@@ -169,6 +260,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemTruncated => ConversationItemTruncated != null; + /// + /// + /// + public bool TryPickConversationItemTruncated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventConversationItemTruncated? value) + { + value = ConversationItemTruncated; + return IsConversationItemTruncated; + } + /// /// Returned when an error occurs, which could be a client problem or a server
/// problem. Most errors are recoverable and the session will stay open, we
@@ -188,6 +292,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsError => Error != null; + /// + /// + /// + public bool TryPickError( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventError? value) + { + value = Error; + return IsError; + } + /// /// Returned when the input audio buffer is cleared by the client with a
/// `input_audio_buffer.clear` event. @@ -206,6 +323,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsInputAudioBufferCleared => InputAudioBufferCleared != null; + /// + /// + /// + public bool TryPickInputAudioBufferCleared( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventInputAudioBufferCleared? value) + { + value = InputAudioBufferCleared; + return IsInputAudioBufferCleared; + } + /// /// Returned when an input audio buffer is committed, either by the client or
/// automatically in server VAD mode. The `item_id` property is the ID of the user
@@ -226,6 +356,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsInputAudioBufferCommitted => InputAudioBufferCommitted != null; + /// + /// + /// + public bool TryPickInputAudioBufferCommitted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventInputAudioBufferCommitted? value) + { + value = InputAudioBufferCommitted; + return IsInputAudioBufferCommitted; + } + /// /// **SIP Only:** Returned when an DTMF event is received. A DTMF event is a message that
/// represents a telephone keypad press (0–9, *, #, A–D). The `event` property
@@ -246,6 +389,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsInputAudioBufferDtmfEventReceived => InputAudioBufferDtmfEventReceived != null; + /// + /// + /// + public bool TryPickInputAudioBufferDtmfEventReceived( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventInputAudioBufferDtmfEventReceived? value) + { + value = InputAudioBufferDtmfEventReceived; + return IsInputAudioBufferDtmfEventReceived; + } + /// /// Sent by the server when in `server_vad` mode to indicate that speech has been
/// detected in the audio buffer. This can happen any time audio is added to the
@@ -271,6 +427,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsInputAudioBufferSpeechStarted => InputAudioBufferSpeechStarted != null; + /// + /// + /// + public bool TryPickInputAudioBufferSpeechStarted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventInputAudioBufferSpeechStarted? value) + { + value = InputAudioBufferSpeechStarted; + return IsInputAudioBufferSpeechStarted; + } + /// /// Returned in `server_vad` mode when the server detects the end of speech in
/// the audio buffer. The server will also send an `conversation.item.created`
@@ -290,6 +459,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsInputAudioBufferSpeechStopped => InputAudioBufferSpeechStopped != null; + /// + /// + /// + public bool TryPickInputAudioBufferSpeechStopped( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventInputAudioBufferSpeechStopped? value) + { + value = InputAudioBufferSpeechStopped; + return IsInputAudioBufferSpeechStopped; + } + /// /// Emitted at the beginning of a Response to indicate the updated rate limits.
/// When a Response is created some tokens will be "reserved" for the output
@@ -310,6 +492,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsRateLimitsUpdated => RateLimitsUpdated != null; + /// + /// + /// + public bool TryPickRateLimitsUpdated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventRateLimitsUpdated? value) + { + value = RateLimitsUpdated; + return IsRateLimitsUpdated; + } + /// /// Returned when the model-generated audio is updated. /// @@ -327,6 +522,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseOutputAudioDelta => ResponseOutputAudioDelta != null; + /// + /// + /// + public bool TryPickResponseOutputAudioDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseAudioDelta? value) + { + value = ResponseOutputAudioDelta; + return IsResponseOutputAudioDelta; + } + /// /// Returned when the model-generated audio is done. Also emitted when a Response
/// is interrupted, incomplete, or cancelled. @@ -345,6 +553,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseOutputAudioDone => ResponseOutputAudioDone != null; + /// + /// + /// + public bool TryPickResponseOutputAudioDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseAudioDone? value) + { + value = ResponseOutputAudioDone; + return IsResponseOutputAudioDone; + } + /// /// Returned when the model-generated transcription of audio output is updated. /// @@ -362,6 +583,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseOutputAudioTranscriptDelta => ResponseOutputAudioTranscriptDelta != null; + /// + /// + /// + public bool TryPickResponseOutputAudioTranscriptDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseAudioTranscriptDelta? value) + { + value = ResponseOutputAudioTranscriptDelta; + return IsResponseOutputAudioTranscriptDelta; + } + /// /// Returned when the model-generated transcription of audio output is done
/// streaming. Also emitted when a Response is interrupted, incomplete, or
@@ -381,6 +615,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseOutputAudioTranscriptDone => ResponseOutputAudioTranscriptDone != null; + /// + /// + /// + public bool TryPickResponseOutputAudioTranscriptDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseAudioTranscriptDone? value) + { + value = ResponseOutputAudioTranscriptDone; + return IsResponseOutputAudioTranscriptDone; + } + /// /// Returned when a new content part is added to an assistant message item during
/// response generation. @@ -399,6 +646,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseContentPartAdded => ResponseContentPartAdded != null; + /// + /// + /// + public bool TryPickResponseContentPartAdded( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseContentPartAdded? value) + { + value = ResponseContentPartAdded; + return IsResponseContentPartAdded; + } + /// /// Returned when a content part is done streaming in an assistant message item.
/// Also emitted when a Response is interrupted, incomplete, or cancelled. @@ -417,6 +677,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseContentPartDone => ResponseContentPartDone != null; + /// + /// + /// + public bool TryPickResponseContentPartDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseContentPartDone? value) + { + value = ResponseContentPartDone; + return IsResponseContentPartDone; + } + /// /// Returned when a new Response is created. The first event of response creation,
/// where the response is in an initial state of `in_progress`. @@ -435,6 +708,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseCreated => ResponseCreated != null; + /// + /// + /// + public bool TryPickResponseCreated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseCreated? value) + { + value = ResponseCreated; + return IsResponseCreated; + } + /// /// Returned when a Response is done streaming. Always emitted, no matter the
/// final state. The Response object included in the `response.done` event will
@@ -458,6 +744,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseDone => ResponseDone != null; + /// + /// + /// + public bool TryPickResponseDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseDone? value) + { + value = ResponseDone; + return IsResponseDone; + } + /// /// Returned when the model-generated function call arguments are updated. /// @@ -475,6 +774,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseFunctionCallArgumentsDelta => ResponseFunctionCallArgumentsDelta != null; + /// + /// + /// + public bool TryPickResponseFunctionCallArgumentsDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseFunctionCallArgumentsDelta? value) + { + value = ResponseFunctionCallArgumentsDelta; + return IsResponseFunctionCallArgumentsDelta; + } + /// /// Returned when the model-generated function call arguments are done streaming.
/// Also emitted when a Response is interrupted, incomplete, or cancelled. @@ -493,6 +805,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseFunctionCallArgumentsDone => ResponseFunctionCallArgumentsDone != null; + /// + /// + /// + public bool TryPickResponseFunctionCallArgumentsDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseFunctionCallArgumentsDone? value) + { + value = ResponseFunctionCallArgumentsDone; + return IsResponseFunctionCallArgumentsDone; + } + /// /// Returned when a new Item is created during Response generation. /// @@ -510,6 +835,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseOutputItemAdded => ResponseOutputItemAdded != null; + /// + /// + /// + public bool TryPickResponseOutputItemAdded( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseOutputItemAdded? value) + { + value = ResponseOutputItemAdded; + return IsResponseOutputItemAdded; + } + /// /// Returned when an Item is done streaming. Also emitted when a Response is
/// interrupted, incomplete, or cancelled. @@ -528,6 +866,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseOutputItemDone => ResponseOutputItemDone != null; + /// + /// + /// + public bool TryPickResponseOutputItemDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseOutputItemDone? value) + { + value = ResponseOutputItemDone; + return IsResponseOutputItemDone; + } + /// /// Returned when the text value of an "output_text" content part is updated. /// @@ -545,6 +896,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseOutputTextDelta => ResponseOutputTextDelta != null; + /// + /// + /// + public bool TryPickResponseOutputTextDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseTextDelta? value) + { + value = ResponseOutputTextDelta; + return IsResponseOutputTextDelta; + } + /// /// Returned when the text value of an "output_text" content part is done streaming. Also
/// emitted when a Response is interrupted, incomplete, or cancelled. @@ -563,6 +927,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseOutputTextDone => ResponseOutputTextDone != null; + /// + /// + /// + public bool TryPickResponseOutputTextDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseTextDone? value) + { + value = ResponseOutputTextDone; + return IsResponseOutputTextDone; + } + /// /// Returned when a Session is created. Emitted automatically when a new
/// connection is established as the first server event. This event will contain
@@ -582,6 +959,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsSessionCreated => SessionCreated != null; + /// + /// + /// + public bool TryPickSessionCreated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventSessionCreated? value) + { + value = SessionCreated; + return IsSessionCreated; + } + /// /// Returned when a session is updated with a `session.update` event, unless
/// there is an error. @@ -600,6 +990,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsSessionUpdated => SessionUpdated != null; + /// + /// + /// + public bool TryPickSessionUpdated( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventSessionUpdated? value) + { + value = SessionUpdated; + return IsSessionUpdated; + } + /// /// **WebRTC/SIP Only:** Emitted when the server begins streaming audio to the client. This event is
/// emitted after an audio content part has been added (`response.content_part.added`)
@@ -620,6 +1023,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsOutputAudioBufferStarted => OutputAudioBufferStarted != null; + /// + /// + /// + public bool TryPickOutputAudioBufferStarted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventOutputAudioBufferStarted? value) + { + value = OutputAudioBufferStarted; + return IsOutputAudioBufferStarted; + } + /// /// **WebRTC/SIP Only:** Emitted when the output audio buffer has been completely drained on the server,
/// and no more audio is forthcoming. This event is emitted after the full response
@@ -640,6 +1056,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsOutputAudioBufferStopped => OutputAudioBufferStopped != null; + /// + /// + /// + public bool TryPickOutputAudioBufferStopped( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventOutputAudioBufferStopped? value) + { + value = OutputAudioBufferStopped; + return IsOutputAudioBufferStopped; + } + /// /// **WebRTC/SIP Only:** Emitted when the output audio buffer is cleared. This happens either in VAD
/// mode when the user has interrupted (`input_audio_buffer.speech_started`),
@@ -661,6 +1090,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsOutputAudioBufferCleared => OutputAudioBufferCleared != null; + /// + /// + /// + public bool TryPickOutputAudioBufferCleared( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventOutputAudioBufferCleared? value) + { + value = OutputAudioBufferCleared; + return IsOutputAudioBufferCleared; + } + /// /// Sent by the server when an Item is added to the default Conversation. This can happen in several cases:
/// - When the client sends a `conversation.item.create` event.
@@ -682,6 +1124,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemAdded => ConversationItemAdded != null; + /// + /// + /// + public bool TryPickConversationItemAdded( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventConversationItemAdded? value) + { + value = ConversationItemAdded; + return IsConversationItemAdded; + } + /// /// Returned when a conversation item is finalized.
/// The event will include the full content of the Item except for audio data, which can be retrieved separately with a `conversation.item.retrieve` event if needed. @@ -700,6 +1155,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemDone => ConversationItemDone != null; + /// + /// + /// + public bool TryPickConversationItemDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventConversationItemDone? value) + { + value = ConversationItemDone; + return IsConversationItemDone; + } + /// /// Returned when the Server VAD timeout is triggered for the input audio buffer. This is configured
/// with `idle_timeout_ms` in the `turn_detection` settings of the session, and it indicates that
@@ -727,6 +1195,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsInputAudioBufferTimeoutTriggered => InputAudioBufferTimeoutTriggered != null; + /// + /// + /// + public bool TryPickInputAudioBufferTimeoutTriggered( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventInputAudioBufferTimeoutTriggered? value) + { + value = InputAudioBufferTimeoutTriggered; + return IsInputAudioBufferTimeoutTriggered; + } + /// /// Returned when an input audio transcription segment is identified for an item. /// @@ -744,6 +1225,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsConversationItemInputAudioTranscriptionSegment => ConversationItemInputAudioTranscriptionSegment != null; + /// + /// + /// + public bool TryPickConversationItemInputAudioTranscriptionSegment( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventConversationItemInputAudioTranscriptionSegment? value) + { + value = ConversationItemInputAudioTranscriptionSegment; + return IsConversationItemInputAudioTranscriptionSegment; + } + /// /// Returned when listing MCP tools is in progress for an item. /// @@ -761,6 +1255,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsMcpListToolsInProgress => McpListToolsInProgress != null; + /// + /// + /// + public bool TryPickMcpListToolsInProgress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventMCPListToolsInProgress? value) + { + value = McpListToolsInProgress; + return IsMcpListToolsInProgress; + } + /// /// Returned when listing MCP tools has completed for an item. /// @@ -778,6 +1285,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsMcpListToolsCompleted => McpListToolsCompleted != null; + /// + /// + /// + public bool TryPickMcpListToolsCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventMCPListToolsCompleted? value) + { + value = McpListToolsCompleted; + return IsMcpListToolsCompleted; + } + /// /// Returned when listing MCP tools has failed for an item. /// @@ -795,6 +1315,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsMcpListToolsFailed => McpListToolsFailed != null; + /// + /// + /// + public bool TryPickMcpListToolsFailed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventMCPListToolsFailed? value) + { + value = McpListToolsFailed; + return IsMcpListToolsFailed; + } + /// /// Returned when MCP tool call arguments are updated during response generation. /// @@ -812,6 +1345,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseMcpCallArgumentsDelta => ResponseMcpCallArgumentsDelta != null; + /// + /// + /// + public bool TryPickResponseMcpCallArgumentsDelta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseMCPCallArgumentsDelta? value) + { + value = ResponseMcpCallArgumentsDelta; + return IsResponseMcpCallArgumentsDelta; + } + /// /// Returned when MCP tool call arguments are finalized during response generation. /// @@ -829,6 +1375,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseMcpCallArgumentsDone => ResponseMcpCallArgumentsDone != null; + /// + /// + /// + public bool TryPickResponseMcpCallArgumentsDone( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseMCPCallArgumentsDone? value) + { + value = ResponseMcpCallArgumentsDone; + return IsResponseMcpCallArgumentsDone; + } + /// /// Returned when an MCP tool call has started and is in progress. /// @@ -846,6 +1405,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsResponseMcpCallInProgress => ResponseMcpCallInProgress != null; + /// + /// + /// + public bool TryPickResponseMcpCallInProgress( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseMCPCallInProgress? value) + { + value = ResponseMcpCallInProgress; + return IsResponseMcpCallInProgress; + } + /// /// Returned when an MCP tool call has completed successfully. /// @@ -859,9 +1431,22 @@ namespace tryAGI.OpenAI.Realtime /// ///
#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseMcpCallCompleted))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseMcpCallCompleted))] +#endif + public bool IsResponseMcpCallCompleted => ResponseMcpCallCompleted != null; + + /// + /// + /// + public bool TryPickResponseMcpCallCompleted( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] #endif - public bool IsResponseMcpCallCompleted => ResponseMcpCallCompleted != null; + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseMCPCallCompleted? value) + { + value = ResponseMcpCallCompleted; + return IsResponseMcpCallCompleted; + } /// /// Returned when an MCP tool call has failed. @@ -879,6 +1464,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ResponseMcpCallFailed))] #endif public bool IsResponseMcpCallFailed => ResponseMcpCallFailed != null; + + /// + /// + /// + public bool TryPickResponseMcpCallFailed( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeServerEventResponseMCPCallFailed? value) + { + value = ResponseMcpCallFailed; + return IsResponseMcpCallFailed; + } /// /// /// @@ -1923,52 +2521,52 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? conversationCreated = null, - global::System.Func? conversationItemCreated = null, - global::System.Func? conversationItemDeleted = null, - global::System.Func? conversationItemInputAudioTranscriptionCompleted = null, - global::System.Func? conversationItemInputAudioTranscriptionDelta = null, - global::System.Func? conversationItemInputAudioTranscriptionFailed = null, - global::System.Func? conversationItemRetrieved = null, - global::System.Func? conversationItemTruncated = null, - global::System.Func? error = null, - global::System.Func? inputAudioBufferCleared = null, - global::System.Func? inputAudioBufferCommitted = null, - global::System.Func? inputAudioBufferDtmfEventReceived = null, - global::System.Func? inputAudioBufferSpeechStarted = null, - global::System.Func? inputAudioBufferSpeechStopped = null, - global::System.Func? rateLimitsUpdated = null, - global::System.Func? responseOutputAudioDelta = null, - global::System.Func? responseOutputAudioDone = null, - global::System.Func? responseOutputAudioTranscriptDelta = null, - global::System.Func? responseOutputAudioTranscriptDone = null, - global::System.Func? responseContentPartAdded = null, - global::System.Func? responseContentPartDone = null, - global::System.Func? responseCreated = null, - global::System.Func? responseDone = null, - global::System.Func? responseFunctionCallArgumentsDelta = null, - global::System.Func? responseFunctionCallArgumentsDone = null, - global::System.Func? responseOutputItemAdded = null, - global::System.Func? responseOutputItemDone = null, - global::System.Func? responseOutputTextDelta = null, - global::System.Func? responseOutputTextDone = null, - global::System.Func? sessionCreated = null, - global::System.Func? sessionUpdated = null, - global::System.Func? outputAudioBufferStarted = null, - global::System.Func? outputAudioBufferStopped = null, - global::System.Func? outputAudioBufferCleared = null, - global::System.Func? conversationItemAdded = null, - global::System.Func? conversationItemDone = null, - global::System.Func? inputAudioBufferTimeoutTriggered = null, - global::System.Func? conversationItemInputAudioTranscriptionSegment = null, - global::System.Func? mcpListToolsInProgress = null, - global::System.Func? mcpListToolsCompleted = null, - global::System.Func? mcpListToolsFailed = null, - global::System.Func? responseMcpCallArgumentsDelta = null, - global::System.Func? responseMcpCallArgumentsDone = null, - global::System.Func? responseMcpCallInProgress = null, - global::System.Func? responseMcpCallCompleted = null, - global::System.Func? responseMcpCallFailed = null, + global::System.Func? conversationCreated = null, + global::System.Func? conversationItemCreated = null, + global::System.Func? conversationItemDeleted = null, + global::System.Func? conversationItemInputAudioTranscriptionCompleted = null, + global::System.Func? conversationItemInputAudioTranscriptionDelta = null, + global::System.Func? conversationItemInputAudioTranscriptionFailed = null, + global::System.Func? conversationItemRetrieved = null, + global::System.Func? conversationItemTruncated = null, + global::System.Func? error = null, + global::System.Func? inputAudioBufferCleared = null, + global::System.Func? inputAudioBufferCommitted = null, + global::System.Func? inputAudioBufferDtmfEventReceived = null, + global::System.Func? inputAudioBufferSpeechStarted = null, + global::System.Func? inputAudioBufferSpeechStopped = null, + global::System.Func? rateLimitsUpdated = null, + global::System.Func? responseOutputAudioDelta = null, + global::System.Func? responseOutputAudioDone = null, + global::System.Func? responseOutputAudioTranscriptDelta = null, + global::System.Func? responseOutputAudioTranscriptDone = null, + global::System.Func? responseContentPartAdded = null, + global::System.Func? responseContentPartDone = null, + global::System.Func? responseCreated = null, + global::System.Func? responseDone = null, + global::System.Func? responseFunctionCallArgumentsDelta = null, + global::System.Func? responseFunctionCallArgumentsDone = null, + global::System.Func? responseOutputItemAdded = null, + global::System.Func? responseOutputItemDone = null, + global::System.Func? responseOutputTextDelta = null, + global::System.Func? responseOutputTextDone = null, + global::System.Func? sessionCreated = null, + global::System.Func? sessionUpdated = null, + global::System.Func? outputAudioBufferStarted = null, + global::System.Func? outputAudioBufferStopped = null, + global::System.Func? outputAudioBufferCleared = null, + global::System.Func? conversationItemAdded = null, + global::System.Func? conversationItemDone = null, + global::System.Func? inputAudioBufferTimeoutTriggered = null, + global::System.Func? conversationItemInputAudioTranscriptionSegment = null, + global::System.Func? mcpListToolsInProgress = null, + global::System.Func? mcpListToolsCompleted = null, + global::System.Func? mcpListToolsFailed = null, + global::System.Func? responseMcpCallArgumentsDelta = null, + global::System.Func? responseMcpCallArgumentsDone = null, + global::System.Func? responseMcpCallInProgress = null, + global::System.Func? responseMcpCallCompleted = null, + global::System.Func? responseMcpCallFailed = null, bool validate = true) { if (validate) @@ -2168,52 +2766,340 @@ public bool Validate() /// ///
public void Match( - global::System.Action? conversationCreated = null, - global::System.Action? conversationItemCreated = null, - global::System.Action? conversationItemDeleted = null, - global::System.Action? conversationItemInputAudioTranscriptionCompleted = null, - global::System.Action? conversationItemInputAudioTranscriptionDelta = null, - global::System.Action? conversationItemInputAudioTranscriptionFailed = null, - global::System.Action? conversationItemRetrieved = null, - global::System.Action? conversationItemTruncated = null, - global::System.Action? error = null, - global::System.Action? inputAudioBufferCleared = null, - global::System.Action? inputAudioBufferCommitted = null, - global::System.Action? inputAudioBufferDtmfEventReceived = null, - global::System.Action? inputAudioBufferSpeechStarted = null, - global::System.Action? inputAudioBufferSpeechStopped = null, - global::System.Action? rateLimitsUpdated = null, - global::System.Action? responseOutputAudioDelta = null, - global::System.Action? responseOutputAudioDone = null, - global::System.Action? responseOutputAudioTranscriptDelta = null, - global::System.Action? responseOutputAudioTranscriptDone = null, - global::System.Action? responseContentPartAdded = null, - global::System.Action? responseContentPartDone = null, - global::System.Action? responseCreated = null, - global::System.Action? responseDone = null, - global::System.Action? responseFunctionCallArgumentsDelta = null, - global::System.Action? responseFunctionCallArgumentsDone = null, - global::System.Action? responseOutputItemAdded = null, - global::System.Action? responseOutputItemDone = null, - global::System.Action? responseOutputTextDelta = null, - global::System.Action? responseOutputTextDone = null, - global::System.Action? sessionCreated = null, - global::System.Action? sessionUpdated = null, - global::System.Action? outputAudioBufferStarted = null, - global::System.Action? outputAudioBufferStopped = null, - global::System.Action? outputAudioBufferCleared = null, - global::System.Action? conversationItemAdded = null, - global::System.Action? conversationItemDone = null, - global::System.Action? inputAudioBufferTimeoutTriggered = null, - global::System.Action? conversationItemInputAudioTranscriptionSegment = null, - global::System.Action? mcpListToolsInProgress = null, - global::System.Action? mcpListToolsCompleted = null, - global::System.Action? mcpListToolsFailed = null, - global::System.Action? responseMcpCallArgumentsDelta = null, - global::System.Action? responseMcpCallArgumentsDone = null, - global::System.Action? responseMcpCallInProgress = null, - global::System.Action? responseMcpCallCompleted = null, - global::System.Action? responseMcpCallFailed = null, + global::System.Action? conversationCreated = null, + + global::System.Action? conversationItemCreated = null, + + global::System.Action? conversationItemDeleted = null, + + global::System.Action? conversationItemInputAudioTranscriptionCompleted = null, + + global::System.Action? conversationItemInputAudioTranscriptionDelta = null, + + global::System.Action? conversationItemInputAudioTranscriptionFailed = null, + + global::System.Action? conversationItemRetrieved = null, + + global::System.Action? conversationItemTruncated = null, + + global::System.Action? error = null, + + global::System.Action? inputAudioBufferCleared = null, + + global::System.Action? inputAudioBufferCommitted = null, + + global::System.Action? inputAudioBufferDtmfEventReceived = null, + + global::System.Action? inputAudioBufferSpeechStarted = null, + + global::System.Action? inputAudioBufferSpeechStopped = null, + + global::System.Action? rateLimitsUpdated = null, + + global::System.Action? responseOutputAudioDelta = null, + + global::System.Action? responseOutputAudioDone = null, + + global::System.Action? responseOutputAudioTranscriptDelta = null, + + global::System.Action? responseOutputAudioTranscriptDone = null, + + global::System.Action? responseContentPartAdded = null, + + global::System.Action? responseContentPartDone = null, + + global::System.Action? responseCreated = null, + + global::System.Action? responseDone = null, + + global::System.Action? responseFunctionCallArgumentsDelta = null, + + global::System.Action? responseFunctionCallArgumentsDone = null, + + global::System.Action? responseOutputItemAdded = null, + + global::System.Action? responseOutputItemDone = null, + + global::System.Action? responseOutputTextDelta = null, + + global::System.Action? responseOutputTextDone = null, + + global::System.Action? sessionCreated = null, + + global::System.Action? sessionUpdated = null, + + global::System.Action? outputAudioBufferStarted = null, + + global::System.Action? outputAudioBufferStopped = null, + + global::System.Action? outputAudioBufferCleared = null, + + global::System.Action? conversationItemAdded = null, + + global::System.Action? conversationItemDone = null, + + global::System.Action? inputAudioBufferTimeoutTriggered = null, + + global::System.Action? conversationItemInputAudioTranscriptionSegment = null, + + global::System.Action? mcpListToolsInProgress = null, + + global::System.Action? mcpListToolsCompleted = null, + + global::System.Action? mcpListToolsFailed = null, + + global::System.Action? responseMcpCallArgumentsDelta = null, + + global::System.Action? responseMcpCallArgumentsDone = null, + + global::System.Action? responseMcpCallInProgress = null, + + global::System.Action? responseMcpCallCompleted = null, + + global::System.Action? responseMcpCallFailed = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsConversationCreated) + { + conversationCreated?.Invoke(ConversationCreated!); + } + else if (IsConversationItemCreated) + { + conversationItemCreated?.Invoke(ConversationItemCreated!); + } + else if (IsConversationItemDeleted) + { + conversationItemDeleted?.Invoke(ConversationItemDeleted!); + } + else if (IsConversationItemInputAudioTranscriptionCompleted) + { + conversationItemInputAudioTranscriptionCompleted?.Invoke(ConversationItemInputAudioTranscriptionCompleted!); + } + else if (IsConversationItemInputAudioTranscriptionDelta) + { + conversationItemInputAudioTranscriptionDelta?.Invoke(ConversationItemInputAudioTranscriptionDelta!); + } + else if (IsConversationItemInputAudioTranscriptionFailed) + { + conversationItemInputAudioTranscriptionFailed?.Invoke(ConversationItemInputAudioTranscriptionFailed!); + } + else if (IsConversationItemRetrieved) + { + conversationItemRetrieved?.Invoke(ConversationItemRetrieved!); + } + else if (IsConversationItemTruncated) + { + conversationItemTruncated?.Invoke(ConversationItemTruncated!); + } + else if (IsError) + { + error?.Invoke(Error!); + } + else if (IsInputAudioBufferCleared) + { + inputAudioBufferCleared?.Invoke(InputAudioBufferCleared!); + } + else if (IsInputAudioBufferCommitted) + { + inputAudioBufferCommitted?.Invoke(InputAudioBufferCommitted!); + } + else if (IsInputAudioBufferDtmfEventReceived) + { + inputAudioBufferDtmfEventReceived?.Invoke(InputAudioBufferDtmfEventReceived!); + } + else if (IsInputAudioBufferSpeechStarted) + { + inputAudioBufferSpeechStarted?.Invoke(InputAudioBufferSpeechStarted!); + } + else if (IsInputAudioBufferSpeechStopped) + { + inputAudioBufferSpeechStopped?.Invoke(InputAudioBufferSpeechStopped!); + } + else if (IsRateLimitsUpdated) + { + rateLimitsUpdated?.Invoke(RateLimitsUpdated!); + } + else if (IsResponseOutputAudioDelta) + { + responseOutputAudioDelta?.Invoke(ResponseOutputAudioDelta!); + } + else if (IsResponseOutputAudioDone) + { + responseOutputAudioDone?.Invoke(ResponseOutputAudioDone!); + } + else if (IsResponseOutputAudioTranscriptDelta) + { + responseOutputAudioTranscriptDelta?.Invoke(ResponseOutputAudioTranscriptDelta!); + } + else if (IsResponseOutputAudioTranscriptDone) + { + responseOutputAudioTranscriptDone?.Invoke(ResponseOutputAudioTranscriptDone!); + } + else if (IsResponseContentPartAdded) + { + responseContentPartAdded?.Invoke(ResponseContentPartAdded!); + } + else if (IsResponseContentPartDone) + { + responseContentPartDone?.Invoke(ResponseContentPartDone!); + } + else if (IsResponseCreated) + { + responseCreated?.Invoke(ResponseCreated!); + } + else if (IsResponseDone) + { + responseDone?.Invoke(ResponseDone!); + } + else if (IsResponseFunctionCallArgumentsDelta) + { + responseFunctionCallArgumentsDelta?.Invoke(ResponseFunctionCallArgumentsDelta!); + } + else if (IsResponseFunctionCallArgumentsDone) + { + responseFunctionCallArgumentsDone?.Invoke(ResponseFunctionCallArgumentsDone!); + } + else if (IsResponseOutputItemAdded) + { + responseOutputItemAdded?.Invoke(ResponseOutputItemAdded!); + } + else if (IsResponseOutputItemDone) + { + responseOutputItemDone?.Invoke(ResponseOutputItemDone!); + } + else if (IsResponseOutputTextDelta) + { + responseOutputTextDelta?.Invoke(ResponseOutputTextDelta!); + } + else if (IsResponseOutputTextDone) + { + responseOutputTextDone?.Invoke(ResponseOutputTextDone!); + } + else if (IsSessionCreated) + { + sessionCreated?.Invoke(SessionCreated!); + } + else if (IsSessionUpdated) + { + sessionUpdated?.Invoke(SessionUpdated!); + } + else if (IsOutputAudioBufferStarted) + { + outputAudioBufferStarted?.Invoke(OutputAudioBufferStarted!); + } + else if (IsOutputAudioBufferStopped) + { + outputAudioBufferStopped?.Invoke(OutputAudioBufferStopped!); + } + else if (IsOutputAudioBufferCleared) + { + outputAudioBufferCleared?.Invoke(OutputAudioBufferCleared!); + } + else if (IsConversationItemAdded) + { + conversationItemAdded?.Invoke(ConversationItemAdded!); + } + else if (IsConversationItemDone) + { + conversationItemDone?.Invoke(ConversationItemDone!); + } + else if (IsInputAudioBufferTimeoutTriggered) + { + inputAudioBufferTimeoutTriggered?.Invoke(InputAudioBufferTimeoutTriggered!); + } + else if (IsConversationItemInputAudioTranscriptionSegment) + { + conversationItemInputAudioTranscriptionSegment?.Invoke(ConversationItemInputAudioTranscriptionSegment!); + } + else if (IsMcpListToolsInProgress) + { + mcpListToolsInProgress?.Invoke(McpListToolsInProgress!); + } + else if (IsMcpListToolsCompleted) + { + mcpListToolsCompleted?.Invoke(McpListToolsCompleted!); + } + else if (IsMcpListToolsFailed) + { + mcpListToolsFailed?.Invoke(McpListToolsFailed!); + } + else if (IsResponseMcpCallArgumentsDelta) + { + responseMcpCallArgumentsDelta?.Invoke(ResponseMcpCallArgumentsDelta!); + } + else if (IsResponseMcpCallArgumentsDone) + { + responseMcpCallArgumentsDone?.Invoke(ResponseMcpCallArgumentsDone!); + } + else if (IsResponseMcpCallInProgress) + { + responseMcpCallInProgress?.Invoke(ResponseMcpCallInProgress!); + } + else if (IsResponseMcpCallCompleted) + { + responseMcpCallCompleted?.Invoke(ResponseMcpCallCompleted!); + } + else if (IsResponseMcpCallFailed) + { + responseMcpCallFailed?.Invoke(ResponseMcpCallFailed!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? conversationCreated = null, + global::System.Action? conversationItemCreated = null, + global::System.Action? conversationItemDeleted = null, + global::System.Action? conversationItemInputAudioTranscriptionCompleted = null, + global::System.Action? conversationItemInputAudioTranscriptionDelta = null, + global::System.Action? conversationItemInputAudioTranscriptionFailed = null, + global::System.Action? conversationItemRetrieved = null, + global::System.Action? conversationItemTruncated = null, + global::System.Action? error = null, + global::System.Action? inputAudioBufferCleared = null, + global::System.Action? inputAudioBufferCommitted = null, + global::System.Action? inputAudioBufferDtmfEventReceived = null, + global::System.Action? inputAudioBufferSpeechStarted = null, + global::System.Action? inputAudioBufferSpeechStopped = null, + global::System.Action? rateLimitsUpdated = null, + global::System.Action? responseOutputAudioDelta = null, + global::System.Action? responseOutputAudioDone = null, + global::System.Action? responseOutputAudioTranscriptDelta = null, + global::System.Action? responseOutputAudioTranscriptDone = null, + global::System.Action? responseContentPartAdded = null, + global::System.Action? responseContentPartDone = null, + global::System.Action? responseCreated = null, + global::System.Action? responseDone = null, + global::System.Action? responseFunctionCallArgumentsDelta = null, + global::System.Action? responseFunctionCallArgumentsDone = null, + global::System.Action? responseOutputItemAdded = null, + global::System.Action? responseOutputItemDone = null, + global::System.Action? responseOutputTextDelta = null, + global::System.Action? responseOutputTextDone = null, + global::System.Action? sessionCreated = null, + global::System.Action? sessionUpdated = null, + global::System.Action? outputAudioBufferStarted = null, + global::System.Action? outputAudioBufferStopped = null, + global::System.Action? outputAudioBufferCleared = null, + global::System.Action? conversationItemAdded = null, + global::System.Action? conversationItemDone = null, + global::System.Action? inputAudioBufferTimeoutTriggered = null, + global::System.Action? conversationItemInputAudioTranscriptionSegment = null, + global::System.Action? mcpListToolsInProgress = null, + global::System.Action? mcpListToolsCompleted = null, + global::System.Action? mcpListToolsFailed = null, + global::System.Action? responseMcpCallArgumentsDelta = null, + global::System.Action? responseMcpCallArgumentsDone = null, + global::System.Action? responseMcpCallInProgress = null, + global::System.Action? responseMcpCallCompleted = null, + global::System.Action? responseMcpCallFailed = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeTruncation.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeTruncation.g.cs index 6d7ff942..eab2f4f4 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeTruncation.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeTruncation.g.cs @@ -29,6 +29,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsEnum => Enum != null; + /// + /// + /// + public bool TryPickEnum( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeTruncationEnum? value) + { + value = Enum; + return IsEnum; + } + /// /// Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. This allows you to amortize truncations across multiple turns, which can help improve cached token usage. /// @@ -45,6 +58,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RetentionRatioTruncation))] #endif public bool IsRetentionRatioTruncation => RetentionRatioTruncation != null; + + /// + /// + /// + public bool TryPickRetentionRatioTruncation( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeTruncationEnum2? value) + { + value = RetentionRatioTruncation; + return IsRetentionRatioTruncation; + } /// /// /// @@ -122,7 +148,7 @@ public bool Validate() ///
public TResult? Match( global::System.Func? @enum = null, - global::System.Func? retentionRatioTruncation = null, + global::System.Func? retentionRatioTruncation = null, bool validate = true) { if (validate) @@ -147,7 +173,31 @@ public bool Validate() ///
public void Match( global::System.Action? @enum = null, - global::System.Action? retentionRatioTruncation = null, + + global::System.Action? retentionRatioTruncation = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsEnum) + { + @enum?.Invoke(Enum!); + } + else if (IsRetentionRatioTruncation) + { + retentionRatioTruncation?.Invoke(RetentionRatioTruncation!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? @enum = null, + global::System.Action? retentionRatioTruncation = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeTurnDetectionRealtimeTurnDetection1.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeTurnDetectionRealtimeTurnDetection1.g.cs index f4530e9e..573c4e2f 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeTurnDetectionRealtimeTurnDetection1.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.RealtimeTurnDetectionRealtimeTurnDetection1.g.cs @@ -30,6 +30,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsServerVad => ServerVad != null; + /// + /// + /// + public bool TryPickServerVad( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeTurnDetectionRealtimeTurnDetection1ServerVad? value) + { + value = ServerVad; + return IsServerVad; + } + /// /// Server-side semantic turn detection which uses a model to determine when the user has finished speaking. /// @@ -46,6 +59,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SemanticVad))] #endif public bool IsSemanticVad => SemanticVad != null; + + /// + /// + /// + public bool TryPickSemanticVad( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.RealtimeTurnDetectionRealtimeTurnDetection1SemanticVad? value) + { + value = SemanticVad; + return IsSemanticVad; + } /// /// /// @@ -122,8 +148,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? serverVad = null, - global::System.Func? semanticVad = null, + global::System.Func? serverVad = null, + global::System.Func? semanticVad = null, bool validate = true) { if (validate) @@ -147,8 +173,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? serverVad = null, - global::System.Action? semanticVad = null, + global::System.Action? serverVad = null, + + global::System.Action? semanticVad = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsServerVad) + { + serverVad?.Invoke(ServerVad!); + } + else if (IsSemanticVad) + { + semanticVad?.Invoke(SemanticVad!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? serverVad = null, + global::System.Action? semanticVad = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.VoiceIdsOrCustomVoice.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.VoiceIdsOrCustomVoice.g.cs index 8ec83952..ea5eee0d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.VoiceIdsOrCustomVoice.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.VoiceIdsOrCustomVoice.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsShared => Shared != null; + /// + /// + /// + public bool TryPickShared( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.VoiceIdsShared? value) + { + value = Shared; + return IsShared; + } + /// /// Custom voice reference. /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VoiceIdsOrCustomVoiceVariant2))] #endif public bool IsVoiceIdsOrCustomVoiceVariant2 => VoiceIdsOrCustomVoiceVariant2 != null; + + /// + /// + /// + public bool TryPickVoiceIdsOrCustomVoiceVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.VoiceIdsOrCustomVoiceVariant2? value) + { + value = VoiceIdsOrCustomVoiceVariant2; + return IsVoiceIdsOrCustomVoiceVariant2; + } /// /// /// @@ -119,7 +145,7 @@ public bool Validate() ///
public TResult? Match( global::System.Func? shared = null, - global::System.Func? voiceIdsOrCustomVoiceVariant2 = null, + global::System.Func? voiceIdsOrCustomVoiceVariant2 = null, bool validate = true) { if (validate) @@ -144,7 +170,31 @@ public bool Validate() ///
public void Match( global::System.Action? shared = null, - global::System.Action? voiceIdsOrCustomVoiceVariant2 = null, + + global::System.Action? voiceIdsOrCustomVoiceVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsShared) + { + shared?.Invoke(Shared!); + } + else if (IsVoiceIdsOrCustomVoiceVariant2) + { + voiceIdsOrCustomVoiceVariant2?.Invoke(VoiceIdsOrCustomVoiceVariant2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? shared = null, + global::System.Action? voiceIdsOrCustomVoiceVariant2 = null, bool validate = true) { if (validate) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.VoiceIdsShared.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.VoiceIdsShared.g.cs index dd0f2b05..3fd4d15d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.VoiceIdsShared.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.Models.VoiceIdsShared.g.cs @@ -26,6 +26,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsVoiceIdsSharedVariant1 => VoiceIdsSharedVariant1 != null; + /// + /// + /// + public bool TryPickVoiceIdsSharedVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = VoiceIdsSharedVariant1; + return IsVoiceIdsSharedVariant1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Enum))] #endif public bool IsEnum => Enum != null; + + /// + /// + /// + public bool TryPickEnum( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::tryAGI.OpenAI.Realtime.VoiceIdsSharedEnum? value) + { + value = Enum; + return IsEnum; + } /// /// /// @@ -118,7 +144,7 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? voiceIdsSharedVariant1 = null, + global::System.Func? voiceIdsSharedVariant1 = null, global::System.Func? @enum = null, bool validate = true) { @@ -143,7 +169,31 @@ public bool Validate() /// ///
public void Match( - global::System.Action? voiceIdsSharedVariant1 = null, + global::System.Action? voiceIdsSharedVariant1 = null, + + global::System.Action? @enum = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsVoiceIdsSharedVariant1) + { + voiceIdsSharedVariant1?.Invoke(VoiceIdsSharedVariant1!); + } + else if (IsEnum) + { + @enum?.Invoke(Enum!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? voiceIdsSharedVariant1 = null, global::System.Action? @enum = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.2.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.2.g.cs index f4beefab..76f3a760 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.2.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.2.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + /// /// /// @@ -41,6 +54,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] #endif public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } /// /// /// @@ -143,6 +169,30 @@ public bool Validate() ///
public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, bool validate = true) { diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.3.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.3.g.cs index a200ae99..09090d0d 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.3.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.3.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + /// /// /// @@ -58,6 +84,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] #endif public bool IsValue3 => Value3 != null; + + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } /// /// /// @@ -187,6 +226,36 @@ public bool Validate() ///
public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, bool validate = true) diff --git a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.4.g.cs b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.4.g.cs index 57616794..abfadad8 100644 --- a/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.4.g.cs +++ b/src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Realtime.OneOf.4.g.cs @@ -25,6 +25,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + /// /// /// @@ -42,6 +55,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + /// /// /// @@ -59,6 +85,19 @@ namespace tryAGI.OpenAI.Realtime #endif public bool IsValue3 => Value3 != null; + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + /// /// /// @@ -75,6 +114,19 @@ namespace tryAGI.OpenAI.Realtime [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] #endif public bool IsValue4 => Value4 != null; + + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } /// /// /// @@ -231,6 +283,42 @@ public bool Validate() ///
public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, global::System.Action? value4 = null,