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!);
+ }
+ }
+
+ ///