From ec50a7148196bf3475db2ac3d107d8fecf919bd3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 8 May 2026 02:08:31 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- src/libs/Letta/Generated/Letta.AnyOf.2.g.cs | 50 +++ src/libs/Letta/Generated/Letta.AnyOf.3.g.cs | 69 ++++ src/libs/Letta/Generated/Letta.AnyOf.4.g.cs | 88 +++++ src/libs/Letta/Generated/Letta.AnyOf.5.g.cs | 107 ++++++ src/libs/Letta/Generated/Letta.AnyOf.6.g.cs | 126 +++++++ ...Letta.LettaClient.Constructors.Bearer.g.cs | 1 + .../Letta.Models.ApprovalsVariant1Item.g.cs | 58 ++- .../Letta.Models.ApprovalsVariant1Item2.g.cs | 58 ++- .../Letta/Generated/Letta.Models.Config.g.cs | 81 +++- .../Letta/Generated/Letta.Models.Config4.g.cs | 81 +++- .../Letta/Generated/Letta.Models.Config5.g.cs | 58 ++- .../Letta/Generated/Letta.Models.Config6.g.cs | 58 ++- .../Letta/Generated/Letta.Models.Config7.g.cs | 58 ++- .../Letta/Generated/Letta.Models.Config8.g.cs | 58 ++- .../Letta/Generated/Letta.Models.Config9.g.cs | 58 ++- .../Letta.Models.ContentVariant1Item.g.cs | 196 +++++++++- .../Generated/Letta.Models.DataItem.g.cs | 35 +- .../Generated/Letta.Models.DataItem2.g.cs | 35 +- .../Generated/Letta.Models.EventsItem.g.cs | 127 ++++++- ...Letta.Models.FuncResponseVariant2Item.g.cs | 58 ++- ...etta.Models.FuncResponseVariant2Item2.g.cs | 58 ++- .../Letta.Models.InputVariant2Item.g.cs | 196 +++++++++- .../Letta.Models.InputVariant2Item2.g.cs | 196 +++++++++- .../Letta.Models.InputVariant2Item3.g.cs | 196 +++++++++- .../Letta.Models.InputVariant2Item4.g.cs | 196 +++++++++- .../Letta.Models.InputVariant2Item5.g.cs | 196 +++++++++- ...els.LettaAssistantMessageContentUnion.g.cs | 35 +- ...Letta.Models.LettaMessageContentUnion.g.cs | 173 ++++++++- .../Letta.Models.LettaMessageUnion.g.cs | 265 +++++++++++-- .../Letta.Models.LettaStreamingResponse.g.cs | 311 +++++++++++++-- ...ta.Models.LettaToolReturnContentUnion.g.cs | 58 ++- ...a.Models.LettaUserMessageContentUnion.g.cs | 58 ++- ...odels.ListMessagesForStepResponseItem.g.cs | 265 +++++++++++-- .../Generated/Letta.Models.ManagerConfig.g.cs | 127 ++++++- .../Letta.Models.ManagerConfig2.g.cs | 127 ++++++- .../Letta.Models.ManagerConfig3.g.cs | 127 ++++++- .../Letta.Models.ManagerConfigVariant1.g.cs | 127 ++++++- .../Letta.Models.ModelSettingsVariant1.g.cs | 357 ++++++++++++++++-- .../Letta.Models.ModelSettingsVariant110.g.cs | 357 ++++++++++++++++-- .../Letta.Models.ModelSettingsVariant12.g.cs | 357 ++++++++++++++++-- .../Letta.Models.ModelSettingsVariant13.g.cs | 357 ++++++++++++++++-- .../Letta.Models.ModelSettingsVariant14.g.cs | 357 ++++++++++++++++-- .../Letta.Models.ModelSettingsVariant15.g.cs | 357 ++++++++++++++++-- .../Letta.Models.ModelSettingsVariant16.g.cs | 357 ++++++++++++++++-- .../Letta.Models.ModelSettingsVariant17.g.cs | 357 ++++++++++++++++-- .../Letta.Models.ModelSettingsVariant18.g.cs | 357 ++++++++++++++++-- .../Letta.Models.ModelSettingsVariant19.g.cs | 357 ++++++++++++++++-- ...tta.Models.ModifyGroupMessageResponse.g.cs | 265 +++++++++++-- .../Letta.Models.ModifyMessageResponse.g.cs | 265 +++++++++++-- .../Generated/Letta.Models.PolicyItem.g.cs | 35 +- .../Letta.Models.ProducerConfig.g.cs | 58 ++- .../Letta.Models.ProducerConfig2.g.cs | 58 ++- .../Letta.Models.ProducerConfig3.g.cs | 58 ++- .../Letta.Models.ResponseFormatVariant1.g.cs | 81 +++- ...Letta.Models.ResponseFormatVariant110.g.cs | 81 +++- ...Letta.Models.ResponseFormatVariant111.g.cs | 81 +++- ...Letta.Models.ResponseFormatVariant112.g.cs | 81 +++- ...Letta.Models.ResponseFormatVariant113.g.cs | 81 +++- ...Letta.Models.ResponseFormatVariant114.g.cs | 81 +++- ...Letta.Models.ResponseFormatVariant115.g.cs | 81 +++- ...Letta.Models.ResponseFormatVariant116.g.cs | 81 +++- ...Letta.Models.ResponseFormatVariant117.g.cs | 81 +++- ...Letta.Models.ResponseFormatVariant118.g.cs | 81 +++- .../Letta.Models.ResponseFormatVariant12.g.cs | 81 +++- .../Letta.Models.ResponseFormatVariant13.g.cs | 81 +++- .../Letta.Models.ResponseFormatVariant14.g.cs | 81 +++- .../Letta.Models.ResponseFormatVariant15.g.cs | 81 +++- .../Letta.Models.ResponseFormatVariant16.g.cs | 81 +++- .../Letta.Models.ResponseFormatVariant17.g.cs | 81 +++- .../Letta.Models.ResponseFormatVariant18.g.cs | 81 +++- .../Letta.Models.ResponseFormatVariant19.g.cs | 81 +++- .../Letta.Models.ResponseSchemaVariant1.g.cs | 81 +++- .../Letta.Models.ResponseSchemaVariant12.g.cs | 81 +++- ....Models.SearchAllMessagesResponseItem.g.cs | 104 ++++- .../Letta/Generated/Letta.Models.Source.g.cs | 81 +++- ...mplatesCreateTemplateNoProjectRequest.g.cs | 58 ++- ...Models.TemplatesCreateTemplateRequest.g.cs | 58 ++- .../Letta.Models.ToolRulesVariant1Item.g.cs | 219 ++++++++++- .../Letta.Models.ToolRulesVariant1Item2.g.cs | 219 ++++++++++- .../Letta.Models.ToolRulesVariant1Item3.g.cs | 219 ++++++++++- .../Letta.Models.ToolRulesVariant1Item4.g.cs | 219 ++++++++++- .../Letta.Models.ToolRulesVariant1Item5.g.cs | 219 ++++++++++- src/libs/Letta/Generated/Letta.OneOf.2.g.cs | 50 +++ src/libs/Letta/Generated/Letta.OneOf.6.g.cs | 126 +++++++ src/libs/Letta/Generated/Letta.OneOf.9.g.cs | 183 +++++++++ 85 files changed, 10973 insertions(+), 882 deletions(-) diff --git a/src/libs/Letta/Generated/Letta.AnyOf.2.g.cs b/src/libs/Letta/Generated/Letta.AnyOf.2.g.cs index 3e11e0b2..1094c726 100644 --- a/src/libs/Letta/Generated/Letta.AnyOf.2.g.cs +++ b/src/libs/Letta/Generated/Letta.AnyOf.2.g.cs @@ -25,6 +25,19 @@ namespace Letta #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 Letta [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/Letta/Generated/Letta.AnyOf.3.g.cs b/src/libs/Letta/Generated/Letta.AnyOf.3.g.cs index 8286aed0..441ee63f 100644 --- a/src/libs/Letta/Generated/Letta.AnyOf.3.g.cs +++ b/src/libs/Letta/Generated/Letta.AnyOf.3.g.cs @@ -25,6 +25,19 @@ namespace Letta #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 Letta #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 Letta [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/Letta/Generated/Letta.AnyOf.4.g.cs b/src/libs/Letta/Generated/Letta.AnyOf.4.g.cs index 930bb790..2fefbf82 100644 --- a/src/libs/Letta/Generated/Letta.AnyOf.4.g.cs +++ b/src/libs/Letta/Generated/Letta.AnyOf.4.g.cs @@ -25,6 +25,19 @@ namespace Letta #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 Letta #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 Letta #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 Letta [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/Letta/Generated/Letta.AnyOf.5.g.cs b/src/libs/Letta/Generated/Letta.AnyOf.5.g.cs index e7f6a833..57fa603a 100644 --- a/src/libs/Letta/Generated/Letta.AnyOf.5.g.cs +++ b/src/libs/Letta/Generated/Letta.AnyOf.5.g.cs @@ -25,6 +25,19 @@ namespace Letta #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 Letta #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 Letta #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 Letta #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 Letta [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/Letta/Generated/Letta.AnyOf.6.g.cs b/src/libs/Letta/Generated/Letta.AnyOf.6.g.cs index 9f864bf0..b9f5b58e 100644 --- a/src/libs/Letta/Generated/Letta.AnyOf.6.g.cs +++ b/src/libs/Letta/Generated/Letta.AnyOf.6.g.cs @@ -25,6 +25,19 @@ namespace Letta #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 Letta #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 Letta #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 Letta #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; + } + /// /// /// @@ -93,6 +145,19 @@ namespace Letta #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; + } + /// /// /// @@ -109,6 +174,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value6))] #endif public bool IsValue6 => Value6 != null; + + /// + /// + /// + public bool TryPickValue6( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T6? value) + { + value = Value6; + return IsValue6; + } /// /// /// @@ -319,6 +397,54 @@ 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, + + global::System.Action? value6 = 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!); + } + else if (IsValue6) + { + value6?.Invoke(Value6!); + } + } + + /// + /// + /// + 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/Letta/Generated/Letta.LettaClient.Constructors.Bearer.g.cs b/src/libs/Letta/Generated/Letta.LettaClient.Constructors.Bearer.g.cs index d98e9949..9adfd974 100644 --- a/src/libs/Letta/Generated/Letta.LettaClient.Constructors.Bearer.g.cs +++ b/src/libs/Letta/Generated/Letta.LettaClient.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/Letta/Generated/Letta.Models.ApprovalsVariant1Item.g.cs b/src/libs/Letta/Generated/Letta.Models.ApprovalsVariant1Item.g.cs index afd04379..00ef7f76 100644 --- a/src/libs/Letta/Generated/Letta.Models.ApprovalsVariant1Item.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ApprovalsVariant1Item.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsApproval => Approval != null; + /// + /// + /// + public bool TryPickApproval( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalReturn? value) + { + value = Approval; + return IsApproval; + } + /// /// /// @@ -47,6 +60,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Tool))] #endif public bool IsTool => Tool != null; + + /// + /// + /// + public bool TryPickTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.LettaSchemasLettaMessageToolReturn? value) + { + value = Tool; + return IsTool; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? approval = null, - global::System.Func? tool = null, + global::System.Func? approval = null, + global::System.Func? tool = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? approval = null, - global::System.Action? tool = null, + global::System.Action? approval = null, + + global::System.Action? tool = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsApproval) + { + approval?.Invoke(Approval!); + } + else if (IsTool) + { + tool?.Invoke(Tool!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? approval = null, + global::System.Action? tool = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ApprovalsVariant1Item2.g.cs b/src/libs/Letta/Generated/Letta.Models.ApprovalsVariant1Item2.g.cs index 0fe876b2..629e9efd 100644 --- a/src/libs/Letta/Generated/Letta.Models.ApprovalsVariant1Item2.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ApprovalsVariant1Item2.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsApproval => Approval != null; + /// + /// + /// + public bool TryPickApproval( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalReturn? value) + { + value = Approval; + return IsApproval; + } + /// /// /// @@ -47,6 +60,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Tool))] #endif public bool IsTool => Tool != null; + + /// + /// + /// + public bool TryPickTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.LettaSchemasLettaMessageToolReturn? value) + { + value = Tool; + return IsTool; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? approval = null, - global::System.Func? tool = null, + global::System.Func? approval = null, + global::System.Func? tool = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? approval = null, - global::System.Action? tool = null, + global::System.Action? approval = null, + + global::System.Action? tool = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsApproval) + { + approval?.Invoke(Approval!); + } + else if (IsTool) + { + tool?.Invoke(Tool!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? approval = null, + global::System.Action? tool = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.Config.g.cs b/src/libs/Letta/Generated/Letta.Models.Config.g.cs index 66e80218..2dd718a8 100644 --- a/src/libs/Letta/Generated/Letta.Models.Config.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.Config.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsStdio => Stdio != null; + /// + /// + /// + public bool TryPickStdio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.CreateStdioMCPServer? value) + { + value = Stdio; + return IsStdio; + } + /// /// Create a new SSE MCP server /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSse => Sse != null; + /// + /// + /// + public bool TryPickSse( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.CreateSSEMCPServer? value) + { + value = Sse; + return IsSse; + } + /// /// Create a new Streamable HTTP MCP server /// @@ -64,6 +90,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(StreamableHttp))] #endif public bool IsStreamableHttp => StreamableHttp != null; + + /// + /// + /// + public bool TryPickStreamableHttp( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.CreateStreamableHTTPMCPServer? value) + { + value = StreamableHttp; + return IsStreamableHttp; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? stdio = null, - global::System.Func? sse = null, - global::System.Func? streamableHttp = null, + global::System.Func? stdio = null, + global::System.Func? sse = null, + global::System.Func? streamableHttp = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? stdio = null, - global::System.Action? sse = null, - global::System.Action? streamableHttp = null, + global::System.Action? stdio = null, + + global::System.Action? sse = null, + + global::System.Action? streamableHttp = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsStdio) + { + stdio?.Invoke(Stdio!); + } + else if (IsSse) + { + sse?.Invoke(Sse!); + } + else if (IsStreamableHttp) + { + streamableHttp?.Invoke(StreamableHttp!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? stdio = null, + global::System.Action? sse = null, + global::System.Action? streamableHttp = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.Config4.g.cs b/src/libs/Letta/Generated/Letta.Models.Config4.g.cs index 05b11636..f53c6e7f 100644 --- a/src/libs/Letta/Generated/Letta.Models.Config4.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.Config4.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsStdio => Stdio != null; + /// + /// + /// + public bool TryPickStdio( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.LettaSchemasMcpServerUpdateStdioMCPServer? value) + { + value = Stdio; + return IsStdio; + } + /// /// Update schema for SSE MCP server - all fields optional /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSse => Sse != null; + /// + /// + /// + public bool TryPickSse( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.LettaSchemasMcpServerUpdateSSEMCPServer? value) + { + value = Sse; + return IsSse; + } + /// /// Update schema for Streamable HTTP MCP server - all fields optional /// @@ -64,6 +90,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(StreamableHttp))] #endif public bool IsStreamableHttp => StreamableHttp != null; + + /// + /// + /// + public bool TryPickStreamableHttp( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.LettaSchemasMcpServerUpdateStreamableHTTPMCPServer? value) + { + value = StreamableHttp; + return IsStreamableHttp; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? stdio = null, - global::System.Func? sse = null, - global::System.Func? streamableHttp = null, + global::System.Func? stdio = null, + global::System.Func? sse = null, + global::System.Func? streamableHttp = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? stdio = null, - global::System.Action? sse = null, - global::System.Action? streamableHttp = null, + global::System.Action? stdio = null, + + global::System.Action? sse = null, + + global::System.Action? streamableHttp = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsStdio) + { + stdio?.Invoke(Stdio!); + } + else if (IsSse) + { + sse?.Invoke(Sse!); + } + else if (IsStreamableHttp) + { + streamableHttp?.Invoke(StreamableHttp!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? stdio = null, + global::System.Action? sse = null, + global::System.Action? streamableHttp = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.Config5.g.cs b/src/libs/Letta/Generated/Letta.Models.Config5.g.cs index 6c8b6cc6..7576c890 100644 --- a/src/libs/Letta/Generated/Letta.Models.Config5.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.Config5.g.cs @@ -26,6 +26,19 @@ namespace Letta #endif public bool IsSlackChannelReader => SlackChannelReader != null; + /// + /// + /// + public bool TryPickSlackChannelReader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesCreatePipelineResponsePipelineConfigVariant1? value) + { + value = SlackChannelReader; + return IsSlackChannelReader; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomWebhook))] #endif public bool IsCustomWebhook => CustomWebhook != null; + + /// + /// + /// + public bool TryPickCustomWebhook( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesCreatePipelineResponsePipelineConfigVariant2? value) + { + value = CustomWebhook; + return IsCustomWebhook; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? slackChannelReader = null, - global::System.Func? customWebhook = null, + global::System.Func? slackChannelReader = null, + global::System.Func? customWebhook = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? slackChannelReader = null, - global::System.Action? customWebhook = null, + global::System.Action? slackChannelReader = null, + + global::System.Action? customWebhook = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSlackChannelReader) + { + slackChannelReader?.Invoke(SlackChannelReader!); + } + else if (IsCustomWebhook) + { + customWebhook?.Invoke(CustomWebhook!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? slackChannelReader = null, + global::System.Action? customWebhook = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.Config6.g.cs b/src/libs/Letta/Generated/Letta.Models.Config6.g.cs index 3c253339..e56962aa 100644 --- a/src/libs/Letta/Generated/Letta.Models.Config6.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.Config6.g.cs @@ -26,6 +26,19 @@ namespace Letta #endif public bool IsSlackChannelReader => SlackChannelReader != null; + /// + /// + /// + public bool TryPickSlackChannelReader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesListPipelinesResponsePipelineConfigVariant1? value) + { + value = SlackChannelReader; + return IsSlackChannelReader; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomWebhook))] #endif public bool IsCustomWebhook => CustomWebhook != null; + + /// + /// + /// + public bool TryPickCustomWebhook( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesListPipelinesResponsePipelineConfigVariant2? value) + { + value = CustomWebhook; + return IsCustomWebhook; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? slackChannelReader = null, - global::System.Func? customWebhook = null, + global::System.Func? slackChannelReader = null, + global::System.Func? customWebhook = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? slackChannelReader = null, - global::System.Action? customWebhook = null, + global::System.Action? slackChannelReader = null, + + global::System.Action? customWebhook = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSlackChannelReader) + { + slackChannelReader?.Invoke(SlackChannelReader!); + } + else if (IsCustomWebhook) + { + customWebhook?.Invoke(CustomWebhook!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? slackChannelReader = null, + global::System.Action? customWebhook = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.Config7.g.cs b/src/libs/Letta/Generated/Letta.Models.Config7.g.cs index a9711e46..08609d7a 100644 --- a/src/libs/Letta/Generated/Letta.Models.Config7.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.Config7.g.cs @@ -26,6 +26,19 @@ namespace Letta #endif public bool IsSlackChannelReader => SlackChannelReader != null; + /// + /// + /// + public bool TryPickSlackChannelReader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesGetPipelineResponsePipelineConfigVariant1? value) + { + value = SlackChannelReader; + return IsSlackChannelReader; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomWebhook))] #endif public bool IsCustomWebhook => CustomWebhook != null; + + /// + /// + /// + public bool TryPickCustomWebhook( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesGetPipelineResponsePipelineConfigVariant2? value) + { + value = CustomWebhook; + return IsCustomWebhook; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? slackChannelReader = null, - global::System.Func? customWebhook = null, + global::System.Func? slackChannelReader = null, + global::System.Func? customWebhook = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? slackChannelReader = null, - global::System.Action? customWebhook = null, + global::System.Action? slackChannelReader = null, + + global::System.Action? customWebhook = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSlackChannelReader) + { + slackChannelReader?.Invoke(SlackChannelReader!); + } + else if (IsCustomWebhook) + { + customWebhook?.Invoke(CustomWebhook!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? slackChannelReader = null, + global::System.Action? customWebhook = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.Config8.g.cs b/src/libs/Letta/Generated/Letta.Models.Config8.g.cs index c00a75d8..b5c68fd7 100644 --- a/src/libs/Letta/Generated/Letta.Models.Config8.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.Config8.g.cs @@ -26,6 +26,19 @@ namespace Letta #endif public bool IsSlackChannelReader => SlackChannelReader != null; + /// + /// + /// + public bool TryPickSlackChannelReader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesUpdatePipelineResponsePipelineConfigVariant1? value) + { + value = SlackChannelReader; + return IsSlackChannelReader; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomWebhook))] #endif public bool IsCustomWebhook => CustomWebhook != null; + + /// + /// + /// + public bool TryPickCustomWebhook( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesUpdatePipelineResponsePipelineConfigVariant2? value) + { + value = CustomWebhook; + return IsCustomWebhook; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? slackChannelReader = null, - global::System.Func? customWebhook = null, + global::System.Func? slackChannelReader = null, + global::System.Func? customWebhook = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? slackChannelReader = null, - global::System.Action? customWebhook = null, + global::System.Action? slackChannelReader = null, + + global::System.Action? customWebhook = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSlackChannelReader) + { + slackChannelReader?.Invoke(SlackChannelReader!); + } + else if (IsCustomWebhook) + { + customWebhook?.Invoke(CustomWebhook!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? slackChannelReader = null, + global::System.Action? customWebhook = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.Config9.g.cs b/src/libs/Letta/Generated/Letta.Models.Config9.g.cs index d1b6691f..24486a08 100644 --- a/src/libs/Letta/Generated/Letta.Models.Config9.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.Config9.g.cs @@ -26,6 +26,19 @@ namespace Letta #endif public bool IsSlackChannelReader => SlackChannelReader != null; + /// + /// + /// + public bool TryPickSlackChannelReader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesUpdatePipelineProducerConfigResponsePipelineConfigVariant1? value) + { + value = SlackChannelReader; + return IsSlackChannelReader; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomWebhook))] #endif public bool IsCustomWebhook => CustomWebhook != null; + + /// + /// + /// + public bool TryPickCustomWebhook( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesUpdatePipelineProducerConfigResponsePipelineConfigVariant2? value) + { + value = CustomWebhook; + return IsCustomWebhook; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? slackChannelReader = null, - global::System.Func? customWebhook = null, + global::System.Func? slackChannelReader = null, + global::System.Func? customWebhook = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? slackChannelReader = null, - global::System.Action? customWebhook = null, + global::System.Action? slackChannelReader = null, + + global::System.Action? customWebhook = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSlackChannelReader) + { + slackChannelReader?.Invoke(SlackChannelReader!); + } + else if (IsCustomWebhook) + { + customWebhook?.Invoke(CustomWebhook!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? slackChannelReader = null, + global::System.Action? customWebhook = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ContentVariant1Item.g.cs b/src/libs/Letta/Generated/Letta.Models.ContentVariant1Item.g.cs index d1d4c536..30176bac 100644 --- a/src/libs/Letta/Generated/Letta.Models.ContentVariant1Item.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ContentVariant1Item.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsImage => Image != null; + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ImageContent? value) + { + value = Image; + return IsImage; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsToolCall => ToolCall != null; + /// + /// + /// + public bool TryPickToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallContent? value) + { + value = ToolCall; + return IsToolCall; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsToolReturn => ToolReturn != null; + /// + /// + /// + public bool TryPickToolReturn( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnContent? value) + { + value = ToolReturn; + return IsToolReturn; + } + /// /// Sent via the Anthropic Messages API /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsOmittedReasoning1 => OmittedReasoning1 != null; + /// + /// + /// + public bool TryPickOmittedReasoning1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningContent? value) + { + value = OmittedReasoning1; + return IsOmittedReasoning1; + } + /// /// Sent via the Anthropic Messages API /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRedactedReasoning => RedactedReasoning != null; + /// + /// + /// + public bool TryPickRedactedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RedactedReasoningContent? value) + { + value = RedactedReasoning; + return IsRedactedReasoning; + } + /// /// A placeholder for reasoning content we know is present, but isn't returned by the provider (e.g. OpenAI GPT-5 on ChatCompletions) /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsOmittedReasoning2 => OmittedReasoning2 != null; + /// + /// + /// + public bool TryPickOmittedReasoning2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OmittedReasoningContent? value) + { + value = OmittedReasoning2; + return IsOmittedReasoning2; + } + /// /// The style of reasoning content returned by the OpenAI Responses API /// @@ -149,6 +240,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SummarizedReasoning))] #endif public bool IsSummarizedReasoning => SummarizedReasoning != null; + + /// + /// + /// + public bool TryPickSummarizedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SummarizedReasoningContent? value) + { + value = SummarizedReasoning; + return IsSummarizedReasoning; + } /// /// /// @@ -360,14 +464,14 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, - global::System.Func? toolCall = null, - global::System.Func? toolReturn = null, - global::System.Func? omittedReasoning1 = null, - global::System.Func? redactedReasoning = null, - global::System.Func? omittedReasoning2 = null, - global::System.Func? summarizedReasoning = null, + global::System.Func? text = null, + global::System.Func? image = null, + global::System.Func? toolCall = null, + global::System.Func? toolReturn = null, + global::System.Func? omittedReasoning1 = null, + global::System.Func? redactedReasoning = null, + global::System.Func? omittedReasoning2 = null, + global::System.Func? summarizedReasoning = null, bool validate = true) { if (validate) @@ -415,14 +519,74 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? image = null, - global::System.Action? toolCall = null, - global::System.Action? toolReturn = null, - global::System.Action? omittedReasoning1 = null, - global::System.Action? redactedReasoning = null, - global::System.Action? omittedReasoning2 = null, - global::System.Action? summarizedReasoning = null, + global::System.Action? text = null, + + global::System.Action? image = null, + + global::System.Action? toolCall = null, + + global::System.Action? toolReturn = null, + + global::System.Action? omittedReasoning1 = null, + + global::System.Action? redactedReasoning = null, + + global::System.Action? omittedReasoning2 = null, + + global::System.Action? summarizedReasoning = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + else if (IsToolCall) + { + toolCall?.Invoke(ToolCall!); + } + else if (IsToolReturn) + { + toolReturn?.Invoke(ToolReturn!); + } + else if (IsOmittedReasoning1) + { + omittedReasoning1?.Invoke(OmittedReasoning1!); + } + else if (IsRedactedReasoning) + { + redactedReasoning?.Invoke(RedactedReasoning!); + } + else if (IsOmittedReasoning2) + { + omittedReasoning2?.Invoke(OmittedReasoning2!); + } + else if (IsSummarizedReasoning) + { + summarizedReasoning?.Invoke(SummarizedReasoning!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? image = null, + global::System.Action? toolCall = null, + global::System.Action? toolReturn = null, + global::System.Action? omittedReasoning1 = null, + global::System.Action? redactedReasoning = null, + global::System.Action? omittedReasoning2 = null, + global::System.Action? summarizedReasoning = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.DataItem.g.cs b/src/libs/Letta/Generated/Letta.Models.DataItem.g.cs index ac0281a0..0572d3af 100644 --- a/src/libs/Letta/Generated/Letta.Models.DataItem.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.DataItem.g.cs @@ -25,6 +25,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Agent))] #endif public bool IsAgent => Agent != null; + + /// + /// + /// + public bool TryPickAgent( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ClientSideAccessTokensCreateClientSideAccessTokenResponsePolicyDataItemVariant1? value) + { + value = Agent; + return IsAgent; + } /// /// /// @@ -69,7 +82,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? agent = null, + global::System.Func? agent = null, bool validate = true) { if (validate) @@ -89,7 +102,25 @@ public bool Validate() /// /// public void Match( - global::System.Action? agent = null, + global::System.Action? agent = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgent) + { + agent?.Invoke(Agent!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? agent = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.DataItem2.g.cs b/src/libs/Letta/Generated/Letta.Models.DataItem2.g.cs index fd2a0910..b38f481c 100644 --- a/src/libs/Letta/Generated/Letta.Models.DataItem2.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.DataItem2.g.cs @@ -25,6 +25,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Agent))] #endif public bool IsAgent => Agent != null; + + /// + /// + /// + public bool TryPickAgent( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ClientSideAccessTokensListClientSideAccessTokensResponseTokenPolicyDataItemVariant1? value) + { + value = Agent; + return IsAgent; + } /// /// /// @@ -69,7 +82,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? agent = null, + global::System.Func? agent = null, bool validate = true) { if (validate) @@ -89,7 +102,25 @@ public bool Validate() /// /// public void Match( - global::System.Action? agent = null, + global::System.Action? agent = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgent) + { + agent?.Invoke(Agent!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? agent = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.EventsItem.g.cs b/src/libs/Letta/Generated/Letta.Models.EventsItem.g.cs index 057665eb..55e240e0 100644 --- a/src/libs/Letta/Generated/Letta.Models.EventsItem.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.EventsItem.g.cs @@ -26,6 +26,19 @@ namespace Letta #endif public bool IsSessionStart => SessionStart != null; + /// + /// + /// + public bool TryPickSessionStart( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.MetadataSendTelemetryRequestEventVariant1? value) + { + value = SessionStart; + return IsSessionStart; + } + /// /// /// @@ -43,6 +56,19 @@ namespace Letta #endif public bool IsSessionEnd => SessionEnd != null; + /// + /// + /// + public bool TryPickSessionEnd( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.MetadataSendTelemetryRequestEventVariant2? value) + { + value = SessionEnd; + return IsSessionEnd; + } + /// /// /// @@ -60,6 +86,19 @@ namespace Letta #endif public bool IsToolUsage => ToolUsage != null; + /// + /// + /// + public bool TryPickToolUsage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.MetadataSendTelemetryRequestEventVariant3? value) + { + value = ToolUsage; + return IsToolUsage; + } + /// /// /// @@ -77,6 +116,19 @@ namespace Letta #endif public bool IsError => Error != null; + /// + /// + /// + public bool TryPickError( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.MetadataSendTelemetryRequestEventVariant4? value) + { + value = Error; + return IsError; + } + /// /// /// @@ -93,6 +145,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UserInput))] #endif public bool IsUserInput => UserInput != null; + + /// + /// + /// + public bool TryPickUserInput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.MetadataSendTelemetryRequestEventVariant5? value) + { + value = UserInput; + return IsUserInput; + } /// /// /// @@ -235,11 +300,11 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? sessionStart = null, - global::System.Func? sessionEnd = null, - global::System.Func? toolUsage = null, - global::System.Func? error = null, - global::System.Func? userInput = null, + global::System.Func? sessionStart = null, + global::System.Func? sessionEnd = null, + global::System.Func? toolUsage = null, + global::System.Func? error = null, + global::System.Func? userInput = null, bool validate = true) { if (validate) @@ -275,11 +340,53 @@ public bool Validate() /// /// public void Match( - global::System.Action? sessionStart = null, - global::System.Action? sessionEnd = null, - global::System.Action? toolUsage = null, - global::System.Action? error = null, - global::System.Action? userInput = null, + global::System.Action? sessionStart = null, + + global::System.Action? sessionEnd = null, + + global::System.Action? toolUsage = null, + + global::System.Action? error = null, + + global::System.Action? userInput = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSessionStart) + { + sessionStart?.Invoke(SessionStart!); + } + else if (IsSessionEnd) + { + sessionEnd?.Invoke(SessionEnd!); + } + else if (IsToolUsage) + { + toolUsage?.Invoke(ToolUsage!); + } + else if (IsError) + { + error?.Invoke(Error!); + } + else if (IsUserInput) + { + userInput?.Invoke(UserInput!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? sessionStart = null, + global::System.Action? sessionEnd = null, + global::System.Action? toolUsage = null, + global::System.Action? error = null, + global::System.Action? userInput = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.FuncResponseVariant2Item.g.cs b/src/libs/Letta/Generated/Letta.Models.FuncResponseVariant2Item.g.cs index e5c87c20..d01f3e7a 100644 --- a/src/libs/Letta/Generated/Letta.Models.FuncResponseVariant2Item.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.FuncResponseVariant2Item.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -47,6 +60,19 @@ namespace Letta [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::Letta.ImageContent? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, + global::System.Func? text = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? image = null, + global::System.Action? text = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.FuncResponseVariant2Item2.g.cs b/src/libs/Letta/Generated/Letta.Models.FuncResponseVariant2Item2.g.cs index 6ebdab15..f0c8780e 100644 --- a/src/libs/Letta/Generated/Letta.Models.FuncResponseVariant2Item2.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.FuncResponseVariant2Item2.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -47,6 +60,19 @@ namespace Letta [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::Letta.ImageContent? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, + global::System.Func? text = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? image = null, + global::System.Action? text = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.InputVariant2Item.g.cs b/src/libs/Letta/Generated/Letta.Models.InputVariant2Item.g.cs index 42428042..3f2bf02a 100644 --- a/src/libs/Letta/Generated/Letta.Models.InputVariant2Item.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.InputVariant2Item.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsImage => Image != null; + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ImageContent? value) + { + value = Image; + return IsImage; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsToolCall => ToolCall != null; + /// + /// + /// + public bool TryPickToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallContent? value) + { + value = ToolCall; + return IsToolCall; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsToolReturn => ToolReturn != null; + /// + /// + /// + public bool TryPickToolReturn( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnContent? value) + { + value = ToolReturn; + return IsToolReturn; + } + /// /// Sent via the Anthropic Messages API /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsOmittedReasoning1 => OmittedReasoning1 != null; + /// + /// + /// + public bool TryPickOmittedReasoning1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningContent? value) + { + value = OmittedReasoning1; + return IsOmittedReasoning1; + } + /// /// Sent via the Anthropic Messages API /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRedactedReasoning => RedactedReasoning != null; + /// + /// + /// + public bool TryPickRedactedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RedactedReasoningContent? value) + { + value = RedactedReasoning; + return IsRedactedReasoning; + } + /// /// A placeholder for reasoning content we know is present, but isn't returned by the provider (e.g. OpenAI GPT-5 on ChatCompletions) /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsOmittedReasoning2 => OmittedReasoning2 != null; + /// + /// + /// + public bool TryPickOmittedReasoning2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OmittedReasoningContent? value) + { + value = OmittedReasoning2; + return IsOmittedReasoning2; + } + /// /// The style of reasoning content returned by the OpenAI Responses API /// @@ -149,6 +240,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SummarizedReasoning))] #endif public bool IsSummarizedReasoning => SummarizedReasoning != null; + + /// + /// + /// + public bool TryPickSummarizedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SummarizedReasoningContent? value) + { + value = SummarizedReasoning; + return IsSummarizedReasoning; + } /// /// /// @@ -360,14 +464,14 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, - global::System.Func? toolCall = null, - global::System.Func? toolReturn = null, - global::System.Func? omittedReasoning1 = null, - global::System.Func? redactedReasoning = null, - global::System.Func? omittedReasoning2 = null, - global::System.Func? summarizedReasoning = null, + global::System.Func? text = null, + global::System.Func? image = null, + global::System.Func? toolCall = null, + global::System.Func? toolReturn = null, + global::System.Func? omittedReasoning1 = null, + global::System.Func? redactedReasoning = null, + global::System.Func? omittedReasoning2 = null, + global::System.Func? summarizedReasoning = null, bool validate = true) { if (validate) @@ -415,14 +519,74 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? image = null, - global::System.Action? toolCall = null, - global::System.Action? toolReturn = null, - global::System.Action? omittedReasoning1 = null, - global::System.Action? redactedReasoning = null, - global::System.Action? omittedReasoning2 = null, - global::System.Action? summarizedReasoning = null, + global::System.Action? text = null, + + global::System.Action? image = null, + + global::System.Action? toolCall = null, + + global::System.Action? toolReturn = null, + + global::System.Action? omittedReasoning1 = null, + + global::System.Action? redactedReasoning = null, + + global::System.Action? omittedReasoning2 = null, + + global::System.Action? summarizedReasoning = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + else if (IsToolCall) + { + toolCall?.Invoke(ToolCall!); + } + else if (IsToolReturn) + { + toolReturn?.Invoke(ToolReturn!); + } + else if (IsOmittedReasoning1) + { + omittedReasoning1?.Invoke(OmittedReasoning1!); + } + else if (IsRedactedReasoning) + { + redactedReasoning?.Invoke(RedactedReasoning!); + } + else if (IsOmittedReasoning2) + { + omittedReasoning2?.Invoke(OmittedReasoning2!); + } + else if (IsSummarizedReasoning) + { + summarizedReasoning?.Invoke(SummarizedReasoning!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? image = null, + global::System.Action? toolCall = null, + global::System.Action? toolReturn = null, + global::System.Action? omittedReasoning1 = null, + global::System.Action? redactedReasoning = null, + global::System.Action? omittedReasoning2 = null, + global::System.Action? summarizedReasoning = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.InputVariant2Item2.g.cs b/src/libs/Letta/Generated/Letta.Models.InputVariant2Item2.g.cs index adf0ce14..5061682a 100644 --- a/src/libs/Letta/Generated/Letta.Models.InputVariant2Item2.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.InputVariant2Item2.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsImage => Image != null; + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ImageContent? value) + { + value = Image; + return IsImage; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsToolCall => ToolCall != null; + /// + /// + /// + public bool TryPickToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallContent? value) + { + value = ToolCall; + return IsToolCall; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsToolReturn => ToolReturn != null; + /// + /// + /// + public bool TryPickToolReturn( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnContent? value) + { + value = ToolReturn; + return IsToolReturn; + } + /// /// Sent via the Anthropic Messages API /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsOmittedReasoning1 => OmittedReasoning1 != null; + /// + /// + /// + public bool TryPickOmittedReasoning1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningContent? value) + { + value = OmittedReasoning1; + return IsOmittedReasoning1; + } + /// /// Sent via the Anthropic Messages API /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRedactedReasoning => RedactedReasoning != null; + /// + /// + /// + public bool TryPickRedactedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RedactedReasoningContent? value) + { + value = RedactedReasoning; + return IsRedactedReasoning; + } + /// /// A placeholder for reasoning content we know is present, but isn't returned by the provider (e.g. OpenAI GPT-5 on ChatCompletions) /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsOmittedReasoning2 => OmittedReasoning2 != null; + /// + /// + /// + public bool TryPickOmittedReasoning2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OmittedReasoningContent? value) + { + value = OmittedReasoning2; + return IsOmittedReasoning2; + } + /// /// The style of reasoning content returned by the OpenAI Responses API /// @@ -149,6 +240,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SummarizedReasoning))] #endif public bool IsSummarizedReasoning => SummarizedReasoning != null; + + /// + /// + /// + public bool TryPickSummarizedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SummarizedReasoningContent? value) + { + value = SummarizedReasoning; + return IsSummarizedReasoning; + } /// /// /// @@ -360,14 +464,14 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, - global::System.Func? toolCall = null, - global::System.Func? toolReturn = null, - global::System.Func? omittedReasoning1 = null, - global::System.Func? redactedReasoning = null, - global::System.Func? omittedReasoning2 = null, - global::System.Func? summarizedReasoning = null, + global::System.Func? text = null, + global::System.Func? image = null, + global::System.Func? toolCall = null, + global::System.Func? toolReturn = null, + global::System.Func? omittedReasoning1 = null, + global::System.Func? redactedReasoning = null, + global::System.Func? omittedReasoning2 = null, + global::System.Func? summarizedReasoning = null, bool validate = true) { if (validate) @@ -415,14 +519,74 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? image = null, - global::System.Action? toolCall = null, - global::System.Action? toolReturn = null, - global::System.Action? omittedReasoning1 = null, - global::System.Action? redactedReasoning = null, - global::System.Action? omittedReasoning2 = null, - global::System.Action? summarizedReasoning = null, + global::System.Action? text = null, + + global::System.Action? image = null, + + global::System.Action? toolCall = null, + + global::System.Action? toolReturn = null, + + global::System.Action? omittedReasoning1 = null, + + global::System.Action? redactedReasoning = null, + + global::System.Action? omittedReasoning2 = null, + + global::System.Action? summarizedReasoning = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + else if (IsToolCall) + { + toolCall?.Invoke(ToolCall!); + } + else if (IsToolReturn) + { + toolReturn?.Invoke(ToolReturn!); + } + else if (IsOmittedReasoning1) + { + omittedReasoning1?.Invoke(OmittedReasoning1!); + } + else if (IsRedactedReasoning) + { + redactedReasoning?.Invoke(RedactedReasoning!); + } + else if (IsOmittedReasoning2) + { + omittedReasoning2?.Invoke(OmittedReasoning2!); + } + else if (IsSummarizedReasoning) + { + summarizedReasoning?.Invoke(SummarizedReasoning!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? image = null, + global::System.Action? toolCall = null, + global::System.Action? toolReturn = null, + global::System.Action? omittedReasoning1 = null, + global::System.Action? redactedReasoning = null, + global::System.Action? omittedReasoning2 = null, + global::System.Action? summarizedReasoning = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.InputVariant2Item3.g.cs b/src/libs/Letta/Generated/Letta.Models.InputVariant2Item3.g.cs index e2eac75b..8e7c70e2 100644 --- a/src/libs/Letta/Generated/Letta.Models.InputVariant2Item3.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.InputVariant2Item3.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsImage => Image != null; + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ImageContent? value) + { + value = Image; + return IsImage; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsToolCall => ToolCall != null; + /// + /// + /// + public bool TryPickToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallContent? value) + { + value = ToolCall; + return IsToolCall; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsToolReturn => ToolReturn != null; + /// + /// + /// + public bool TryPickToolReturn( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnContent? value) + { + value = ToolReturn; + return IsToolReturn; + } + /// /// Sent via the Anthropic Messages API /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsOmittedReasoning1 => OmittedReasoning1 != null; + /// + /// + /// + public bool TryPickOmittedReasoning1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningContent? value) + { + value = OmittedReasoning1; + return IsOmittedReasoning1; + } + /// /// Sent via the Anthropic Messages API /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRedactedReasoning => RedactedReasoning != null; + /// + /// + /// + public bool TryPickRedactedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RedactedReasoningContent? value) + { + value = RedactedReasoning; + return IsRedactedReasoning; + } + /// /// A placeholder for reasoning content we know is present, but isn't returned by the provider (e.g. OpenAI GPT-5 on ChatCompletions) /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsOmittedReasoning2 => OmittedReasoning2 != null; + /// + /// + /// + public bool TryPickOmittedReasoning2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OmittedReasoningContent? value) + { + value = OmittedReasoning2; + return IsOmittedReasoning2; + } + /// /// The style of reasoning content returned by the OpenAI Responses API /// @@ -149,6 +240,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SummarizedReasoning))] #endif public bool IsSummarizedReasoning => SummarizedReasoning != null; + + /// + /// + /// + public bool TryPickSummarizedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SummarizedReasoningContent? value) + { + value = SummarizedReasoning; + return IsSummarizedReasoning; + } /// /// /// @@ -360,14 +464,14 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, - global::System.Func? toolCall = null, - global::System.Func? toolReturn = null, - global::System.Func? omittedReasoning1 = null, - global::System.Func? redactedReasoning = null, - global::System.Func? omittedReasoning2 = null, - global::System.Func? summarizedReasoning = null, + global::System.Func? text = null, + global::System.Func? image = null, + global::System.Func? toolCall = null, + global::System.Func? toolReturn = null, + global::System.Func? omittedReasoning1 = null, + global::System.Func? redactedReasoning = null, + global::System.Func? omittedReasoning2 = null, + global::System.Func? summarizedReasoning = null, bool validate = true) { if (validate) @@ -415,14 +519,74 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? image = null, - global::System.Action? toolCall = null, - global::System.Action? toolReturn = null, - global::System.Action? omittedReasoning1 = null, - global::System.Action? redactedReasoning = null, - global::System.Action? omittedReasoning2 = null, - global::System.Action? summarizedReasoning = null, + global::System.Action? text = null, + + global::System.Action? image = null, + + global::System.Action? toolCall = null, + + global::System.Action? toolReturn = null, + + global::System.Action? omittedReasoning1 = null, + + global::System.Action? redactedReasoning = null, + + global::System.Action? omittedReasoning2 = null, + + global::System.Action? summarizedReasoning = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + else if (IsToolCall) + { + toolCall?.Invoke(ToolCall!); + } + else if (IsToolReturn) + { + toolReturn?.Invoke(ToolReturn!); + } + else if (IsOmittedReasoning1) + { + omittedReasoning1?.Invoke(OmittedReasoning1!); + } + else if (IsRedactedReasoning) + { + redactedReasoning?.Invoke(RedactedReasoning!); + } + else if (IsOmittedReasoning2) + { + omittedReasoning2?.Invoke(OmittedReasoning2!); + } + else if (IsSummarizedReasoning) + { + summarizedReasoning?.Invoke(SummarizedReasoning!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? image = null, + global::System.Action? toolCall = null, + global::System.Action? toolReturn = null, + global::System.Action? omittedReasoning1 = null, + global::System.Action? redactedReasoning = null, + global::System.Action? omittedReasoning2 = null, + global::System.Action? summarizedReasoning = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.InputVariant2Item4.g.cs b/src/libs/Letta/Generated/Letta.Models.InputVariant2Item4.g.cs index df268848..e5427baf 100644 --- a/src/libs/Letta/Generated/Letta.Models.InputVariant2Item4.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.InputVariant2Item4.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsImage => Image != null; + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ImageContent? value) + { + value = Image; + return IsImage; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsToolCall => ToolCall != null; + /// + /// + /// + public bool TryPickToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallContent? value) + { + value = ToolCall; + return IsToolCall; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsToolReturn => ToolReturn != null; + /// + /// + /// + public bool TryPickToolReturn( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnContent? value) + { + value = ToolReturn; + return IsToolReturn; + } + /// /// Sent via the Anthropic Messages API /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsOmittedReasoning1 => OmittedReasoning1 != null; + /// + /// + /// + public bool TryPickOmittedReasoning1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningContent? value) + { + value = OmittedReasoning1; + return IsOmittedReasoning1; + } + /// /// Sent via the Anthropic Messages API /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRedactedReasoning => RedactedReasoning != null; + /// + /// + /// + public bool TryPickRedactedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RedactedReasoningContent? value) + { + value = RedactedReasoning; + return IsRedactedReasoning; + } + /// /// A placeholder for reasoning content we know is present, but isn't returned by the provider (e.g. OpenAI GPT-5 on ChatCompletions) /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsOmittedReasoning2 => OmittedReasoning2 != null; + /// + /// + /// + public bool TryPickOmittedReasoning2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OmittedReasoningContent? value) + { + value = OmittedReasoning2; + return IsOmittedReasoning2; + } + /// /// The style of reasoning content returned by the OpenAI Responses API /// @@ -149,6 +240,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SummarizedReasoning))] #endif public bool IsSummarizedReasoning => SummarizedReasoning != null; + + /// + /// + /// + public bool TryPickSummarizedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SummarizedReasoningContent? value) + { + value = SummarizedReasoning; + return IsSummarizedReasoning; + } /// /// /// @@ -360,14 +464,14 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, - global::System.Func? toolCall = null, - global::System.Func? toolReturn = null, - global::System.Func? omittedReasoning1 = null, - global::System.Func? redactedReasoning = null, - global::System.Func? omittedReasoning2 = null, - global::System.Func? summarizedReasoning = null, + global::System.Func? text = null, + global::System.Func? image = null, + global::System.Func? toolCall = null, + global::System.Func? toolReturn = null, + global::System.Func? omittedReasoning1 = null, + global::System.Func? redactedReasoning = null, + global::System.Func? omittedReasoning2 = null, + global::System.Func? summarizedReasoning = null, bool validate = true) { if (validate) @@ -415,14 +519,74 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? image = null, - global::System.Action? toolCall = null, - global::System.Action? toolReturn = null, - global::System.Action? omittedReasoning1 = null, - global::System.Action? redactedReasoning = null, - global::System.Action? omittedReasoning2 = null, - global::System.Action? summarizedReasoning = null, + global::System.Action? text = null, + + global::System.Action? image = null, + + global::System.Action? toolCall = null, + + global::System.Action? toolReturn = null, + + global::System.Action? omittedReasoning1 = null, + + global::System.Action? redactedReasoning = null, + + global::System.Action? omittedReasoning2 = null, + + global::System.Action? summarizedReasoning = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + else if (IsToolCall) + { + toolCall?.Invoke(ToolCall!); + } + else if (IsToolReturn) + { + toolReturn?.Invoke(ToolReturn!); + } + else if (IsOmittedReasoning1) + { + omittedReasoning1?.Invoke(OmittedReasoning1!); + } + else if (IsRedactedReasoning) + { + redactedReasoning?.Invoke(RedactedReasoning!); + } + else if (IsOmittedReasoning2) + { + omittedReasoning2?.Invoke(OmittedReasoning2!); + } + else if (IsSummarizedReasoning) + { + summarizedReasoning?.Invoke(SummarizedReasoning!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? image = null, + global::System.Action? toolCall = null, + global::System.Action? toolReturn = null, + global::System.Action? omittedReasoning1 = null, + global::System.Action? redactedReasoning = null, + global::System.Action? omittedReasoning2 = null, + global::System.Action? summarizedReasoning = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.InputVariant2Item5.g.cs b/src/libs/Letta/Generated/Letta.Models.InputVariant2Item5.g.cs index 9fd528c6..d9c35bb0 100644 --- a/src/libs/Letta/Generated/Letta.Models.InputVariant2Item5.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.InputVariant2Item5.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsImage => Image != null; + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ImageContent? value) + { + value = Image; + return IsImage; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsToolCall => ToolCall != null; + /// + /// + /// + public bool TryPickToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallContent? value) + { + value = ToolCall; + return IsToolCall; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsToolReturn => ToolReturn != null; + /// + /// + /// + public bool TryPickToolReturn( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnContent? value) + { + value = ToolReturn; + return IsToolReturn; + } + /// /// Sent via the Anthropic Messages API /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsOmittedReasoning1 => OmittedReasoning1 != null; + /// + /// + /// + public bool TryPickOmittedReasoning1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningContent? value) + { + value = OmittedReasoning1; + return IsOmittedReasoning1; + } + /// /// Sent via the Anthropic Messages API /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRedactedReasoning => RedactedReasoning != null; + /// + /// + /// + public bool TryPickRedactedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RedactedReasoningContent? value) + { + value = RedactedReasoning; + return IsRedactedReasoning; + } + /// /// A placeholder for reasoning content we know is present, but isn't returned by the provider (e.g. OpenAI GPT-5 on ChatCompletions) /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsOmittedReasoning2 => OmittedReasoning2 != null; + /// + /// + /// + public bool TryPickOmittedReasoning2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OmittedReasoningContent? value) + { + value = OmittedReasoning2; + return IsOmittedReasoning2; + } + /// /// The style of reasoning content returned by the OpenAI Responses API /// @@ -149,6 +240,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SummarizedReasoning))] #endif public bool IsSummarizedReasoning => SummarizedReasoning != null; + + /// + /// + /// + public bool TryPickSummarizedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SummarizedReasoningContent? value) + { + value = SummarizedReasoning; + return IsSummarizedReasoning; + } /// /// /// @@ -360,14 +464,14 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, - global::System.Func? toolCall = null, - global::System.Func? toolReturn = null, - global::System.Func? omittedReasoning1 = null, - global::System.Func? redactedReasoning = null, - global::System.Func? omittedReasoning2 = null, - global::System.Func? summarizedReasoning = null, + global::System.Func? text = null, + global::System.Func? image = null, + global::System.Func? toolCall = null, + global::System.Func? toolReturn = null, + global::System.Func? omittedReasoning1 = null, + global::System.Func? redactedReasoning = null, + global::System.Func? omittedReasoning2 = null, + global::System.Func? summarizedReasoning = null, bool validate = true) { if (validate) @@ -415,14 +519,74 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? image = null, - global::System.Action? toolCall = null, - global::System.Action? toolReturn = null, - global::System.Action? omittedReasoning1 = null, - global::System.Action? redactedReasoning = null, - global::System.Action? omittedReasoning2 = null, - global::System.Action? summarizedReasoning = null, + global::System.Action? text = null, + + global::System.Action? image = null, + + global::System.Action? toolCall = null, + + global::System.Action? toolReturn = null, + + global::System.Action? omittedReasoning1 = null, + + global::System.Action? redactedReasoning = null, + + global::System.Action? omittedReasoning2 = null, + + global::System.Action? summarizedReasoning = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + else if (IsToolCall) + { + toolCall?.Invoke(ToolCall!); + } + else if (IsToolReturn) + { + toolReturn?.Invoke(ToolReturn!); + } + else if (IsOmittedReasoning1) + { + omittedReasoning1?.Invoke(OmittedReasoning1!); + } + else if (IsRedactedReasoning) + { + redactedReasoning?.Invoke(RedactedReasoning!); + } + else if (IsOmittedReasoning2) + { + omittedReasoning2?.Invoke(OmittedReasoning2!); + } + else if (IsSummarizedReasoning) + { + summarizedReasoning?.Invoke(SummarizedReasoning!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? image = null, + global::System.Action? toolCall = null, + global::System.Action? toolReturn = null, + global::System.Action? omittedReasoning1 = null, + global::System.Action? redactedReasoning = null, + global::System.Action? omittedReasoning2 = null, + global::System.Action? summarizedReasoning = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.LettaAssistantMessageContentUnion.g.cs b/src/libs/Letta/Generated/Letta.Models.LettaAssistantMessageContentUnion.g.cs index b9308d84..100ee982 100644 --- a/src/libs/Letta/Generated/Letta.Models.LettaAssistantMessageContentUnion.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.LettaAssistantMessageContentUnion.g.cs @@ -30,6 +30,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] #endif public bool IsText => Text != null; + + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } /// /// /// @@ -87,7 +100,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, + global::System.Func? text = null, bool validate = true) { if (validate) @@ -107,7 +120,25 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, + global::System.Action? text = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.LettaMessageContentUnion.g.cs b/src/libs/Letta/Generated/Letta.Models.LettaMessageContentUnion.g.cs index 73b79557..95193e2f 100644 --- a/src/libs/Letta/Generated/Letta.Models.LettaMessageContentUnion.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.LettaMessageContentUnion.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsImage => Image != null; + /// + /// + /// + public bool TryPickImage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ImageContent? value) + { + value = Image; + return IsImage; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsToolCall => ToolCall != null; + /// + /// + /// + public bool TryPickToolCall( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallContent? value) + { + value = ToolCall; + return IsToolCall; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsToolReturn => ToolReturn != null; + /// + /// + /// + public bool TryPickToolReturn( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnContent? value) + { + value = ToolReturn; + return IsToolReturn; + } + /// /// Sent via the Anthropic Messages API /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsReasoning => Reasoning != null; + /// + /// + /// + public bool TryPickReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningContent? value) + { + value = Reasoning; + return IsReasoning; + } + /// /// Sent via the Anthropic Messages API /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRedactedReasoning => RedactedReasoning != null; + /// + /// + /// + public bool TryPickRedactedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RedactedReasoningContent? value) + { + value = RedactedReasoning; + return IsRedactedReasoning; + } + /// /// A placeholder for reasoning content we know is present, but isn't returned by the provider (e.g. OpenAI GPT-5 on ChatCompletions) /// @@ -132,6 +210,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(OmittedReasoning))] #endif public bool IsOmittedReasoning => OmittedReasoning != null; + + /// + /// + /// + public bool TryPickOmittedReasoning( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OmittedReasoningContent? value) + { + value = OmittedReasoning; + return IsOmittedReasoning; + } /// /// /// @@ -321,13 +412,13 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, - global::System.Func? toolCall = null, - global::System.Func? toolReturn = null, - global::System.Func? reasoning = null, - global::System.Func? redactedReasoning = null, - global::System.Func? omittedReasoning = null, + global::System.Func? text = null, + global::System.Func? image = null, + global::System.Func? toolCall = null, + global::System.Func? toolReturn = null, + global::System.Func? reasoning = null, + global::System.Func? redactedReasoning = null, + global::System.Func? omittedReasoning = null, bool validate = true) { if (validate) @@ -371,13 +462,67 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, - global::System.Action? image = null, - global::System.Action? toolCall = null, - global::System.Action? toolReturn = null, - global::System.Action? reasoning = null, - global::System.Action? redactedReasoning = null, - global::System.Action? omittedReasoning = null, + global::System.Action? text = null, + + global::System.Action? image = null, + + global::System.Action? toolCall = null, + + global::System.Action? toolReturn = null, + + global::System.Action? reasoning = null, + + global::System.Action? redactedReasoning = null, + + global::System.Action? omittedReasoning = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + else if (IsToolCall) + { + toolCall?.Invoke(ToolCall!); + } + else if (IsToolReturn) + { + toolReturn?.Invoke(ToolReturn!); + } + else if (IsReasoning) + { + reasoning?.Invoke(Reasoning!); + } + else if (IsRedactedReasoning) + { + redactedReasoning?.Invoke(RedactedReasoning!); + } + else if (IsOmittedReasoning) + { + omittedReasoning?.Invoke(OmittedReasoning!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? image = null, + global::System.Action? toolCall = null, + global::System.Action? toolReturn = null, + global::System.Action? reasoning = null, + global::System.Action? redactedReasoning = null, + global::System.Action? omittedReasoning = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.LettaMessageUnion.g.cs b/src/libs/Letta/Generated/Letta.Models.LettaMessageUnion.g.cs index 2bbc3015..f8aa84bd 100644 --- a/src/libs/Letta/Generated/Letta.Models.LettaMessageUnion.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.LettaMessageUnion.g.cs @@ -36,6 +36,19 @@ namespace Letta #endif public bool IsSystemMessage => SystemMessage != null; + /// + /// + /// + public bool TryPickSystemMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SystemMessage? value) + { + value = SystemMessage; + return IsSystemMessage; + } + /// /// A message sent by the user. Never streamed back on a response, only used for cursor pagination.
/// Args:
@@ -58,6 +71,19 @@ namespace Letta #endif public bool IsUserMessage => UserMessage != null; + /// + /// + /// + public bool TryPickUserMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.UserMessage? value) + { + value = UserMessage; + return IsUserMessage; + } + /// /// Representation of an agent's internal reasoning.
/// Args:
@@ -83,6 +109,19 @@ namespace Letta #endif public bool IsReasoningMessage => ReasoningMessage != null; + /// + /// + /// + public bool TryPickReasoningMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningMessage? value) + { + value = ReasoningMessage; + return IsReasoningMessage; + } + /// /// Representation of an agent's internal reasoning where reasoning content
/// has been hidden from the response.
@@ -108,6 +147,19 @@ namespace Letta #endif public bool IsHiddenReasoningMessage => HiddenReasoningMessage != null; + /// + /// + /// + public bool TryPickHiddenReasoningMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.HiddenReasoningMessage? value) + { + value = HiddenReasoningMessage; + return IsHiddenReasoningMessage; + } + /// /// A message representing a request to call a tool (generated by the LLM to trigger tool execution).
/// Args:
@@ -130,6 +182,19 @@ namespace Letta #endif public bool IsToolCallMessage => ToolCallMessage != null; + /// + /// + /// + public bool TryPickToolCallMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallMessage? value) + { + value = ToolCallMessage; + return IsToolCallMessage; + } + /// /// A message representing the return value of a tool call (generated by Letta executing the requested tool).
/// Args:
@@ -157,6 +222,19 @@ namespace Letta #endif public bool IsToolReturnMessage => ToolReturnMessage != null; + /// + /// + /// + public bool TryPickToolReturnMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnMessage? value) + { + value = ToolReturnMessage; + return IsToolReturnMessage; + } + /// /// A message sent by the LLM in response to user input. Used in the LLM context.
/// Args:
@@ -179,6 +257,19 @@ namespace Letta #endif public bool IsAssistantMessage => AssistantMessage != null; + /// + /// + /// + public bool TryPickAssistantMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AssistantMessage? value) + { + value = AssistantMessage; + return IsAssistantMessage; + } + /// /// A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
/// Args:
@@ -201,6 +292,19 @@ namespace Letta #endif public bool IsApprovalRequestMessage => ApprovalRequestMessage != null; + /// + /// + /// + public bool TryPickApprovalRequestMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalRequestMessage? value) + { + value = ApprovalRequestMessage; + return IsApprovalRequestMessage; + } + /// /// A message representing a response form the user indicating whether a tool has been approved to run.
/// Args:
@@ -225,6 +329,19 @@ namespace Letta #endif public bool IsApprovalResponseMessage => ApprovalResponseMessage != null; + /// + /// + /// + public bool TryPickApprovalResponseMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalResponseMessage? value) + { + value = ApprovalResponseMessage; + return IsApprovalResponseMessage; + } + /// /// A message representing a summary of the conversation. Sent to the LLM as a user or system message depending on the provider. /// @@ -242,6 +359,19 @@ namespace Letta #endif public bool IsSummaryMessage => SummaryMessage != null; + /// + /// + /// + public bool TryPickSummaryMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SummaryMessage? value) + { + value = SummaryMessage; + return IsSummaryMessage; + } + /// /// A message for notifying the developer that an event that has occured (e.g. a compaction). Events are NOT part of the context window. /// @@ -258,6 +388,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(EventMessage))] #endif public bool IsEventMessage => EventMessage != null; + + /// + /// + /// + public bool TryPickEventMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.EventMessage? value) + { + value = EventMessage; + return IsEventMessage; + } /// /// /// @@ -535,17 +678,17 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? systemMessage = null, - global::System.Func? userMessage = null, - global::System.Func? reasoningMessage = null, - global::System.Func? hiddenReasoningMessage = null, - global::System.Func? toolCallMessage = null, - global::System.Func? toolReturnMessage = null, - global::System.Func? assistantMessage = null, - global::System.Func? approvalRequestMessage = null, - global::System.Func? approvalResponseMessage = null, - global::System.Func? summaryMessage = null, - global::System.Func? eventMessage = null, + global::System.Func? systemMessage = null, + global::System.Func? userMessage = null, + global::System.Func? reasoningMessage = null, + global::System.Func? hiddenReasoningMessage = null, + global::System.Func? toolCallMessage = null, + global::System.Func? toolReturnMessage = null, + global::System.Func? assistantMessage = null, + global::System.Func? approvalRequestMessage = null, + global::System.Func? approvalResponseMessage = null, + global::System.Func? summaryMessage = null, + global::System.Func? eventMessage = null, bool validate = true) { if (validate) @@ -605,17 +748,95 @@ public bool Validate() /// ///
public void Match( - global::System.Action? systemMessage = null, - global::System.Action? userMessage = null, - global::System.Action? reasoningMessage = null, - global::System.Action? hiddenReasoningMessage = null, - global::System.Action? toolCallMessage = null, - global::System.Action? toolReturnMessage = null, - global::System.Action? assistantMessage = null, - global::System.Action? approvalRequestMessage = null, - global::System.Action? approvalResponseMessage = null, - global::System.Action? summaryMessage = null, - global::System.Action? eventMessage = null, + global::System.Action? systemMessage = null, + + global::System.Action? userMessage = null, + + global::System.Action? reasoningMessage = null, + + global::System.Action? hiddenReasoningMessage = null, + + global::System.Action? toolCallMessage = null, + + global::System.Action? toolReturnMessage = null, + + global::System.Action? assistantMessage = null, + + global::System.Action? approvalRequestMessage = null, + + global::System.Action? approvalResponseMessage = null, + + global::System.Action? summaryMessage = null, + + global::System.Action? eventMessage = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSystemMessage) + { + systemMessage?.Invoke(SystemMessage!); + } + else if (IsUserMessage) + { + userMessage?.Invoke(UserMessage!); + } + else if (IsReasoningMessage) + { + reasoningMessage?.Invoke(ReasoningMessage!); + } + else if (IsHiddenReasoningMessage) + { + hiddenReasoningMessage?.Invoke(HiddenReasoningMessage!); + } + else if (IsToolCallMessage) + { + toolCallMessage?.Invoke(ToolCallMessage!); + } + else if (IsToolReturnMessage) + { + toolReturnMessage?.Invoke(ToolReturnMessage!); + } + else if (IsAssistantMessage) + { + assistantMessage?.Invoke(AssistantMessage!); + } + else if (IsApprovalRequestMessage) + { + approvalRequestMessage?.Invoke(ApprovalRequestMessage!); + } + else if (IsApprovalResponseMessage) + { + approvalResponseMessage?.Invoke(ApprovalResponseMessage!); + } + else if (IsSummaryMessage) + { + summaryMessage?.Invoke(SummaryMessage!); + } + else if (IsEventMessage) + { + eventMessage?.Invoke(EventMessage!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? systemMessage = null, + global::System.Action? userMessage = null, + global::System.Action? reasoningMessage = null, + global::System.Action? hiddenReasoningMessage = null, + global::System.Action? toolCallMessage = null, + global::System.Action? toolReturnMessage = null, + global::System.Action? assistantMessage = null, + global::System.Action? approvalRequestMessage = null, + global::System.Action? approvalResponseMessage = null, + global::System.Action? summaryMessage = null, + global::System.Action? eventMessage = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.LettaStreamingResponse.g.cs b/src/libs/Letta/Generated/Letta.Models.LettaStreamingResponse.g.cs index eae58f54..df5d3438 100644 --- a/src/libs/Letta/Generated/Letta.Models.LettaStreamingResponse.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.LettaStreamingResponse.g.cs @@ -37,6 +37,19 @@ namespace Letta #endif public bool IsSystemMessage => SystemMessage != null; + /// + /// + /// + public bool TryPickSystemMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SystemMessage? value) + { + value = SystemMessage; + return IsSystemMessage; + } + /// /// A message sent by the user. Never streamed back on a response, only used for cursor pagination.
/// Args:
@@ -59,6 +72,19 @@ namespace Letta #endif public bool IsUserMessage => UserMessage != null; + /// + /// + /// + public bool TryPickUserMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.UserMessage? value) + { + value = UserMessage; + return IsUserMessage; + } + /// /// Representation of an agent's internal reasoning.
/// Args:
@@ -84,6 +110,19 @@ namespace Letta #endif public bool IsHiddenReasoningMessage1 => HiddenReasoningMessage1 != null; + /// + /// + /// + public bool TryPickHiddenReasoningMessage1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningMessage? value) + { + value = HiddenReasoningMessage1; + return IsHiddenReasoningMessage1; + } + /// /// Representation of an agent's internal reasoning where reasoning content
/// has been hidden from the response.
@@ -109,6 +148,19 @@ namespace Letta #endif public bool IsHiddenReasoningMessage2 => HiddenReasoningMessage2 != null; + /// + /// + /// + public bool TryPickHiddenReasoningMessage2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.HiddenReasoningMessage? value) + { + value = HiddenReasoningMessage2; + return IsHiddenReasoningMessage2; + } + /// /// A message representing a request to call a tool (generated by the LLM to trigger tool execution).
/// Args:
@@ -131,6 +183,19 @@ namespace Letta #endif public bool IsToolCallMessage => ToolCallMessage != null; + /// + /// + /// + public bool TryPickToolCallMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallMessage? value) + { + value = ToolCallMessage; + return IsToolCallMessage; + } + /// /// A message representing the return value of a tool call (generated by Letta executing the requested tool).
/// Args:
@@ -158,6 +223,19 @@ namespace Letta #endif public bool IsToolReturnMessage => ToolReturnMessage != null; + /// + /// + /// + public bool TryPickToolReturnMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnMessage? value) + { + value = ToolReturnMessage; + return IsToolReturnMessage; + } + /// /// A message sent by the LLM in response to user input. Used in the LLM context.
/// Args:
@@ -180,6 +258,19 @@ namespace Letta #endif public bool IsAssistantMessage => AssistantMessage != null; + /// + /// + /// + public bool TryPickAssistantMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AssistantMessage? value) + { + value = AssistantMessage; + return IsAssistantMessage; + } + /// /// A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
/// Args:
@@ -202,6 +293,19 @@ namespace Letta #endif public bool IsApprovalRequestMessage => ApprovalRequestMessage != null; + /// + /// + /// + public bool TryPickApprovalRequestMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalRequestMessage? value) + { + value = ApprovalRequestMessage; + return IsApprovalRequestMessage; + } + /// /// A message representing a response form the user indicating whether a tool has been approved to run.
/// Args:
@@ -226,6 +330,19 @@ namespace Letta #endif public bool IsApprovalResponseMessage => ApprovalResponseMessage != null; + /// + /// + /// + public bool TryPickApprovalResponseMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalResponseMessage? value) + { + value = ApprovalResponseMessage; + return IsApprovalResponseMessage; + } + /// /// A ping message used as a keepalive to prevent SSE streams from timing out during long running requests.
/// Args:
@@ -246,6 +363,19 @@ namespace Letta #endif public bool IsPing => Ping != null; + /// + /// + /// + public bool TryPickPing( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.LettaPing? value) + { + value = Ping; + return IsPing; + } + /// /// Error messages are used to notify the client of an error that occurred during the agent's execution. /// @@ -263,6 +393,19 @@ namespace Letta #endif public bool IsErrorMessage => ErrorMessage != null; + /// + /// + /// + public bool TryPickErrorMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.LettaErrorMessage? value) + { + value = ErrorMessage; + return IsErrorMessage; + } + /// /// The stop reason from Letta indicating why agent loop stopped execution. /// @@ -280,6 +423,19 @@ namespace Letta #endif public bool IsStopReason => StopReason != null; + /// + /// + /// + public bool TryPickStopReason( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.LettaStopReason? value) + { + value = StopReason; + return IsStopReason; + } + /// /// Usage statistics for the agent interaction.
/// Attributes:
@@ -304,6 +460,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UsageStatistics))] #endif public bool IsUsageStatistics => UsageStatistics != null; + + /// + /// + /// + public bool TryPickUsageStatistics( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.LettaUsageStatistics? value) + { + value = UsageStatistics; + return IsUsageStatistics; + } /// /// /// @@ -625,19 +794,19 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? systemMessage = null, - global::System.Func? userMessage = null, - global::System.Func? hiddenReasoningMessage1 = null, - global::System.Func? hiddenReasoningMessage2 = null, - global::System.Func? toolCallMessage = null, - global::System.Func? toolReturnMessage = null, - global::System.Func? assistantMessage = null, - global::System.Func? approvalRequestMessage = null, - global::System.Func? approvalResponseMessage = null, - global::System.Func? ping = null, - global::System.Func? errorMessage = null, - global::System.Func? stopReason = null, - global::System.Func? usageStatistics = null, + global::System.Func? systemMessage = null, + global::System.Func? userMessage = null, + global::System.Func? hiddenReasoningMessage1 = null, + global::System.Func? hiddenReasoningMessage2 = null, + global::System.Func? toolCallMessage = null, + global::System.Func? toolReturnMessage = null, + global::System.Func? assistantMessage = null, + global::System.Func? approvalRequestMessage = null, + global::System.Func? approvalResponseMessage = null, + global::System.Func? ping = null, + global::System.Func? errorMessage = null, + global::System.Func? stopReason = null, + global::System.Func? usageStatistics = null, bool validate = true) { if (validate) @@ -705,19 +874,109 @@ public bool Validate() /// ///
public void Match( - global::System.Action? systemMessage = null, - global::System.Action? userMessage = null, - global::System.Action? hiddenReasoningMessage1 = null, - global::System.Action? hiddenReasoningMessage2 = null, - global::System.Action? toolCallMessage = null, - global::System.Action? toolReturnMessage = null, - global::System.Action? assistantMessage = null, - global::System.Action? approvalRequestMessage = null, - global::System.Action? approvalResponseMessage = null, - global::System.Action? ping = null, - global::System.Action? errorMessage = null, - global::System.Action? stopReason = null, - global::System.Action? usageStatistics = null, + global::System.Action? systemMessage = null, + + global::System.Action? userMessage = null, + + global::System.Action? hiddenReasoningMessage1 = null, + + global::System.Action? hiddenReasoningMessage2 = null, + + global::System.Action? toolCallMessage = null, + + global::System.Action? toolReturnMessage = null, + + global::System.Action? assistantMessage = null, + + global::System.Action? approvalRequestMessage = null, + + global::System.Action? approvalResponseMessage = null, + + global::System.Action? ping = null, + + global::System.Action? errorMessage = null, + + global::System.Action? stopReason = null, + + global::System.Action? usageStatistics = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSystemMessage) + { + systemMessage?.Invoke(SystemMessage!); + } + else if (IsUserMessage) + { + userMessage?.Invoke(UserMessage!); + } + else if (IsHiddenReasoningMessage1) + { + hiddenReasoningMessage1?.Invoke(HiddenReasoningMessage1!); + } + else if (IsHiddenReasoningMessage2) + { + hiddenReasoningMessage2?.Invoke(HiddenReasoningMessage2!); + } + else if (IsToolCallMessage) + { + toolCallMessage?.Invoke(ToolCallMessage!); + } + else if (IsToolReturnMessage) + { + toolReturnMessage?.Invoke(ToolReturnMessage!); + } + else if (IsAssistantMessage) + { + assistantMessage?.Invoke(AssistantMessage!); + } + else if (IsApprovalRequestMessage) + { + approvalRequestMessage?.Invoke(ApprovalRequestMessage!); + } + else if (IsApprovalResponseMessage) + { + approvalResponseMessage?.Invoke(ApprovalResponseMessage!); + } + else if (IsPing) + { + ping?.Invoke(Ping!); + } + else if (IsErrorMessage) + { + errorMessage?.Invoke(ErrorMessage!); + } + else if (IsStopReason) + { + stopReason?.Invoke(StopReason!); + } + else if (IsUsageStatistics) + { + usageStatistics?.Invoke(UsageStatistics!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? systemMessage = null, + global::System.Action? userMessage = null, + global::System.Action? hiddenReasoningMessage1 = null, + global::System.Action? hiddenReasoningMessage2 = null, + global::System.Action? toolCallMessage = null, + global::System.Action? toolReturnMessage = null, + global::System.Action? assistantMessage = null, + global::System.Action? approvalRequestMessage = null, + global::System.Action? approvalResponseMessage = null, + global::System.Action? ping = null, + global::System.Action? errorMessage = null, + global::System.Action? stopReason = null, + global::System.Action? usageStatistics = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.LettaToolReturnContentUnion.g.cs b/src/libs/Letta/Generated/Letta.Models.LettaToolReturnContentUnion.g.cs index b99345ea..0bf26bd6 100644 --- a/src/libs/Letta/Generated/Letta.Models.LettaToolReturnContentUnion.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.LettaToolReturnContentUnion.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -47,6 +60,19 @@ namespace Letta [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::Letta.ImageContent? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, + global::System.Func? text = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? text = null, - global::System.Action? image = null, + global::System.Action? text = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.LettaUserMessageContentUnion.g.cs b/src/libs/Letta/Generated/Letta.Models.LettaUserMessageContentUnion.g.cs index a8089398..6e25bcdc 100644 --- a/src/libs/Letta/Generated/Letta.Models.LettaUserMessageContentUnion.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.LettaUserMessageContentUnion.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextContent? value) + { + value = Text; + return IsText; + } + /// /// /// @@ -47,6 +60,19 @@ namespace Letta [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::Letta.ImageContent? value) + { + value = Image; + return IsImage; + } /// /// /// @@ -126,8 +152,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? text = null, - global::System.Func? image = null, + global::System.Func? text = null, + global::System.Func? image = null, bool validate = true) { if (validate) @@ -151,8 +177,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? text = null, - global::System.Action? image = null, + global::System.Action? text = null, + + global::System.Action? image = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImage) + { + image?.Invoke(Image!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? image = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ListMessagesForStepResponseItem.g.cs b/src/libs/Letta/Generated/Letta.Models.ListMessagesForStepResponseItem.g.cs index 4aecc34e..b70f6c31 100644 --- a/src/libs/Letta/Generated/Letta.Models.ListMessagesForStepResponseItem.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ListMessagesForStepResponseItem.g.cs @@ -36,6 +36,19 @@ namespace Letta #endif public bool IsSystemMessage => SystemMessage != null; + /// + /// + /// + public bool TryPickSystemMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SystemMessage? value) + { + value = SystemMessage; + return IsSystemMessage; + } + /// /// A message sent by the user. Never streamed back on a response, only used for cursor pagination.
/// Args:
@@ -58,6 +71,19 @@ namespace Letta #endif public bool IsUserMessage => UserMessage != null; + /// + /// + /// + public bool TryPickUserMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.UserMessage? value) + { + value = UserMessage; + return IsUserMessage; + } + /// /// Representation of an agent's internal reasoning.
/// Args:
@@ -83,6 +109,19 @@ namespace Letta #endif public bool IsReasoningMessage => ReasoningMessage != null; + /// + /// + /// + public bool TryPickReasoningMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningMessage? value) + { + value = ReasoningMessage; + return IsReasoningMessage; + } + /// /// Representation of an agent's internal reasoning where reasoning content
/// has been hidden from the response.
@@ -108,6 +147,19 @@ namespace Letta #endif public bool IsHiddenReasoningMessage => HiddenReasoningMessage != null; + /// + /// + /// + public bool TryPickHiddenReasoningMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.HiddenReasoningMessage? value) + { + value = HiddenReasoningMessage; + return IsHiddenReasoningMessage; + } + /// /// A message representing a request to call a tool (generated by the LLM to trigger tool execution).
/// Args:
@@ -130,6 +182,19 @@ namespace Letta #endif public bool IsToolCallMessage => ToolCallMessage != null; + /// + /// + /// + public bool TryPickToolCallMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallMessage? value) + { + value = ToolCallMessage; + return IsToolCallMessage; + } + /// /// A message representing the return value of a tool call (generated by Letta executing the requested tool).
/// Args:
@@ -157,6 +222,19 @@ namespace Letta #endif public bool IsToolReturnMessage => ToolReturnMessage != null; + /// + /// + /// + public bool TryPickToolReturnMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnMessage? value) + { + value = ToolReturnMessage; + return IsToolReturnMessage; + } + /// /// A message sent by the LLM in response to user input. Used in the LLM context.
/// Args:
@@ -179,6 +257,19 @@ namespace Letta #endif public bool IsAssistantMessage => AssistantMessage != null; + /// + /// + /// + public bool TryPickAssistantMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AssistantMessage? value) + { + value = AssistantMessage; + return IsAssistantMessage; + } + /// /// A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
/// Args:
@@ -201,6 +292,19 @@ namespace Letta #endif public bool IsApprovalRequestMessage => ApprovalRequestMessage != null; + /// + /// + /// + public bool TryPickApprovalRequestMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalRequestMessage? value) + { + value = ApprovalRequestMessage; + return IsApprovalRequestMessage; + } + /// /// A message representing a response form the user indicating whether a tool has been approved to run.
/// Args:
@@ -225,6 +329,19 @@ namespace Letta #endif public bool IsApprovalResponseMessage => ApprovalResponseMessage != null; + /// + /// + /// + public bool TryPickApprovalResponseMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalResponseMessage? value) + { + value = ApprovalResponseMessage; + return IsApprovalResponseMessage; + } + /// /// A message representing a summary of the conversation. Sent to the LLM as a user or system message depending on the provider. /// @@ -242,6 +359,19 @@ namespace Letta #endif public bool IsSummaryMessage => SummaryMessage != null; + /// + /// + /// + public bool TryPickSummaryMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SummaryMessage? value) + { + value = SummaryMessage; + return IsSummaryMessage; + } + /// /// A message for notifying the developer that an event that has occured (e.g. a compaction). Events are NOT part of the context window. /// @@ -258,6 +388,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(EventMessage))] #endif public bool IsEventMessage => EventMessage != null; + + /// + /// + /// + public bool TryPickEventMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.EventMessage? value) + { + value = EventMessage; + return IsEventMessage; + } /// /// /// @@ -535,17 +678,17 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? systemMessage = null, - global::System.Func? userMessage = null, - global::System.Func? reasoningMessage = null, - global::System.Func? hiddenReasoningMessage = null, - global::System.Func? toolCallMessage = null, - global::System.Func? toolReturnMessage = null, - global::System.Func? assistantMessage = null, - global::System.Func? approvalRequestMessage = null, - global::System.Func? approvalResponseMessage = null, - global::System.Func? summaryMessage = null, - global::System.Func? eventMessage = null, + global::System.Func? systemMessage = null, + global::System.Func? userMessage = null, + global::System.Func? reasoningMessage = null, + global::System.Func? hiddenReasoningMessage = null, + global::System.Func? toolCallMessage = null, + global::System.Func? toolReturnMessage = null, + global::System.Func? assistantMessage = null, + global::System.Func? approvalRequestMessage = null, + global::System.Func? approvalResponseMessage = null, + global::System.Func? summaryMessage = null, + global::System.Func? eventMessage = null, bool validate = true) { if (validate) @@ -605,17 +748,95 @@ public bool Validate() /// ///
public void Match( - global::System.Action? systemMessage = null, - global::System.Action? userMessage = null, - global::System.Action? reasoningMessage = null, - global::System.Action? hiddenReasoningMessage = null, - global::System.Action? toolCallMessage = null, - global::System.Action? toolReturnMessage = null, - global::System.Action? assistantMessage = null, - global::System.Action? approvalRequestMessage = null, - global::System.Action? approvalResponseMessage = null, - global::System.Action? summaryMessage = null, - global::System.Action? eventMessage = null, + global::System.Action? systemMessage = null, + + global::System.Action? userMessage = null, + + global::System.Action? reasoningMessage = null, + + global::System.Action? hiddenReasoningMessage = null, + + global::System.Action? toolCallMessage = null, + + global::System.Action? toolReturnMessage = null, + + global::System.Action? assistantMessage = null, + + global::System.Action? approvalRequestMessage = null, + + global::System.Action? approvalResponseMessage = null, + + global::System.Action? summaryMessage = null, + + global::System.Action? eventMessage = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSystemMessage) + { + systemMessage?.Invoke(SystemMessage!); + } + else if (IsUserMessage) + { + userMessage?.Invoke(UserMessage!); + } + else if (IsReasoningMessage) + { + reasoningMessage?.Invoke(ReasoningMessage!); + } + else if (IsHiddenReasoningMessage) + { + hiddenReasoningMessage?.Invoke(HiddenReasoningMessage!); + } + else if (IsToolCallMessage) + { + toolCallMessage?.Invoke(ToolCallMessage!); + } + else if (IsToolReturnMessage) + { + toolReturnMessage?.Invoke(ToolReturnMessage!); + } + else if (IsAssistantMessage) + { + assistantMessage?.Invoke(AssistantMessage!); + } + else if (IsApprovalRequestMessage) + { + approvalRequestMessage?.Invoke(ApprovalRequestMessage!); + } + else if (IsApprovalResponseMessage) + { + approvalResponseMessage?.Invoke(ApprovalResponseMessage!); + } + else if (IsSummaryMessage) + { + summaryMessage?.Invoke(SummaryMessage!); + } + else if (IsEventMessage) + { + eventMessage?.Invoke(EventMessage!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? systemMessage = null, + global::System.Action? userMessage = null, + global::System.Action? reasoningMessage = null, + global::System.Action? hiddenReasoningMessage = null, + global::System.Action? toolCallMessage = null, + global::System.Action? toolReturnMessage = null, + global::System.Action? assistantMessage = null, + global::System.Action? approvalRequestMessage = null, + global::System.Action? approvalResponseMessage = null, + global::System.Action? summaryMessage = null, + global::System.Action? eventMessage = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ManagerConfig.g.cs b/src/libs/Letta/Generated/Letta.Models.ManagerConfig.g.cs index 7775159f..6b1ec1e4 100644 --- a/src/libs/Letta/Generated/Letta.Models.ManagerConfig.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ManagerConfig.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsRoundRobin => RoundRobin != null; + /// + /// + /// + public bool TryPickRoundRobin( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RoundRobinManager? value) + { + value = RoundRobin; + return IsRoundRobin; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSupervisor => Supervisor != null; + /// + /// + /// + public bool TryPickSupervisor( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SupervisorManager? value) + { + value = Supervisor; + return IsSupervisor; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsDynamic => Dynamic != null; + /// + /// + /// + public bool TryPickDynamic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DynamicManager? value) + { + value = Dynamic; + return IsDynamic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsSleeptime => Sleeptime != null; + /// + /// + /// + public bool TryPickSleeptime( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SleeptimeManager? value) + { + value = Sleeptime; + return IsSleeptime; + } + /// /// /// @@ -98,6 +150,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VoiceSleeptime))] #endif public bool IsVoiceSleeptime => VoiceSleeptime != null; + + /// + /// + /// + public bool TryPickVoiceSleeptime( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.VoiceSleeptimeManager? value) + { + value = VoiceSleeptime; + return IsVoiceSleeptime; + } /// /// /// @@ -243,11 +308,11 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? roundRobin = null, - global::System.Func? supervisor = null, - global::System.Func? dynamic = null, - global::System.Func? sleeptime = null, - global::System.Func? voiceSleeptime = null, + global::System.Func? roundRobin = null, + global::System.Func? supervisor = null, + global::System.Func? dynamic = null, + global::System.Func? sleeptime = null, + global::System.Func? voiceSleeptime = null, bool validate = true) { if (validate) @@ -283,11 +348,53 @@ public bool Validate() /// ///
public void Match( - global::System.Action? roundRobin = null, - global::System.Action? supervisor = null, - global::System.Action? dynamic = null, - global::System.Action? sleeptime = null, - global::System.Action? voiceSleeptime = null, + global::System.Action? roundRobin = null, + + global::System.Action? supervisor = null, + + global::System.Action? dynamic = null, + + global::System.Action? sleeptime = null, + + global::System.Action? voiceSleeptime = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsRoundRobin) + { + roundRobin?.Invoke(RoundRobin!); + } + else if (IsSupervisor) + { + supervisor?.Invoke(Supervisor!); + } + else if (IsDynamic) + { + dynamic?.Invoke(Dynamic!); + } + else if (IsSleeptime) + { + sleeptime?.Invoke(Sleeptime!); + } + else if (IsVoiceSleeptime) + { + voiceSleeptime?.Invoke(VoiceSleeptime!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? roundRobin = null, + global::System.Action? supervisor = null, + global::System.Action? dynamic = null, + global::System.Action? sleeptime = null, + global::System.Action? voiceSleeptime = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ManagerConfig2.g.cs b/src/libs/Letta/Generated/Letta.Models.ManagerConfig2.g.cs index 81488683..7e430db6 100644 --- a/src/libs/Letta/Generated/Letta.Models.ManagerConfig2.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ManagerConfig2.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsRoundRobin => RoundRobin != null; + /// + /// + /// + public bool TryPickRoundRobin( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RoundRobinManager? value) + { + value = RoundRobin; + return IsRoundRobin; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSupervisor => Supervisor != null; + /// + /// + /// + public bool TryPickSupervisor( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SupervisorManagerSchema? value) + { + value = Supervisor; + return IsSupervisor; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsDynamic => Dynamic != null; + /// + /// + /// + public bool TryPickDynamic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DynamicManagerSchema? value) + { + value = Dynamic; + return IsDynamic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsSleeptime => Sleeptime != null; + /// + /// + /// + public bool TryPickSleeptime( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SleeptimeManagerSchema? value) + { + value = Sleeptime; + return IsSleeptime; + } + /// /// /// @@ -98,6 +150,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VoiceSleeptime))] #endif public bool IsVoiceSleeptime => VoiceSleeptime != null; + + /// + /// + /// + public bool TryPickVoiceSleeptime( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.VoiceSleeptimeManagerSchema? value) + { + value = VoiceSleeptime; + return IsVoiceSleeptime; + } /// /// /// @@ -243,11 +308,11 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? roundRobin = null, - global::System.Func? supervisor = null, - global::System.Func? dynamic = null, - global::System.Func? sleeptime = null, - global::System.Func? voiceSleeptime = null, + global::System.Func? roundRobin = null, + global::System.Func? supervisor = null, + global::System.Func? dynamic = null, + global::System.Func? sleeptime = null, + global::System.Func? voiceSleeptime = null, bool validate = true) { if (validate) @@ -283,11 +348,53 @@ public bool Validate() /// ///
public void Match( - global::System.Action? roundRobin = null, - global::System.Action? supervisor = null, - global::System.Action? dynamic = null, - global::System.Action? sleeptime = null, - global::System.Action? voiceSleeptime = null, + global::System.Action? roundRobin = null, + + global::System.Action? supervisor = null, + + global::System.Action? dynamic = null, + + global::System.Action? sleeptime = null, + + global::System.Action? voiceSleeptime = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsRoundRobin) + { + roundRobin?.Invoke(RoundRobin!); + } + else if (IsSupervisor) + { + supervisor?.Invoke(Supervisor!); + } + else if (IsDynamic) + { + dynamic?.Invoke(Dynamic!); + } + else if (IsSleeptime) + { + sleeptime?.Invoke(Sleeptime!); + } + else if (IsVoiceSleeptime) + { + voiceSleeptime?.Invoke(VoiceSleeptime!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? roundRobin = null, + global::System.Action? supervisor = null, + global::System.Action? dynamic = null, + global::System.Action? sleeptime = null, + global::System.Action? voiceSleeptime = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ManagerConfig3.g.cs b/src/libs/Letta/Generated/Letta.Models.ManagerConfig3.g.cs index 7a6a73fb..0ac6edbf 100644 --- a/src/libs/Letta/Generated/Letta.Models.ManagerConfig3.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ManagerConfig3.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsRoundRobin => RoundRobin != null; + /// + /// + /// + public bool TryPickRoundRobin( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RoundRobinManager? value) + { + value = RoundRobin; + return IsRoundRobin; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSupervisor => Supervisor != null; + /// + /// + /// + public bool TryPickSupervisor( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SupervisorManager? value) + { + value = Supervisor; + return IsSupervisor; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsDynamic => Dynamic != null; + /// + /// + /// + public bool TryPickDynamic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DynamicManager? value) + { + value = Dynamic; + return IsDynamic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsSleeptime => Sleeptime != null; + /// + /// + /// + public bool TryPickSleeptime( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SleeptimeManager? value) + { + value = Sleeptime; + return IsSleeptime; + } + /// /// /// @@ -98,6 +150,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VoiceSleeptime))] #endif public bool IsVoiceSleeptime => VoiceSleeptime != null; + + /// + /// + /// + public bool TryPickVoiceSleeptime( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.VoiceSleeptimeManager? value) + { + value = VoiceSleeptime; + return IsVoiceSleeptime; + } /// /// /// @@ -243,11 +308,11 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? roundRobin = null, - global::System.Func? supervisor = null, - global::System.Func? dynamic = null, - global::System.Func? sleeptime = null, - global::System.Func? voiceSleeptime = null, + global::System.Func? roundRobin = null, + global::System.Func? supervisor = null, + global::System.Func? dynamic = null, + global::System.Func? sleeptime = null, + global::System.Func? voiceSleeptime = null, bool validate = true) { if (validate) @@ -283,11 +348,53 @@ public bool Validate() /// ///
public void Match( - global::System.Action? roundRobin = null, - global::System.Action? supervisor = null, - global::System.Action? dynamic = null, - global::System.Action? sleeptime = null, - global::System.Action? voiceSleeptime = null, + global::System.Action? roundRobin = null, + + global::System.Action? supervisor = null, + + global::System.Action? dynamic = null, + + global::System.Action? sleeptime = null, + + global::System.Action? voiceSleeptime = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsRoundRobin) + { + roundRobin?.Invoke(RoundRobin!); + } + else if (IsSupervisor) + { + supervisor?.Invoke(Supervisor!); + } + else if (IsDynamic) + { + dynamic?.Invoke(Dynamic!); + } + else if (IsSleeptime) + { + sleeptime?.Invoke(Sleeptime!); + } + else if (IsVoiceSleeptime) + { + voiceSleeptime?.Invoke(VoiceSleeptime!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? roundRobin = null, + global::System.Action? supervisor = null, + global::System.Action? dynamic = null, + global::System.Action? sleeptime = null, + global::System.Action? voiceSleeptime = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ManagerConfigVariant1.g.cs b/src/libs/Letta/Generated/Letta.Models.ManagerConfigVariant1.g.cs index 93a942af..6aef1659 100644 --- a/src/libs/Letta/Generated/Letta.Models.ManagerConfigVariant1.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ManagerConfigVariant1.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsRoundRobin => RoundRobin != null; + /// + /// + /// + public bool TryPickRoundRobin( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RoundRobinManagerUpdate? value) + { + value = RoundRobin; + return IsRoundRobin; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSupervisor => Supervisor != null; + /// + /// + /// + public bool TryPickSupervisor( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SupervisorManagerUpdate? value) + { + value = Supervisor; + return IsSupervisor; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsDynamic => Dynamic != null; + /// + /// + /// + public bool TryPickDynamic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DynamicManagerUpdate? value) + { + value = Dynamic; + return IsDynamic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsSleeptime => Sleeptime != null; + /// + /// + /// + public bool TryPickSleeptime( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SleeptimeManagerUpdate? value) + { + value = Sleeptime; + return IsSleeptime; + } + /// /// /// @@ -98,6 +150,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(VoiceSleeptime))] #endif public bool IsVoiceSleeptime => VoiceSleeptime != null; + + /// + /// + /// + public bool TryPickVoiceSleeptime( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.VoiceSleeptimeManagerUpdate? value) + { + value = VoiceSleeptime; + return IsVoiceSleeptime; + } /// /// /// @@ -243,11 +308,11 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? roundRobin = null, - global::System.Func? supervisor = null, - global::System.Func? dynamic = null, - global::System.Func? sleeptime = null, - global::System.Func? voiceSleeptime = null, + global::System.Func? roundRobin = null, + global::System.Func? supervisor = null, + global::System.Func? dynamic = null, + global::System.Func? sleeptime = null, + global::System.Func? voiceSleeptime = null, bool validate = true) { if (validate) @@ -283,11 +348,53 @@ public bool Validate() /// ///
public void Match( - global::System.Action? roundRobin = null, - global::System.Action? supervisor = null, - global::System.Action? dynamic = null, - global::System.Action? sleeptime = null, - global::System.Action? voiceSleeptime = null, + global::System.Action? roundRobin = null, + + global::System.Action? supervisor = null, + + global::System.Action? dynamic = null, + + global::System.Action? sleeptime = null, + + global::System.Action? voiceSleeptime = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsRoundRobin) + { + roundRobin?.Invoke(RoundRobin!); + } + else if (IsSupervisor) + { + supervisor?.Invoke(Supervisor!); + } + else if (IsDynamic) + { + dynamic?.Invoke(Dynamic!); + } + else if (IsSleeptime) + { + sleeptime?.Invoke(Sleeptime!); + } + else if (IsVoiceSleeptime) + { + voiceSleeptime?.Invoke(VoiceSleeptime!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? roundRobin = null, + global::System.Action? supervisor = null, + global::System.Action? dynamic = null, + global::System.Action? sleeptime = null, + global::System.Action? voiceSleeptime = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant1.g.cs b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant1.g.cs index 0322dcdc..af9405ef 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant1.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant1.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenAIModelSettings? value) + { + value = Openai; + return IsOpenai; + } + /// /// SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing). /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSglang => Sglang != null; + /// + /// + /// + public bool TryPickSglang( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SGLangModelSettings? value) + { + value = Sglang; + return IsSglang; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AnthropicModelSettings? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsGoogleAi => GoogleAi != null; + /// + /// + /// + public bool TryPickGoogleAi( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleAIModelSettings? value) + { + value = GoogleAi; + return IsGoogleAi; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsGoogleVertex => GoogleVertex != null; + /// + /// + /// + public bool TryPickGoogleVertex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleVertexModelSettings? value) + { + value = GoogleVertex; + return IsGoogleVertex; + } + /// /// Azure OpenAI model configuration (OpenAI-compatible). /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsAzure => Azure != null; + /// + /// + /// + public bool TryPickAzure( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AzureModelSettings? value) + { + value = Azure; + return IsAzure; + } + /// /// xAI model configuration (OpenAI-compatible). /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.XAIModelSettings? value) + { + value = Xai; + return IsXai; + } + /// /// Z.ai (ZhipuAI) model configuration (OpenAI-compatible). /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsZai => Zai != null; + /// + /// + /// + public bool TryPickZai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ZAIModelSettings? value) + { + value = Zai; + return IsZai; + } + /// /// Groq model configuration (OpenAI-compatible). /// @@ -167,6 +271,19 @@ namespace Letta #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GroqModelSettings? value) + { + value = Groq; + return IsGroq; + } + /// /// Deepseek model configuration (OpenAI-compatible). /// @@ -184,6 +301,19 @@ namespace Letta #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DeepseekModelSettings? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// Together AI model configuration (OpenAI-compatible). /// @@ -201,6 +331,19 @@ namespace Letta #endif public bool IsTogether => Together != null; + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TogetherModelSettings? value) + { + value = Together; + return IsTogether; + } + /// /// AWS Bedrock model configuration. /// @@ -218,6 +361,19 @@ namespace Letta #endif public bool IsBedrock => Bedrock != null; + /// + /// + /// + public bool TryPickBedrock( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BedrockModelSettings? value) + { + value = Bedrock; + return IsBedrock; + } + /// /// Baseten model configuration (OpenAI-compatible). /// @@ -235,6 +391,19 @@ namespace Letta #endif public bool IsBaseten => Baseten != null; + /// + /// + /// + public bool TryPickBaseten( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BasetenModelSettings? value) + { + value = Baseten; + return IsBaseten; + } + /// /// OpenRouter model configuration (OpenAI-compatible). /// @@ -252,6 +421,19 @@ namespace Letta #endif public bool IsOpenrouter => Openrouter != null; + /// + /// + /// + public bool TryPickOpenrouter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenRouterModelSettings? value) + { + value = Openrouter; + return IsOpenrouter; + } + /// /// ChatGPT OAuth model configuration (uses ChatGPT backend API). /// @@ -268,6 +450,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatgptOauth))] #endif public bool IsChatgptOauth => ChatgptOauth != null; + + /// + /// + /// + public bool TryPickChatgptOauth( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChatGPTOAuthModelSettings? value) + { + value = ChatgptOauth; + return IsChatgptOauth; + } /// /// /// @@ -633,21 +828,21 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? openai = null, - global::System.Func? sglang = null, - global::System.Func? anthropic = null, - global::System.Func? googleAi = null, - global::System.Func? googleVertex = null, - global::System.Func? azure = null, - global::System.Func? xai = null, - global::System.Func? zai = null, - global::System.Func? groq = null, - global::System.Func? deepseek = null, - global::System.Func? together = null, - global::System.Func? bedrock = null, - global::System.Func? baseten = null, - global::System.Func? openrouter = null, - global::System.Func? chatgptOauth = null, + global::System.Func? openai = null, + global::System.Func? sglang = null, + global::System.Func? anthropic = null, + global::System.Func? googleAi = null, + global::System.Func? googleVertex = null, + global::System.Func? azure = null, + global::System.Func? xai = null, + global::System.Func? zai = null, + global::System.Func? groq = null, + global::System.Func? deepseek = null, + global::System.Func? together = null, + global::System.Func? bedrock = null, + global::System.Func? baseten = null, + global::System.Func? openrouter = null, + global::System.Func? chatgptOauth = null, bool validate = true) { if (validate) @@ -723,21 +918,123 @@ public bool Validate() /// ///
public void Match( - global::System.Action? openai = null, - global::System.Action? sglang = null, - global::System.Action? anthropic = null, - global::System.Action? googleAi = null, - global::System.Action? googleVertex = null, - global::System.Action? azure = null, - global::System.Action? xai = null, - global::System.Action? zai = null, - global::System.Action? groq = null, - global::System.Action? deepseek = null, - global::System.Action? together = null, - global::System.Action? bedrock = null, - global::System.Action? baseten = null, - global::System.Action? openrouter = null, - global::System.Action? chatgptOauth = null, + global::System.Action? openai = null, + + global::System.Action? sglang = null, + + global::System.Action? anthropic = null, + + global::System.Action? googleAi = null, + + global::System.Action? googleVertex = null, + + global::System.Action? azure = null, + + global::System.Action? xai = null, + + global::System.Action? zai = null, + + global::System.Action? groq = null, + + global::System.Action? deepseek = null, + + global::System.Action? together = null, + + global::System.Action? bedrock = null, + + global::System.Action? baseten = null, + + global::System.Action? openrouter = null, + + global::System.Action? chatgptOauth = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsSglang) + { + sglang?.Invoke(Sglang!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogleAi) + { + googleAi?.Invoke(GoogleAi!); + } + else if (IsGoogleVertex) + { + googleVertex?.Invoke(GoogleVertex!); + } + else if (IsAzure) + { + azure?.Invoke(Azure!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsZai) + { + zai?.Invoke(Zai!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + else if (IsBedrock) + { + bedrock?.Invoke(Bedrock!); + } + else if (IsBaseten) + { + baseten?.Invoke(Baseten!); + } + else if (IsOpenrouter) + { + openrouter?.Invoke(Openrouter!); + } + else if (IsChatgptOauth) + { + chatgptOauth?.Invoke(ChatgptOauth!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? sglang = null, + global::System.Action? anthropic = null, + global::System.Action? googleAi = null, + global::System.Action? googleVertex = null, + global::System.Action? azure = null, + global::System.Action? xai = null, + global::System.Action? zai = null, + global::System.Action? groq = null, + global::System.Action? deepseek = null, + global::System.Action? together = null, + global::System.Action? bedrock = null, + global::System.Action? baseten = null, + global::System.Action? openrouter = null, + global::System.Action? chatgptOauth = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant110.g.cs b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant110.g.cs index 980afbab..65be534d 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant110.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant110.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenAIModelSettings? value) + { + value = Openai; + return IsOpenai; + } + /// /// SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing). /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSglang => Sglang != null; + /// + /// + /// + public bool TryPickSglang( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SGLangModelSettings? value) + { + value = Sglang; + return IsSglang; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AnthropicModelSettings? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsGoogleAi => GoogleAi != null; + /// + /// + /// + public bool TryPickGoogleAi( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleAIModelSettings? value) + { + value = GoogleAi; + return IsGoogleAi; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsGoogleVertex => GoogleVertex != null; + /// + /// + /// + public bool TryPickGoogleVertex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleVertexModelSettings? value) + { + value = GoogleVertex; + return IsGoogleVertex; + } + /// /// Azure OpenAI model configuration (OpenAI-compatible). /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsAzure => Azure != null; + /// + /// + /// + public bool TryPickAzure( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AzureModelSettings? value) + { + value = Azure; + return IsAzure; + } + /// /// xAI model configuration (OpenAI-compatible). /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.XAIModelSettings? value) + { + value = Xai; + return IsXai; + } + /// /// Z.ai (ZhipuAI) model configuration (OpenAI-compatible). /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsZai => Zai != null; + /// + /// + /// + public bool TryPickZai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ZAIModelSettings? value) + { + value = Zai; + return IsZai; + } + /// /// Groq model configuration (OpenAI-compatible). /// @@ -167,6 +271,19 @@ namespace Letta #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GroqModelSettings? value) + { + value = Groq; + return IsGroq; + } + /// /// Deepseek model configuration (OpenAI-compatible). /// @@ -184,6 +301,19 @@ namespace Letta #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DeepseekModelSettings? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// Together AI model configuration (OpenAI-compatible). /// @@ -201,6 +331,19 @@ namespace Letta #endif public bool IsTogether => Together != null; + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TogetherModelSettings? value) + { + value = Together; + return IsTogether; + } + /// /// AWS Bedrock model configuration. /// @@ -218,6 +361,19 @@ namespace Letta #endif public bool IsBedrock => Bedrock != null; + /// + /// + /// + public bool TryPickBedrock( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BedrockModelSettings? value) + { + value = Bedrock; + return IsBedrock; + } + /// /// Baseten model configuration (OpenAI-compatible). /// @@ -235,6 +391,19 @@ namespace Letta #endif public bool IsBaseten => Baseten != null; + /// + /// + /// + public bool TryPickBaseten( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BasetenModelSettings? value) + { + value = Baseten; + return IsBaseten; + } + /// /// OpenRouter model configuration (OpenAI-compatible). /// @@ -252,6 +421,19 @@ namespace Letta #endif public bool IsOpenrouter => Openrouter != null; + /// + /// + /// + public bool TryPickOpenrouter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenRouterModelSettings? value) + { + value = Openrouter; + return IsOpenrouter; + } + /// /// ChatGPT OAuth model configuration (uses ChatGPT backend API). /// @@ -268,6 +450,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatgptOauth))] #endif public bool IsChatgptOauth => ChatgptOauth != null; + + /// + /// + /// + public bool TryPickChatgptOauth( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChatGPTOAuthModelSettings? value) + { + value = ChatgptOauth; + return IsChatgptOauth; + } /// /// /// @@ -633,21 +828,21 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? openai = null, - global::System.Func? sglang = null, - global::System.Func? anthropic = null, - global::System.Func? googleAi = null, - global::System.Func? googleVertex = null, - global::System.Func? azure = null, - global::System.Func? xai = null, - global::System.Func? zai = null, - global::System.Func? groq = null, - global::System.Func? deepseek = null, - global::System.Func? together = null, - global::System.Func? bedrock = null, - global::System.Func? baseten = null, - global::System.Func? openrouter = null, - global::System.Func? chatgptOauth = null, + global::System.Func? openai = null, + global::System.Func? sglang = null, + global::System.Func? anthropic = null, + global::System.Func? googleAi = null, + global::System.Func? googleVertex = null, + global::System.Func? azure = null, + global::System.Func? xai = null, + global::System.Func? zai = null, + global::System.Func? groq = null, + global::System.Func? deepseek = null, + global::System.Func? together = null, + global::System.Func? bedrock = null, + global::System.Func? baseten = null, + global::System.Func? openrouter = null, + global::System.Func? chatgptOauth = null, bool validate = true) { if (validate) @@ -723,21 +918,123 @@ public bool Validate() /// ///
public void Match( - global::System.Action? openai = null, - global::System.Action? sglang = null, - global::System.Action? anthropic = null, - global::System.Action? googleAi = null, - global::System.Action? googleVertex = null, - global::System.Action? azure = null, - global::System.Action? xai = null, - global::System.Action? zai = null, - global::System.Action? groq = null, - global::System.Action? deepseek = null, - global::System.Action? together = null, - global::System.Action? bedrock = null, - global::System.Action? baseten = null, - global::System.Action? openrouter = null, - global::System.Action? chatgptOauth = null, + global::System.Action? openai = null, + + global::System.Action? sglang = null, + + global::System.Action? anthropic = null, + + global::System.Action? googleAi = null, + + global::System.Action? googleVertex = null, + + global::System.Action? azure = null, + + global::System.Action? xai = null, + + global::System.Action? zai = null, + + global::System.Action? groq = null, + + global::System.Action? deepseek = null, + + global::System.Action? together = null, + + global::System.Action? bedrock = null, + + global::System.Action? baseten = null, + + global::System.Action? openrouter = null, + + global::System.Action? chatgptOauth = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsSglang) + { + sglang?.Invoke(Sglang!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogleAi) + { + googleAi?.Invoke(GoogleAi!); + } + else if (IsGoogleVertex) + { + googleVertex?.Invoke(GoogleVertex!); + } + else if (IsAzure) + { + azure?.Invoke(Azure!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsZai) + { + zai?.Invoke(Zai!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + else if (IsBedrock) + { + bedrock?.Invoke(Bedrock!); + } + else if (IsBaseten) + { + baseten?.Invoke(Baseten!); + } + else if (IsOpenrouter) + { + openrouter?.Invoke(Openrouter!); + } + else if (IsChatgptOauth) + { + chatgptOauth?.Invoke(ChatgptOauth!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? sglang = null, + global::System.Action? anthropic = null, + global::System.Action? googleAi = null, + global::System.Action? googleVertex = null, + global::System.Action? azure = null, + global::System.Action? xai = null, + global::System.Action? zai = null, + global::System.Action? groq = null, + global::System.Action? deepseek = null, + global::System.Action? together = null, + global::System.Action? bedrock = null, + global::System.Action? baseten = null, + global::System.Action? openrouter = null, + global::System.Action? chatgptOauth = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant12.g.cs b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant12.g.cs index 097d3971..29f07cf7 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant12.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant12.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenAIModelSettings? value) + { + value = Openai; + return IsOpenai; + } + /// /// SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing). /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSglang => Sglang != null; + /// + /// + /// + public bool TryPickSglang( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SGLangModelSettings? value) + { + value = Sglang; + return IsSglang; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AnthropicModelSettings? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsGoogleAi => GoogleAi != null; + /// + /// + /// + public bool TryPickGoogleAi( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleAIModelSettings? value) + { + value = GoogleAi; + return IsGoogleAi; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsGoogleVertex => GoogleVertex != null; + /// + /// + /// + public bool TryPickGoogleVertex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleVertexModelSettings? value) + { + value = GoogleVertex; + return IsGoogleVertex; + } + /// /// Azure OpenAI model configuration (OpenAI-compatible). /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsAzure => Azure != null; + /// + /// + /// + public bool TryPickAzure( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AzureModelSettings? value) + { + value = Azure; + return IsAzure; + } + /// /// xAI model configuration (OpenAI-compatible). /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.XAIModelSettings? value) + { + value = Xai; + return IsXai; + } + /// /// Z.ai (ZhipuAI) model configuration (OpenAI-compatible). /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsZai => Zai != null; + /// + /// + /// + public bool TryPickZai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ZAIModelSettings? value) + { + value = Zai; + return IsZai; + } + /// /// Groq model configuration (OpenAI-compatible). /// @@ -167,6 +271,19 @@ namespace Letta #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GroqModelSettings? value) + { + value = Groq; + return IsGroq; + } + /// /// Deepseek model configuration (OpenAI-compatible). /// @@ -184,6 +301,19 @@ namespace Letta #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DeepseekModelSettings? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// Together AI model configuration (OpenAI-compatible). /// @@ -201,6 +331,19 @@ namespace Letta #endif public bool IsTogether => Together != null; + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TogetherModelSettings? value) + { + value = Together; + return IsTogether; + } + /// /// AWS Bedrock model configuration. /// @@ -218,6 +361,19 @@ namespace Letta #endif public bool IsBedrock => Bedrock != null; + /// + /// + /// + public bool TryPickBedrock( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BedrockModelSettings? value) + { + value = Bedrock; + return IsBedrock; + } + /// /// Baseten model configuration (OpenAI-compatible). /// @@ -235,6 +391,19 @@ namespace Letta #endif public bool IsBaseten => Baseten != null; + /// + /// + /// + public bool TryPickBaseten( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BasetenModelSettings? value) + { + value = Baseten; + return IsBaseten; + } + /// /// OpenRouter model configuration (OpenAI-compatible). /// @@ -252,6 +421,19 @@ namespace Letta #endif public bool IsOpenrouter => Openrouter != null; + /// + /// + /// + public bool TryPickOpenrouter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenRouterModelSettings? value) + { + value = Openrouter; + return IsOpenrouter; + } + /// /// ChatGPT OAuth model configuration (uses ChatGPT backend API). /// @@ -268,6 +450,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatgptOauth))] #endif public bool IsChatgptOauth => ChatgptOauth != null; + + /// + /// + /// + public bool TryPickChatgptOauth( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChatGPTOAuthModelSettings? value) + { + value = ChatgptOauth; + return IsChatgptOauth; + } /// /// /// @@ -633,21 +828,21 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? openai = null, - global::System.Func? sglang = null, - global::System.Func? anthropic = null, - global::System.Func? googleAi = null, - global::System.Func? googleVertex = null, - global::System.Func? azure = null, - global::System.Func? xai = null, - global::System.Func? zai = null, - global::System.Func? groq = null, - global::System.Func? deepseek = null, - global::System.Func? together = null, - global::System.Func? bedrock = null, - global::System.Func? baseten = null, - global::System.Func? openrouter = null, - global::System.Func? chatgptOauth = null, + global::System.Func? openai = null, + global::System.Func? sglang = null, + global::System.Func? anthropic = null, + global::System.Func? googleAi = null, + global::System.Func? googleVertex = null, + global::System.Func? azure = null, + global::System.Func? xai = null, + global::System.Func? zai = null, + global::System.Func? groq = null, + global::System.Func? deepseek = null, + global::System.Func? together = null, + global::System.Func? bedrock = null, + global::System.Func? baseten = null, + global::System.Func? openrouter = null, + global::System.Func? chatgptOauth = null, bool validate = true) { if (validate) @@ -723,21 +918,123 @@ public bool Validate() /// ///
public void Match( - global::System.Action? openai = null, - global::System.Action? sglang = null, - global::System.Action? anthropic = null, - global::System.Action? googleAi = null, - global::System.Action? googleVertex = null, - global::System.Action? azure = null, - global::System.Action? xai = null, - global::System.Action? zai = null, - global::System.Action? groq = null, - global::System.Action? deepseek = null, - global::System.Action? together = null, - global::System.Action? bedrock = null, - global::System.Action? baseten = null, - global::System.Action? openrouter = null, - global::System.Action? chatgptOauth = null, + global::System.Action? openai = null, + + global::System.Action? sglang = null, + + global::System.Action? anthropic = null, + + global::System.Action? googleAi = null, + + global::System.Action? googleVertex = null, + + global::System.Action? azure = null, + + global::System.Action? xai = null, + + global::System.Action? zai = null, + + global::System.Action? groq = null, + + global::System.Action? deepseek = null, + + global::System.Action? together = null, + + global::System.Action? bedrock = null, + + global::System.Action? baseten = null, + + global::System.Action? openrouter = null, + + global::System.Action? chatgptOauth = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsSglang) + { + sglang?.Invoke(Sglang!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogleAi) + { + googleAi?.Invoke(GoogleAi!); + } + else if (IsGoogleVertex) + { + googleVertex?.Invoke(GoogleVertex!); + } + else if (IsAzure) + { + azure?.Invoke(Azure!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsZai) + { + zai?.Invoke(Zai!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + else if (IsBedrock) + { + bedrock?.Invoke(Bedrock!); + } + else if (IsBaseten) + { + baseten?.Invoke(Baseten!); + } + else if (IsOpenrouter) + { + openrouter?.Invoke(Openrouter!); + } + else if (IsChatgptOauth) + { + chatgptOauth?.Invoke(ChatgptOauth!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? sglang = null, + global::System.Action? anthropic = null, + global::System.Action? googleAi = null, + global::System.Action? googleVertex = null, + global::System.Action? azure = null, + global::System.Action? xai = null, + global::System.Action? zai = null, + global::System.Action? groq = null, + global::System.Action? deepseek = null, + global::System.Action? together = null, + global::System.Action? bedrock = null, + global::System.Action? baseten = null, + global::System.Action? openrouter = null, + global::System.Action? chatgptOauth = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant13.g.cs b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant13.g.cs index e16bfdd9..c388fcd0 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant13.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant13.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenAIModelSettings? value) + { + value = Openai; + return IsOpenai; + } + /// /// SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing). /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSglang => Sglang != null; + /// + /// + /// + public bool TryPickSglang( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SGLangModelSettings? value) + { + value = Sglang; + return IsSglang; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AnthropicModelSettings? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsGoogleAi => GoogleAi != null; + /// + /// + /// + public bool TryPickGoogleAi( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleAIModelSettings? value) + { + value = GoogleAi; + return IsGoogleAi; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsGoogleVertex => GoogleVertex != null; + /// + /// + /// + public bool TryPickGoogleVertex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleVertexModelSettings? value) + { + value = GoogleVertex; + return IsGoogleVertex; + } + /// /// Azure OpenAI model configuration (OpenAI-compatible). /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsAzure => Azure != null; + /// + /// + /// + public bool TryPickAzure( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AzureModelSettings? value) + { + value = Azure; + return IsAzure; + } + /// /// xAI model configuration (OpenAI-compatible). /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.XAIModelSettings? value) + { + value = Xai; + return IsXai; + } + /// /// Z.ai (ZhipuAI) model configuration (OpenAI-compatible). /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsZai => Zai != null; + /// + /// + /// + public bool TryPickZai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ZAIModelSettings? value) + { + value = Zai; + return IsZai; + } + /// /// Groq model configuration (OpenAI-compatible). /// @@ -167,6 +271,19 @@ namespace Letta #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GroqModelSettings? value) + { + value = Groq; + return IsGroq; + } + /// /// Deepseek model configuration (OpenAI-compatible). /// @@ -184,6 +301,19 @@ namespace Letta #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DeepseekModelSettings? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// Together AI model configuration (OpenAI-compatible). /// @@ -201,6 +331,19 @@ namespace Letta #endif public bool IsTogether => Together != null; + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TogetherModelSettings? value) + { + value = Together; + return IsTogether; + } + /// /// AWS Bedrock model configuration. /// @@ -218,6 +361,19 @@ namespace Letta #endif public bool IsBedrock => Bedrock != null; + /// + /// + /// + public bool TryPickBedrock( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BedrockModelSettings? value) + { + value = Bedrock; + return IsBedrock; + } + /// /// Baseten model configuration (OpenAI-compatible). /// @@ -235,6 +391,19 @@ namespace Letta #endif public bool IsBaseten => Baseten != null; + /// + /// + /// + public bool TryPickBaseten( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BasetenModelSettings? value) + { + value = Baseten; + return IsBaseten; + } + /// /// OpenRouter model configuration (OpenAI-compatible). /// @@ -252,6 +421,19 @@ namespace Letta #endif public bool IsOpenrouter => Openrouter != null; + /// + /// + /// + public bool TryPickOpenrouter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenRouterModelSettings? value) + { + value = Openrouter; + return IsOpenrouter; + } + /// /// ChatGPT OAuth model configuration (uses ChatGPT backend API). /// @@ -268,6 +450,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatgptOauth))] #endif public bool IsChatgptOauth => ChatgptOauth != null; + + /// + /// + /// + public bool TryPickChatgptOauth( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChatGPTOAuthModelSettings? value) + { + value = ChatgptOauth; + return IsChatgptOauth; + } /// /// /// @@ -633,21 +828,21 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? openai = null, - global::System.Func? sglang = null, - global::System.Func? anthropic = null, - global::System.Func? googleAi = null, - global::System.Func? googleVertex = null, - global::System.Func? azure = null, - global::System.Func? xai = null, - global::System.Func? zai = null, - global::System.Func? groq = null, - global::System.Func? deepseek = null, - global::System.Func? together = null, - global::System.Func? bedrock = null, - global::System.Func? baseten = null, - global::System.Func? openrouter = null, - global::System.Func? chatgptOauth = null, + global::System.Func? openai = null, + global::System.Func? sglang = null, + global::System.Func? anthropic = null, + global::System.Func? googleAi = null, + global::System.Func? googleVertex = null, + global::System.Func? azure = null, + global::System.Func? xai = null, + global::System.Func? zai = null, + global::System.Func? groq = null, + global::System.Func? deepseek = null, + global::System.Func? together = null, + global::System.Func? bedrock = null, + global::System.Func? baseten = null, + global::System.Func? openrouter = null, + global::System.Func? chatgptOauth = null, bool validate = true) { if (validate) @@ -723,21 +918,123 @@ public bool Validate() /// ///
public void Match( - global::System.Action? openai = null, - global::System.Action? sglang = null, - global::System.Action? anthropic = null, - global::System.Action? googleAi = null, - global::System.Action? googleVertex = null, - global::System.Action? azure = null, - global::System.Action? xai = null, - global::System.Action? zai = null, - global::System.Action? groq = null, - global::System.Action? deepseek = null, - global::System.Action? together = null, - global::System.Action? bedrock = null, - global::System.Action? baseten = null, - global::System.Action? openrouter = null, - global::System.Action? chatgptOauth = null, + global::System.Action? openai = null, + + global::System.Action? sglang = null, + + global::System.Action? anthropic = null, + + global::System.Action? googleAi = null, + + global::System.Action? googleVertex = null, + + global::System.Action? azure = null, + + global::System.Action? xai = null, + + global::System.Action? zai = null, + + global::System.Action? groq = null, + + global::System.Action? deepseek = null, + + global::System.Action? together = null, + + global::System.Action? bedrock = null, + + global::System.Action? baseten = null, + + global::System.Action? openrouter = null, + + global::System.Action? chatgptOauth = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsSglang) + { + sglang?.Invoke(Sglang!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogleAi) + { + googleAi?.Invoke(GoogleAi!); + } + else if (IsGoogleVertex) + { + googleVertex?.Invoke(GoogleVertex!); + } + else if (IsAzure) + { + azure?.Invoke(Azure!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsZai) + { + zai?.Invoke(Zai!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + else if (IsBedrock) + { + bedrock?.Invoke(Bedrock!); + } + else if (IsBaseten) + { + baseten?.Invoke(Baseten!); + } + else if (IsOpenrouter) + { + openrouter?.Invoke(Openrouter!); + } + else if (IsChatgptOauth) + { + chatgptOauth?.Invoke(ChatgptOauth!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? sglang = null, + global::System.Action? anthropic = null, + global::System.Action? googleAi = null, + global::System.Action? googleVertex = null, + global::System.Action? azure = null, + global::System.Action? xai = null, + global::System.Action? zai = null, + global::System.Action? groq = null, + global::System.Action? deepseek = null, + global::System.Action? together = null, + global::System.Action? bedrock = null, + global::System.Action? baseten = null, + global::System.Action? openrouter = null, + global::System.Action? chatgptOauth = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant14.g.cs b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant14.g.cs index 1d87b99a..e3666ec2 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant14.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant14.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenAIModelSettings? value) + { + value = Openai; + return IsOpenai; + } + /// /// SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing). /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSglang => Sglang != null; + /// + /// + /// + public bool TryPickSglang( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SGLangModelSettings? value) + { + value = Sglang; + return IsSglang; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AnthropicModelSettings? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsGoogleAi => GoogleAi != null; + /// + /// + /// + public bool TryPickGoogleAi( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleAIModelSettings? value) + { + value = GoogleAi; + return IsGoogleAi; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsGoogleVertex => GoogleVertex != null; + /// + /// + /// + public bool TryPickGoogleVertex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleVertexModelSettings? value) + { + value = GoogleVertex; + return IsGoogleVertex; + } + /// /// Azure OpenAI model configuration (OpenAI-compatible). /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsAzure => Azure != null; + /// + /// + /// + public bool TryPickAzure( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AzureModelSettings? value) + { + value = Azure; + return IsAzure; + } + /// /// xAI model configuration (OpenAI-compatible). /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.XAIModelSettings? value) + { + value = Xai; + return IsXai; + } + /// /// Z.ai (ZhipuAI) model configuration (OpenAI-compatible). /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsZai => Zai != null; + /// + /// + /// + public bool TryPickZai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ZAIModelSettings? value) + { + value = Zai; + return IsZai; + } + /// /// Groq model configuration (OpenAI-compatible). /// @@ -167,6 +271,19 @@ namespace Letta #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GroqModelSettings? value) + { + value = Groq; + return IsGroq; + } + /// /// Deepseek model configuration (OpenAI-compatible). /// @@ -184,6 +301,19 @@ namespace Letta #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DeepseekModelSettings? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// Together AI model configuration (OpenAI-compatible). /// @@ -201,6 +331,19 @@ namespace Letta #endif public bool IsTogether => Together != null; + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TogetherModelSettings? value) + { + value = Together; + return IsTogether; + } + /// /// AWS Bedrock model configuration. /// @@ -218,6 +361,19 @@ namespace Letta #endif public bool IsBedrock => Bedrock != null; + /// + /// + /// + public bool TryPickBedrock( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BedrockModelSettings? value) + { + value = Bedrock; + return IsBedrock; + } + /// /// Baseten model configuration (OpenAI-compatible). /// @@ -235,6 +391,19 @@ namespace Letta #endif public bool IsBaseten => Baseten != null; + /// + /// + /// + public bool TryPickBaseten( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BasetenModelSettings? value) + { + value = Baseten; + return IsBaseten; + } + /// /// OpenRouter model configuration (OpenAI-compatible). /// @@ -252,6 +421,19 @@ namespace Letta #endif public bool IsOpenrouter => Openrouter != null; + /// + /// + /// + public bool TryPickOpenrouter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenRouterModelSettings? value) + { + value = Openrouter; + return IsOpenrouter; + } + /// /// ChatGPT OAuth model configuration (uses ChatGPT backend API). /// @@ -268,6 +450,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatgptOauth))] #endif public bool IsChatgptOauth => ChatgptOauth != null; + + /// + /// + /// + public bool TryPickChatgptOauth( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChatGPTOAuthModelSettings? value) + { + value = ChatgptOauth; + return IsChatgptOauth; + } /// /// /// @@ -633,21 +828,21 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? openai = null, - global::System.Func? sglang = null, - global::System.Func? anthropic = null, - global::System.Func? googleAi = null, - global::System.Func? googleVertex = null, - global::System.Func? azure = null, - global::System.Func? xai = null, - global::System.Func? zai = null, - global::System.Func? groq = null, - global::System.Func? deepseek = null, - global::System.Func? together = null, - global::System.Func? bedrock = null, - global::System.Func? baseten = null, - global::System.Func? openrouter = null, - global::System.Func? chatgptOauth = null, + global::System.Func? openai = null, + global::System.Func? sglang = null, + global::System.Func? anthropic = null, + global::System.Func? googleAi = null, + global::System.Func? googleVertex = null, + global::System.Func? azure = null, + global::System.Func? xai = null, + global::System.Func? zai = null, + global::System.Func? groq = null, + global::System.Func? deepseek = null, + global::System.Func? together = null, + global::System.Func? bedrock = null, + global::System.Func? baseten = null, + global::System.Func? openrouter = null, + global::System.Func? chatgptOauth = null, bool validate = true) { if (validate) @@ -723,21 +918,123 @@ public bool Validate() /// /// public void Match( - global::System.Action? openai = null, - global::System.Action? sglang = null, - global::System.Action? anthropic = null, - global::System.Action? googleAi = null, - global::System.Action? googleVertex = null, - global::System.Action? azure = null, - global::System.Action? xai = null, - global::System.Action? zai = null, - global::System.Action? groq = null, - global::System.Action? deepseek = null, - global::System.Action? together = null, - global::System.Action? bedrock = null, - global::System.Action? baseten = null, - global::System.Action? openrouter = null, - global::System.Action? chatgptOauth = null, + global::System.Action? openai = null, + + global::System.Action? sglang = null, + + global::System.Action? anthropic = null, + + global::System.Action? googleAi = null, + + global::System.Action? googleVertex = null, + + global::System.Action? azure = null, + + global::System.Action? xai = null, + + global::System.Action? zai = null, + + global::System.Action? groq = null, + + global::System.Action? deepseek = null, + + global::System.Action? together = null, + + global::System.Action? bedrock = null, + + global::System.Action? baseten = null, + + global::System.Action? openrouter = null, + + global::System.Action? chatgptOauth = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsSglang) + { + sglang?.Invoke(Sglang!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogleAi) + { + googleAi?.Invoke(GoogleAi!); + } + else if (IsGoogleVertex) + { + googleVertex?.Invoke(GoogleVertex!); + } + else if (IsAzure) + { + azure?.Invoke(Azure!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsZai) + { + zai?.Invoke(Zai!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + else if (IsBedrock) + { + bedrock?.Invoke(Bedrock!); + } + else if (IsBaseten) + { + baseten?.Invoke(Baseten!); + } + else if (IsOpenrouter) + { + openrouter?.Invoke(Openrouter!); + } + else if (IsChatgptOauth) + { + chatgptOauth?.Invoke(ChatgptOauth!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? sglang = null, + global::System.Action? anthropic = null, + global::System.Action? googleAi = null, + global::System.Action? googleVertex = null, + global::System.Action? azure = null, + global::System.Action? xai = null, + global::System.Action? zai = null, + global::System.Action? groq = null, + global::System.Action? deepseek = null, + global::System.Action? together = null, + global::System.Action? bedrock = null, + global::System.Action? baseten = null, + global::System.Action? openrouter = null, + global::System.Action? chatgptOauth = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant15.g.cs b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant15.g.cs index a6caba98..8b84627c 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant15.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant15.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenAIModelSettings? value) + { + value = Openai; + return IsOpenai; + } + /// /// SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing). /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSglang => Sglang != null; + /// + /// + /// + public bool TryPickSglang( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SGLangModelSettings? value) + { + value = Sglang; + return IsSglang; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AnthropicModelSettings? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsGoogleAi => GoogleAi != null; + /// + /// + /// + public bool TryPickGoogleAi( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleAIModelSettings? value) + { + value = GoogleAi; + return IsGoogleAi; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsGoogleVertex => GoogleVertex != null; + /// + /// + /// + public bool TryPickGoogleVertex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleVertexModelSettings? value) + { + value = GoogleVertex; + return IsGoogleVertex; + } + /// /// Azure OpenAI model configuration (OpenAI-compatible). /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsAzure => Azure != null; + /// + /// + /// + public bool TryPickAzure( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AzureModelSettings? value) + { + value = Azure; + return IsAzure; + } + /// /// xAI model configuration (OpenAI-compatible). /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.XAIModelSettings? value) + { + value = Xai; + return IsXai; + } + /// /// Z.ai (ZhipuAI) model configuration (OpenAI-compatible). /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsZai => Zai != null; + /// + /// + /// + public bool TryPickZai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ZAIModelSettings? value) + { + value = Zai; + return IsZai; + } + /// /// Groq model configuration (OpenAI-compatible). /// @@ -167,6 +271,19 @@ namespace Letta #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GroqModelSettings? value) + { + value = Groq; + return IsGroq; + } + /// /// Deepseek model configuration (OpenAI-compatible). /// @@ -184,6 +301,19 @@ namespace Letta #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DeepseekModelSettings? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// Together AI model configuration (OpenAI-compatible). /// @@ -201,6 +331,19 @@ namespace Letta #endif public bool IsTogether => Together != null; + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TogetherModelSettings? value) + { + value = Together; + return IsTogether; + } + /// /// AWS Bedrock model configuration. /// @@ -218,6 +361,19 @@ namespace Letta #endif public bool IsBedrock => Bedrock != null; + /// + /// + /// + public bool TryPickBedrock( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BedrockModelSettings? value) + { + value = Bedrock; + return IsBedrock; + } + /// /// Baseten model configuration (OpenAI-compatible). /// @@ -235,6 +391,19 @@ namespace Letta #endif public bool IsBaseten => Baseten != null; + /// + /// + /// + public bool TryPickBaseten( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BasetenModelSettings? value) + { + value = Baseten; + return IsBaseten; + } + /// /// OpenRouter model configuration (OpenAI-compatible). /// @@ -252,6 +421,19 @@ namespace Letta #endif public bool IsOpenrouter => Openrouter != null; + /// + /// + /// + public bool TryPickOpenrouter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenRouterModelSettings? value) + { + value = Openrouter; + return IsOpenrouter; + } + /// /// ChatGPT OAuth model configuration (uses ChatGPT backend API). /// @@ -268,6 +450,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatgptOauth))] #endif public bool IsChatgptOauth => ChatgptOauth != null; + + /// + /// + /// + public bool TryPickChatgptOauth( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChatGPTOAuthModelSettings? value) + { + value = ChatgptOauth; + return IsChatgptOauth; + } /// /// /// @@ -633,21 +828,21 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? openai = null, - global::System.Func? sglang = null, - global::System.Func? anthropic = null, - global::System.Func? googleAi = null, - global::System.Func? googleVertex = null, - global::System.Func? azure = null, - global::System.Func? xai = null, - global::System.Func? zai = null, - global::System.Func? groq = null, - global::System.Func? deepseek = null, - global::System.Func? together = null, - global::System.Func? bedrock = null, - global::System.Func? baseten = null, - global::System.Func? openrouter = null, - global::System.Func? chatgptOauth = null, + global::System.Func? openai = null, + global::System.Func? sglang = null, + global::System.Func? anthropic = null, + global::System.Func? googleAi = null, + global::System.Func? googleVertex = null, + global::System.Func? azure = null, + global::System.Func? xai = null, + global::System.Func? zai = null, + global::System.Func? groq = null, + global::System.Func? deepseek = null, + global::System.Func? together = null, + global::System.Func? bedrock = null, + global::System.Func? baseten = null, + global::System.Func? openrouter = null, + global::System.Func? chatgptOauth = null, bool validate = true) { if (validate) @@ -723,21 +918,123 @@ public bool Validate() /// /// public void Match( - global::System.Action? openai = null, - global::System.Action? sglang = null, - global::System.Action? anthropic = null, - global::System.Action? googleAi = null, - global::System.Action? googleVertex = null, - global::System.Action? azure = null, - global::System.Action? xai = null, - global::System.Action? zai = null, - global::System.Action? groq = null, - global::System.Action? deepseek = null, - global::System.Action? together = null, - global::System.Action? bedrock = null, - global::System.Action? baseten = null, - global::System.Action? openrouter = null, - global::System.Action? chatgptOauth = null, + global::System.Action? openai = null, + + global::System.Action? sglang = null, + + global::System.Action? anthropic = null, + + global::System.Action? googleAi = null, + + global::System.Action? googleVertex = null, + + global::System.Action? azure = null, + + global::System.Action? xai = null, + + global::System.Action? zai = null, + + global::System.Action? groq = null, + + global::System.Action? deepseek = null, + + global::System.Action? together = null, + + global::System.Action? bedrock = null, + + global::System.Action? baseten = null, + + global::System.Action? openrouter = null, + + global::System.Action? chatgptOauth = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsSglang) + { + sglang?.Invoke(Sglang!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogleAi) + { + googleAi?.Invoke(GoogleAi!); + } + else if (IsGoogleVertex) + { + googleVertex?.Invoke(GoogleVertex!); + } + else if (IsAzure) + { + azure?.Invoke(Azure!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsZai) + { + zai?.Invoke(Zai!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + else if (IsBedrock) + { + bedrock?.Invoke(Bedrock!); + } + else if (IsBaseten) + { + baseten?.Invoke(Baseten!); + } + else if (IsOpenrouter) + { + openrouter?.Invoke(Openrouter!); + } + else if (IsChatgptOauth) + { + chatgptOauth?.Invoke(ChatgptOauth!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? sglang = null, + global::System.Action? anthropic = null, + global::System.Action? googleAi = null, + global::System.Action? googleVertex = null, + global::System.Action? azure = null, + global::System.Action? xai = null, + global::System.Action? zai = null, + global::System.Action? groq = null, + global::System.Action? deepseek = null, + global::System.Action? together = null, + global::System.Action? bedrock = null, + global::System.Action? baseten = null, + global::System.Action? openrouter = null, + global::System.Action? chatgptOauth = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant16.g.cs b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant16.g.cs index be567d67..cef11327 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant16.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant16.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenAIModelSettings? value) + { + value = Openai; + return IsOpenai; + } + /// /// SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing). /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSglang => Sglang != null; + /// + /// + /// + public bool TryPickSglang( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SGLangModelSettings? value) + { + value = Sglang; + return IsSglang; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AnthropicModelSettings? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsGoogleAi => GoogleAi != null; + /// + /// + /// + public bool TryPickGoogleAi( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleAIModelSettings? value) + { + value = GoogleAi; + return IsGoogleAi; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsGoogleVertex => GoogleVertex != null; + /// + /// + /// + public bool TryPickGoogleVertex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleVertexModelSettings? value) + { + value = GoogleVertex; + return IsGoogleVertex; + } + /// /// Azure OpenAI model configuration (OpenAI-compatible). /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsAzure => Azure != null; + /// + /// + /// + public bool TryPickAzure( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AzureModelSettings? value) + { + value = Azure; + return IsAzure; + } + /// /// xAI model configuration (OpenAI-compatible). /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.XAIModelSettings? value) + { + value = Xai; + return IsXai; + } + /// /// Z.ai (ZhipuAI) model configuration (OpenAI-compatible). /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsZai => Zai != null; + /// + /// + /// + public bool TryPickZai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ZAIModelSettings? value) + { + value = Zai; + return IsZai; + } + /// /// Groq model configuration (OpenAI-compatible). /// @@ -167,6 +271,19 @@ namespace Letta #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GroqModelSettings? value) + { + value = Groq; + return IsGroq; + } + /// /// Deepseek model configuration (OpenAI-compatible). /// @@ -184,6 +301,19 @@ namespace Letta #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DeepseekModelSettings? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// Together AI model configuration (OpenAI-compatible). /// @@ -201,6 +331,19 @@ namespace Letta #endif public bool IsTogether => Together != null; + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TogetherModelSettings? value) + { + value = Together; + return IsTogether; + } + /// /// AWS Bedrock model configuration. /// @@ -218,6 +361,19 @@ namespace Letta #endif public bool IsBedrock => Bedrock != null; + /// + /// + /// + public bool TryPickBedrock( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BedrockModelSettings? value) + { + value = Bedrock; + return IsBedrock; + } + /// /// Baseten model configuration (OpenAI-compatible). /// @@ -235,6 +391,19 @@ namespace Letta #endif public bool IsBaseten => Baseten != null; + /// + /// + /// + public bool TryPickBaseten( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BasetenModelSettings? value) + { + value = Baseten; + return IsBaseten; + } + /// /// OpenRouter model configuration (OpenAI-compatible). /// @@ -252,6 +421,19 @@ namespace Letta #endif public bool IsOpenrouter => Openrouter != null; + /// + /// + /// + public bool TryPickOpenrouter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenRouterModelSettings? value) + { + value = Openrouter; + return IsOpenrouter; + } + /// /// ChatGPT OAuth model configuration (uses ChatGPT backend API). /// @@ -268,6 +450,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatgptOauth))] #endif public bool IsChatgptOauth => ChatgptOauth != null; + + /// + /// + /// + public bool TryPickChatgptOauth( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChatGPTOAuthModelSettings? value) + { + value = ChatgptOauth; + return IsChatgptOauth; + } /// /// /// @@ -633,21 +828,21 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? openai = null, - global::System.Func? sglang = null, - global::System.Func? anthropic = null, - global::System.Func? googleAi = null, - global::System.Func? googleVertex = null, - global::System.Func? azure = null, - global::System.Func? xai = null, - global::System.Func? zai = null, - global::System.Func? groq = null, - global::System.Func? deepseek = null, - global::System.Func? together = null, - global::System.Func? bedrock = null, - global::System.Func? baseten = null, - global::System.Func? openrouter = null, - global::System.Func? chatgptOauth = null, + global::System.Func? openai = null, + global::System.Func? sglang = null, + global::System.Func? anthropic = null, + global::System.Func? googleAi = null, + global::System.Func? googleVertex = null, + global::System.Func? azure = null, + global::System.Func? xai = null, + global::System.Func? zai = null, + global::System.Func? groq = null, + global::System.Func? deepseek = null, + global::System.Func? together = null, + global::System.Func? bedrock = null, + global::System.Func? baseten = null, + global::System.Func? openrouter = null, + global::System.Func? chatgptOauth = null, bool validate = true) { if (validate) @@ -723,21 +918,123 @@ public bool Validate() /// /// public void Match( - global::System.Action? openai = null, - global::System.Action? sglang = null, - global::System.Action? anthropic = null, - global::System.Action? googleAi = null, - global::System.Action? googleVertex = null, - global::System.Action? azure = null, - global::System.Action? xai = null, - global::System.Action? zai = null, - global::System.Action? groq = null, - global::System.Action? deepseek = null, - global::System.Action? together = null, - global::System.Action? bedrock = null, - global::System.Action? baseten = null, - global::System.Action? openrouter = null, - global::System.Action? chatgptOauth = null, + global::System.Action? openai = null, + + global::System.Action? sglang = null, + + global::System.Action? anthropic = null, + + global::System.Action? googleAi = null, + + global::System.Action? googleVertex = null, + + global::System.Action? azure = null, + + global::System.Action? xai = null, + + global::System.Action? zai = null, + + global::System.Action? groq = null, + + global::System.Action? deepseek = null, + + global::System.Action? together = null, + + global::System.Action? bedrock = null, + + global::System.Action? baseten = null, + + global::System.Action? openrouter = null, + + global::System.Action? chatgptOauth = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsSglang) + { + sglang?.Invoke(Sglang!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogleAi) + { + googleAi?.Invoke(GoogleAi!); + } + else if (IsGoogleVertex) + { + googleVertex?.Invoke(GoogleVertex!); + } + else if (IsAzure) + { + azure?.Invoke(Azure!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsZai) + { + zai?.Invoke(Zai!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + else if (IsBedrock) + { + bedrock?.Invoke(Bedrock!); + } + else if (IsBaseten) + { + baseten?.Invoke(Baseten!); + } + else if (IsOpenrouter) + { + openrouter?.Invoke(Openrouter!); + } + else if (IsChatgptOauth) + { + chatgptOauth?.Invoke(ChatgptOauth!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? sglang = null, + global::System.Action? anthropic = null, + global::System.Action? googleAi = null, + global::System.Action? googleVertex = null, + global::System.Action? azure = null, + global::System.Action? xai = null, + global::System.Action? zai = null, + global::System.Action? groq = null, + global::System.Action? deepseek = null, + global::System.Action? together = null, + global::System.Action? bedrock = null, + global::System.Action? baseten = null, + global::System.Action? openrouter = null, + global::System.Action? chatgptOauth = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant17.g.cs b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant17.g.cs index 46ec07b6..c1f81d43 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant17.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant17.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenAIModelSettings? value) + { + value = Openai; + return IsOpenai; + } + /// /// SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing). /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSglang => Sglang != null; + /// + /// + /// + public bool TryPickSglang( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SGLangModelSettings? value) + { + value = Sglang; + return IsSglang; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AnthropicModelSettings? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsGoogleAi => GoogleAi != null; + /// + /// + /// + public bool TryPickGoogleAi( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleAIModelSettings? value) + { + value = GoogleAi; + return IsGoogleAi; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsGoogleVertex => GoogleVertex != null; + /// + /// + /// + public bool TryPickGoogleVertex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleVertexModelSettings? value) + { + value = GoogleVertex; + return IsGoogleVertex; + } + /// /// Azure OpenAI model configuration (OpenAI-compatible). /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsAzure => Azure != null; + /// + /// + /// + public bool TryPickAzure( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AzureModelSettings? value) + { + value = Azure; + return IsAzure; + } + /// /// xAI model configuration (OpenAI-compatible). /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.XAIModelSettings? value) + { + value = Xai; + return IsXai; + } + /// /// Z.ai (ZhipuAI) model configuration (OpenAI-compatible). /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsZai => Zai != null; + /// + /// + /// + public bool TryPickZai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ZAIModelSettings? value) + { + value = Zai; + return IsZai; + } + /// /// Groq model configuration (OpenAI-compatible). /// @@ -167,6 +271,19 @@ namespace Letta #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GroqModelSettings? value) + { + value = Groq; + return IsGroq; + } + /// /// Deepseek model configuration (OpenAI-compatible). /// @@ -184,6 +301,19 @@ namespace Letta #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DeepseekModelSettings? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// Together AI model configuration (OpenAI-compatible). /// @@ -201,6 +331,19 @@ namespace Letta #endif public bool IsTogether => Together != null; + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TogetherModelSettings? value) + { + value = Together; + return IsTogether; + } + /// /// AWS Bedrock model configuration. /// @@ -218,6 +361,19 @@ namespace Letta #endif public bool IsBedrock => Bedrock != null; + /// + /// + /// + public bool TryPickBedrock( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BedrockModelSettings? value) + { + value = Bedrock; + return IsBedrock; + } + /// /// Baseten model configuration (OpenAI-compatible). /// @@ -235,6 +391,19 @@ namespace Letta #endif public bool IsBaseten => Baseten != null; + /// + /// + /// + public bool TryPickBaseten( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BasetenModelSettings? value) + { + value = Baseten; + return IsBaseten; + } + /// /// OpenRouter model configuration (OpenAI-compatible). /// @@ -252,6 +421,19 @@ namespace Letta #endif public bool IsOpenrouter => Openrouter != null; + /// + /// + /// + public bool TryPickOpenrouter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenRouterModelSettings? value) + { + value = Openrouter; + return IsOpenrouter; + } + /// /// ChatGPT OAuth model configuration (uses ChatGPT backend API). /// @@ -268,6 +450,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatgptOauth))] #endif public bool IsChatgptOauth => ChatgptOauth != null; + + /// + /// + /// + public bool TryPickChatgptOauth( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChatGPTOAuthModelSettings? value) + { + value = ChatgptOauth; + return IsChatgptOauth; + } /// /// /// @@ -633,21 +828,21 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? openai = null, - global::System.Func? sglang = null, - global::System.Func? anthropic = null, - global::System.Func? googleAi = null, - global::System.Func? googleVertex = null, - global::System.Func? azure = null, - global::System.Func? xai = null, - global::System.Func? zai = null, - global::System.Func? groq = null, - global::System.Func? deepseek = null, - global::System.Func? together = null, - global::System.Func? bedrock = null, - global::System.Func? baseten = null, - global::System.Func? openrouter = null, - global::System.Func? chatgptOauth = null, + global::System.Func? openai = null, + global::System.Func? sglang = null, + global::System.Func? anthropic = null, + global::System.Func? googleAi = null, + global::System.Func? googleVertex = null, + global::System.Func? azure = null, + global::System.Func? xai = null, + global::System.Func? zai = null, + global::System.Func? groq = null, + global::System.Func? deepseek = null, + global::System.Func? together = null, + global::System.Func? bedrock = null, + global::System.Func? baseten = null, + global::System.Func? openrouter = null, + global::System.Func? chatgptOauth = null, bool validate = true) { if (validate) @@ -723,21 +918,123 @@ public bool Validate() /// /// public void Match( - global::System.Action? openai = null, - global::System.Action? sglang = null, - global::System.Action? anthropic = null, - global::System.Action? googleAi = null, - global::System.Action? googleVertex = null, - global::System.Action? azure = null, - global::System.Action? xai = null, - global::System.Action? zai = null, - global::System.Action? groq = null, - global::System.Action? deepseek = null, - global::System.Action? together = null, - global::System.Action? bedrock = null, - global::System.Action? baseten = null, - global::System.Action? openrouter = null, - global::System.Action? chatgptOauth = null, + global::System.Action? openai = null, + + global::System.Action? sglang = null, + + global::System.Action? anthropic = null, + + global::System.Action? googleAi = null, + + global::System.Action? googleVertex = null, + + global::System.Action? azure = null, + + global::System.Action? xai = null, + + global::System.Action? zai = null, + + global::System.Action? groq = null, + + global::System.Action? deepseek = null, + + global::System.Action? together = null, + + global::System.Action? bedrock = null, + + global::System.Action? baseten = null, + + global::System.Action? openrouter = null, + + global::System.Action? chatgptOauth = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsSglang) + { + sglang?.Invoke(Sglang!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogleAi) + { + googleAi?.Invoke(GoogleAi!); + } + else if (IsGoogleVertex) + { + googleVertex?.Invoke(GoogleVertex!); + } + else if (IsAzure) + { + azure?.Invoke(Azure!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsZai) + { + zai?.Invoke(Zai!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + else if (IsBedrock) + { + bedrock?.Invoke(Bedrock!); + } + else if (IsBaseten) + { + baseten?.Invoke(Baseten!); + } + else if (IsOpenrouter) + { + openrouter?.Invoke(Openrouter!); + } + else if (IsChatgptOauth) + { + chatgptOauth?.Invoke(ChatgptOauth!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? sglang = null, + global::System.Action? anthropic = null, + global::System.Action? googleAi = null, + global::System.Action? googleVertex = null, + global::System.Action? azure = null, + global::System.Action? xai = null, + global::System.Action? zai = null, + global::System.Action? groq = null, + global::System.Action? deepseek = null, + global::System.Action? together = null, + global::System.Action? bedrock = null, + global::System.Action? baseten = null, + global::System.Action? openrouter = null, + global::System.Action? chatgptOauth = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant18.g.cs b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant18.g.cs index 1408d423..cda890a4 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant18.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant18.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenAIModelSettings? value) + { + value = Openai; + return IsOpenai; + } + /// /// SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing). /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSglang => Sglang != null; + /// + /// + /// + public bool TryPickSglang( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SGLangModelSettings? value) + { + value = Sglang; + return IsSglang; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AnthropicModelSettings? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsGoogleAi => GoogleAi != null; + /// + /// + /// + public bool TryPickGoogleAi( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleAIModelSettings? value) + { + value = GoogleAi; + return IsGoogleAi; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsGoogleVertex => GoogleVertex != null; + /// + /// + /// + public bool TryPickGoogleVertex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleVertexModelSettings? value) + { + value = GoogleVertex; + return IsGoogleVertex; + } + /// /// Azure OpenAI model configuration (OpenAI-compatible). /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsAzure => Azure != null; + /// + /// + /// + public bool TryPickAzure( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AzureModelSettings? value) + { + value = Azure; + return IsAzure; + } + /// /// xAI model configuration (OpenAI-compatible). /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.XAIModelSettings? value) + { + value = Xai; + return IsXai; + } + /// /// Z.ai (ZhipuAI) model configuration (OpenAI-compatible). /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsZai => Zai != null; + /// + /// + /// + public bool TryPickZai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ZAIModelSettings? value) + { + value = Zai; + return IsZai; + } + /// /// Groq model configuration (OpenAI-compatible). /// @@ -167,6 +271,19 @@ namespace Letta #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GroqModelSettings? value) + { + value = Groq; + return IsGroq; + } + /// /// Deepseek model configuration (OpenAI-compatible). /// @@ -184,6 +301,19 @@ namespace Letta #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DeepseekModelSettings? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// Together AI model configuration (OpenAI-compatible). /// @@ -201,6 +331,19 @@ namespace Letta #endif public bool IsTogether => Together != null; + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TogetherModelSettings? value) + { + value = Together; + return IsTogether; + } + /// /// AWS Bedrock model configuration. /// @@ -218,6 +361,19 @@ namespace Letta #endif public bool IsBedrock => Bedrock != null; + /// + /// + /// + public bool TryPickBedrock( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BedrockModelSettings? value) + { + value = Bedrock; + return IsBedrock; + } + /// /// Baseten model configuration (OpenAI-compatible). /// @@ -235,6 +391,19 @@ namespace Letta #endif public bool IsBaseten => Baseten != null; + /// + /// + /// + public bool TryPickBaseten( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BasetenModelSettings? value) + { + value = Baseten; + return IsBaseten; + } + /// /// OpenRouter model configuration (OpenAI-compatible). /// @@ -252,6 +421,19 @@ namespace Letta #endif public bool IsOpenrouter => Openrouter != null; + /// + /// + /// + public bool TryPickOpenrouter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenRouterModelSettings? value) + { + value = Openrouter; + return IsOpenrouter; + } + /// /// ChatGPT OAuth model configuration (uses ChatGPT backend API). /// @@ -268,6 +450,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatgptOauth))] #endif public bool IsChatgptOauth => ChatgptOauth != null; + + /// + /// + /// + public bool TryPickChatgptOauth( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChatGPTOAuthModelSettings? value) + { + value = ChatgptOauth; + return IsChatgptOauth; + } /// /// /// @@ -633,21 +828,21 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? openai = null, - global::System.Func? sglang = null, - global::System.Func? anthropic = null, - global::System.Func? googleAi = null, - global::System.Func? googleVertex = null, - global::System.Func? azure = null, - global::System.Func? xai = null, - global::System.Func? zai = null, - global::System.Func? groq = null, - global::System.Func? deepseek = null, - global::System.Func? together = null, - global::System.Func? bedrock = null, - global::System.Func? baseten = null, - global::System.Func? openrouter = null, - global::System.Func? chatgptOauth = null, + global::System.Func? openai = null, + global::System.Func? sglang = null, + global::System.Func? anthropic = null, + global::System.Func? googleAi = null, + global::System.Func? googleVertex = null, + global::System.Func? azure = null, + global::System.Func? xai = null, + global::System.Func? zai = null, + global::System.Func? groq = null, + global::System.Func? deepseek = null, + global::System.Func? together = null, + global::System.Func? bedrock = null, + global::System.Func? baseten = null, + global::System.Func? openrouter = null, + global::System.Func? chatgptOauth = null, bool validate = true) { if (validate) @@ -723,21 +918,123 @@ public bool Validate() /// /// public void Match( - global::System.Action? openai = null, - global::System.Action? sglang = null, - global::System.Action? anthropic = null, - global::System.Action? googleAi = null, - global::System.Action? googleVertex = null, - global::System.Action? azure = null, - global::System.Action? xai = null, - global::System.Action? zai = null, - global::System.Action? groq = null, - global::System.Action? deepseek = null, - global::System.Action? together = null, - global::System.Action? bedrock = null, - global::System.Action? baseten = null, - global::System.Action? openrouter = null, - global::System.Action? chatgptOauth = null, + global::System.Action? openai = null, + + global::System.Action? sglang = null, + + global::System.Action? anthropic = null, + + global::System.Action? googleAi = null, + + global::System.Action? googleVertex = null, + + global::System.Action? azure = null, + + global::System.Action? xai = null, + + global::System.Action? zai = null, + + global::System.Action? groq = null, + + global::System.Action? deepseek = null, + + global::System.Action? together = null, + + global::System.Action? bedrock = null, + + global::System.Action? baseten = null, + + global::System.Action? openrouter = null, + + global::System.Action? chatgptOauth = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsSglang) + { + sglang?.Invoke(Sglang!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogleAi) + { + googleAi?.Invoke(GoogleAi!); + } + else if (IsGoogleVertex) + { + googleVertex?.Invoke(GoogleVertex!); + } + else if (IsAzure) + { + azure?.Invoke(Azure!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsZai) + { + zai?.Invoke(Zai!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + else if (IsBedrock) + { + bedrock?.Invoke(Bedrock!); + } + else if (IsBaseten) + { + baseten?.Invoke(Baseten!); + } + else if (IsOpenrouter) + { + openrouter?.Invoke(Openrouter!); + } + else if (IsChatgptOauth) + { + chatgptOauth?.Invoke(ChatgptOauth!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? sglang = null, + global::System.Action? anthropic = null, + global::System.Action? googleAi = null, + global::System.Action? googleVertex = null, + global::System.Action? azure = null, + global::System.Action? xai = null, + global::System.Action? zai = null, + global::System.Action? groq = null, + global::System.Action? deepseek = null, + global::System.Action? together = null, + global::System.Action? bedrock = null, + global::System.Action? baseten = null, + global::System.Action? openrouter = null, + global::System.Action? chatgptOauth = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant19.g.cs b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant19.g.cs index 1f546172..58114e60 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant19.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModelSettingsVariant19.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsOpenai => Openai != null; + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenAIModelSettings? value) + { + value = Openai; + return IsOpenai; + } + /// /// SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing). /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsSglang => Sglang != null; + /// + /// + /// + public bool TryPickSglang( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SGLangModelSettings? value) + { + value = Sglang; + return IsSglang; + } + /// /// /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsAnthropic => Anthropic != null; + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AnthropicModelSettings? value) + { + value = Anthropic; + return IsAnthropic; + } + /// /// /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsGoogleAi => GoogleAi != null; + /// + /// + /// + public bool TryPickGoogleAi( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleAIModelSettings? value) + { + value = GoogleAi; + return IsGoogleAi; + } + /// /// /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsGoogleVertex => GoogleVertex != null; + /// + /// + /// + public bool TryPickGoogleVertex( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GoogleVertexModelSettings? value) + { + value = GoogleVertex; + return IsGoogleVertex; + } + /// /// Azure OpenAI model configuration (OpenAI-compatible). /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsAzure => Azure != null; + /// + /// + /// + public bool TryPickAzure( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AzureModelSettings? value) + { + value = Azure; + return IsAzure; + } + /// /// xAI model configuration (OpenAI-compatible). /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsXai => Xai != null; + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.XAIModelSettings? value) + { + value = Xai; + return IsXai; + } + /// /// Z.ai (ZhipuAI) model configuration (OpenAI-compatible). /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsZai => Zai != null; + /// + /// + /// + public bool TryPickZai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ZAIModelSettings? value) + { + value = Zai; + return IsZai; + } + /// /// Groq model configuration (OpenAI-compatible). /// @@ -167,6 +271,19 @@ namespace Letta #endif public bool IsGroq => Groq != null; + /// + /// + /// + public bool TryPickGroq( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.GroqModelSettings? value) + { + value = Groq; + return IsGroq; + } + /// /// Deepseek model configuration (OpenAI-compatible). /// @@ -184,6 +301,19 @@ namespace Letta #endif public bool IsDeepseek => Deepseek != null; + /// + /// + /// + public bool TryPickDeepseek( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.DeepseekModelSettings? value) + { + value = Deepseek; + return IsDeepseek; + } + /// /// Together AI model configuration (OpenAI-compatible). /// @@ -201,6 +331,19 @@ namespace Letta #endif public bool IsTogether => Together != null; + /// + /// + /// + public bool TryPickTogether( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TogetherModelSettings? value) + { + value = Together; + return IsTogether; + } + /// /// AWS Bedrock model configuration. /// @@ -218,6 +361,19 @@ namespace Letta #endif public bool IsBedrock => Bedrock != null; + /// + /// + /// + public bool TryPickBedrock( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BedrockModelSettings? value) + { + value = Bedrock; + return IsBedrock; + } + /// /// Baseten model configuration (OpenAI-compatible). /// @@ -235,6 +391,19 @@ namespace Letta #endif public bool IsBaseten => Baseten != null; + /// + /// + /// + public bool TryPickBaseten( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.BasetenModelSettings? value) + { + value = Baseten; + return IsBaseten; + } + /// /// OpenRouter model configuration (OpenAI-compatible). /// @@ -252,6 +421,19 @@ namespace Letta #endif public bool IsOpenrouter => Openrouter != null; + /// + /// + /// + public bool TryPickOpenrouter( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.OpenRouterModelSettings? value) + { + value = Openrouter; + return IsOpenrouter; + } + /// /// ChatGPT OAuth model configuration (uses ChatGPT backend API). /// @@ -268,6 +450,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatgptOauth))] #endif public bool IsChatgptOauth => ChatgptOauth != null; + + /// + /// + /// + public bool TryPickChatgptOauth( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChatGPTOAuthModelSettings? value) + { + value = ChatgptOauth; + return IsChatgptOauth; + } /// /// /// @@ -633,21 +828,21 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? openai = null, - global::System.Func? sglang = null, - global::System.Func? anthropic = null, - global::System.Func? googleAi = null, - global::System.Func? googleVertex = null, - global::System.Func? azure = null, - global::System.Func? xai = null, - global::System.Func? zai = null, - global::System.Func? groq = null, - global::System.Func? deepseek = null, - global::System.Func? together = null, - global::System.Func? bedrock = null, - global::System.Func? baseten = null, - global::System.Func? openrouter = null, - global::System.Func? chatgptOauth = null, + global::System.Func? openai = null, + global::System.Func? sglang = null, + global::System.Func? anthropic = null, + global::System.Func? googleAi = null, + global::System.Func? googleVertex = null, + global::System.Func? azure = null, + global::System.Func? xai = null, + global::System.Func? zai = null, + global::System.Func? groq = null, + global::System.Func? deepseek = null, + global::System.Func? together = null, + global::System.Func? bedrock = null, + global::System.Func? baseten = null, + global::System.Func? openrouter = null, + global::System.Func? chatgptOauth = null, bool validate = true) { if (validate) @@ -723,21 +918,123 @@ public bool Validate() /// /// public void Match( - global::System.Action? openai = null, - global::System.Action? sglang = null, - global::System.Action? anthropic = null, - global::System.Action? googleAi = null, - global::System.Action? googleVertex = null, - global::System.Action? azure = null, - global::System.Action? xai = null, - global::System.Action? zai = null, - global::System.Action? groq = null, - global::System.Action? deepseek = null, - global::System.Action? together = null, - global::System.Action? bedrock = null, - global::System.Action? baseten = null, - global::System.Action? openrouter = null, - global::System.Action? chatgptOauth = null, + global::System.Action? openai = null, + + global::System.Action? sglang = null, + + global::System.Action? anthropic = null, + + global::System.Action? googleAi = null, + + global::System.Action? googleVertex = null, + + global::System.Action? azure = null, + + global::System.Action? xai = null, + + global::System.Action? zai = null, + + global::System.Action? groq = null, + + global::System.Action? deepseek = null, + + global::System.Action? together = null, + + global::System.Action? bedrock = null, + + global::System.Action? baseten = null, + + global::System.Action? openrouter = null, + + global::System.Action? chatgptOauth = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsOpenai) + { + openai?.Invoke(Openai!); + } + else if (IsSglang) + { + sglang?.Invoke(Sglang!); + } + else if (IsAnthropic) + { + anthropic?.Invoke(Anthropic!); + } + else if (IsGoogleAi) + { + googleAi?.Invoke(GoogleAi!); + } + else if (IsGoogleVertex) + { + googleVertex?.Invoke(GoogleVertex!); + } + else if (IsAzure) + { + azure?.Invoke(Azure!); + } + else if (IsXai) + { + xai?.Invoke(Xai!); + } + else if (IsZai) + { + zai?.Invoke(Zai!); + } + else if (IsGroq) + { + groq?.Invoke(Groq!); + } + else if (IsDeepseek) + { + deepseek?.Invoke(Deepseek!); + } + else if (IsTogether) + { + together?.Invoke(Together!); + } + else if (IsBedrock) + { + bedrock?.Invoke(Bedrock!); + } + else if (IsBaseten) + { + baseten?.Invoke(Baseten!); + } + else if (IsOpenrouter) + { + openrouter?.Invoke(Openrouter!); + } + else if (IsChatgptOauth) + { + chatgptOauth?.Invoke(ChatgptOauth!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? openai = null, + global::System.Action? sglang = null, + global::System.Action? anthropic = null, + global::System.Action? googleAi = null, + global::System.Action? googleVertex = null, + global::System.Action? azure = null, + global::System.Action? xai = null, + global::System.Action? zai = null, + global::System.Action? groq = null, + global::System.Action? deepseek = null, + global::System.Action? together = null, + global::System.Action? bedrock = null, + global::System.Action? baseten = null, + global::System.Action? openrouter = null, + global::System.Action? chatgptOauth = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModifyGroupMessageResponse.g.cs b/src/libs/Letta/Generated/Letta.Models.ModifyGroupMessageResponse.g.cs index 0b5cff64..949894cd 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModifyGroupMessageResponse.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModifyGroupMessageResponse.g.cs @@ -36,6 +36,19 @@ namespace Letta #endif public bool IsSystemMessage => SystemMessage != null; + /// + /// + /// + public bool TryPickSystemMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SystemMessage? value) + { + value = SystemMessage; + return IsSystemMessage; + } + /// /// A message sent by the user. Never streamed back on a response, only used for cursor pagination.
/// Args:
@@ -58,6 +71,19 @@ namespace Letta #endif public bool IsUserMessage => UserMessage != null; + /// + /// + /// + public bool TryPickUserMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.UserMessage? value) + { + value = UserMessage; + return IsUserMessage; + } + /// /// Representation of an agent's internal reasoning.
/// Args:
@@ -83,6 +109,19 @@ namespace Letta #endif public bool IsReasoningMessage => ReasoningMessage != null; + /// + /// + /// + public bool TryPickReasoningMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningMessage? value) + { + value = ReasoningMessage; + return IsReasoningMessage; + } + /// /// Representation of an agent's internal reasoning where reasoning content
/// has been hidden from the response.
@@ -108,6 +147,19 @@ namespace Letta #endif public bool IsHiddenReasoningMessage => HiddenReasoningMessage != null; + /// + /// + /// + public bool TryPickHiddenReasoningMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.HiddenReasoningMessage? value) + { + value = HiddenReasoningMessage; + return IsHiddenReasoningMessage; + } + /// /// A message representing a request to call a tool (generated by the LLM to trigger tool execution).
/// Args:
@@ -130,6 +182,19 @@ namespace Letta #endif public bool IsToolCallMessage => ToolCallMessage != null; + /// + /// + /// + public bool TryPickToolCallMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallMessage? value) + { + value = ToolCallMessage; + return IsToolCallMessage; + } + /// /// A message representing the return value of a tool call (generated by Letta executing the requested tool).
/// Args:
@@ -157,6 +222,19 @@ namespace Letta #endif public bool IsToolReturnMessage => ToolReturnMessage != null; + /// + /// + /// + public bool TryPickToolReturnMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnMessage? value) + { + value = ToolReturnMessage; + return IsToolReturnMessage; + } + /// /// A message sent by the LLM in response to user input. Used in the LLM context.
/// Args:
@@ -179,6 +257,19 @@ namespace Letta #endif public bool IsAssistantMessage => AssistantMessage != null; + /// + /// + /// + public bool TryPickAssistantMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AssistantMessage? value) + { + value = AssistantMessage; + return IsAssistantMessage; + } + /// /// A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
/// Args:
@@ -201,6 +292,19 @@ namespace Letta #endif public bool IsApprovalRequestMessage => ApprovalRequestMessage != null; + /// + /// + /// + public bool TryPickApprovalRequestMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalRequestMessage? value) + { + value = ApprovalRequestMessage; + return IsApprovalRequestMessage; + } + /// /// A message representing a response form the user indicating whether a tool has been approved to run.
/// Args:
@@ -225,6 +329,19 @@ namespace Letta #endif public bool IsApprovalResponseMessage => ApprovalResponseMessage != null; + /// + /// + /// + public bool TryPickApprovalResponseMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalResponseMessage? value) + { + value = ApprovalResponseMessage; + return IsApprovalResponseMessage; + } + /// /// A message representing a summary of the conversation. Sent to the LLM as a user or system message depending on the provider. /// @@ -242,6 +359,19 @@ namespace Letta #endif public bool IsSummaryMessage => SummaryMessage != null; + /// + /// + /// + public bool TryPickSummaryMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SummaryMessage? value) + { + value = SummaryMessage; + return IsSummaryMessage; + } + /// /// A message for notifying the developer that an event that has occured (e.g. a compaction). Events are NOT part of the context window. /// @@ -258,6 +388,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(EventMessage))] #endif public bool IsEventMessage => EventMessage != null; + + /// + /// + /// + public bool TryPickEventMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.EventMessage? value) + { + value = EventMessage; + return IsEventMessage; + } /// /// /// @@ -535,17 +678,17 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? systemMessage = null, - global::System.Func? userMessage = null, - global::System.Func? reasoningMessage = null, - global::System.Func? hiddenReasoningMessage = null, - global::System.Func? toolCallMessage = null, - global::System.Func? toolReturnMessage = null, - global::System.Func? assistantMessage = null, - global::System.Func? approvalRequestMessage = null, - global::System.Func? approvalResponseMessage = null, - global::System.Func? summaryMessage = null, - global::System.Func? eventMessage = null, + global::System.Func? systemMessage = null, + global::System.Func? userMessage = null, + global::System.Func? reasoningMessage = null, + global::System.Func? hiddenReasoningMessage = null, + global::System.Func? toolCallMessage = null, + global::System.Func? toolReturnMessage = null, + global::System.Func? assistantMessage = null, + global::System.Func? approvalRequestMessage = null, + global::System.Func? approvalResponseMessage = null, + global::System.Func? summaryMessage = null, + global::System.Func? eventMessage = null, bool validate = true) { if (validate) @@ -605,17 +748,95 @@ public bool Validate() /// ///
public void Match( - global::System.Action? systemMessage = null, - global::System.Action? userMessage = null, - global::System.Action? reasoningMessage = null, - global::System.Action? hiddenReasoningMessage = null, - global::System.Action? toolCallMessage = null, - global::System.Action? toolReturnMessage = null, - global::System.Action? assistantMessage = null, - global::System.Action? approvalRequestMessage = null, - global::System.Action? approvalResponseMessage = null, - global::System.Action? summaryMessage = null, - global::System.Action? eventMessage = null, + global::System.Action? systemMessage = null, + + global::System.Action? userMessage = null, + + global::System.Action? reasoningMessage = null, + + global::System.Action? hiddenReasoningMessage = null, + + global::System.Action? toolCallMessage = null, + + global::System.Action? toolReturnMessage = null, + + global::System.Action? assistantMessage = null, + + global::System.Action? approvalRequestMessage = null, + + global::System.Action? approvalResponseMessage = null, + + global::System.Action? summaryMessage = null, + + global::System.Action? eventMessage = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSystemMessage) + { + systemMessage?.Invoke(SystemMessage!); + } + else if (IsUserMessage) + { + userMessage?.Invoke(UserMessage!); + } + else if (IsReasoningMessage) + { + reasoningMessage?.Invoke(ReasoningMessage!); + } + else if (IsHiddenReasoningMessage) + { + hiddenReasoningMessage?.Invoke(HiddenReasoningMessage!); + } + else if (IsToolCallMessage) + { + toolCallMessage?.Invoke(ToolCallMessage!); + } + else if (IsToolReturnMessage) + { + toolReturnMessage?.Invoke(ToolReturnMessage!); + } + else if (IsAssistantMessage) + { + assistantMessage?.Invoke(AssistantMessage!); + } + else if (IsApprovalRequestMessage) + { + approvalRequestMessage?.Invoke(ApprovalRequestMessage!); + } + else if (IsApprovalResponseMessage) + { + approvalResponseMessage?.Invoke(ApprovalResponseMessage!); + } + else if (IsSummaryMessage) + { + summaryMessage?.Invoke(SummaryMessage!); + } + else if (IsEventMessage) + { + eventMessage?.Invoke(EventMessage!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? systemMessage = null, + global::System.Action? userMessage = null, + global::System.Action? reasoningMessage = null, + global::System.Action? hiddenReasoningMessage = null, + global::System.Action? toolCallMessage = null, + global::System.Action? toolReturnMessage = null, + global::System.Action? assistantMessage = null, + global::System.Action? approvalRequestMessage = null, + global::System.Action? approvalResponseMessage = null, + global::System.Action? summaryMessage = null, + global::System.Action? eventMessage = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ModifyMessageResponse.g.cs b/src/libs/Letta/Generated/Letta.Models.ModifyMessageResponse.g.cs index f49a180e..087e0ec0 100644 --- a/src/libs/Letta/Generated/Letta.Models.ModifyMessageResponse.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ModifyMessageResponse.g.cs @@ -36,6 +36,19 @@ namespace Letta #endif public bool IsSystemMessage => SystemMessage != null; + /// + /// + /// + public bool TryPickSystemMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SystemMessage? value) + { + value = SystemMessage; + return IsSystemMessage; + } + /// /// A message sent by the user. Never streamed back on a response, only used for cursor pagination.
/// Args:
@@ -58,6 +71,19 @@ namespace Letta #endif public bool IsUserMessage => UserMessage != null; + /// + /// + /// + public bool TryPickUserMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.UserMessage? value) + { + value = UserMessage; + return IsUserMessage; + } + /// /// Representation of an agent's internal reasoning.
/// Args:
@@ -83,6 +109,19 @@ namespace Letta #endif public bool IsReasoningMessage => ReasoningMessage != null; + /// + /// + /// + public bool TryPickReasoningMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningMessage? value) + { + value = ReasoningMessage; + return IsReasoningMessage; + } + /// /// Representation of an agent's internal reasoning where reasoning content
/// has been hidden from the response.
@@ -108,6 +147,19 @@ namespace Letta #endif public bool IsHiddenReasoningMessage => HiddenReasoningMessage != null; + /// + /// + /// + public bool TryPickHiddenReasoningMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.HiddenReasoningMessage? value) + { + value = HiddenReasoningMessage; + return IsHiddenReasoningMessage; + } + /// /// A message representing a request to call a tool (generated by the LLM to trigger tool execution).
/// Args:
@@ -130,6 +182,19 @@ namespace Letta #endif public bool IsToolCallMessage => ToolCallMessage != null; + /// + /// + /// + public bool TryPickToolCallMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolCallMessage? value) + { + value = ToolCallMessage; + return IsToolCallMessage; + } + /// /// A message representing the return value of a tool call (generated by Letta executing the requested tool).
/// Args:
@@ -157,6 +222,19 @@ namespace Letta #endif public bool IsToolReturnMessage => ToolReturnMessage != null; + /// + /// + /// + public bool TryPickToolReturnMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ToolReturnMessage? value) + { + value = ToolReturnMessage; + return IsToolReturnMessage; + } + /// /// A message sent by the LLM in response to user input. Used in the LLM context.
/// Args:
@@ -179,6 +257,19 @@ namespace Letta #endif public bool IsAssistantMessage => AssistantMessage != null; + /// + /// + /// + public bool TryPickAssistantMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AssistantMessage? value) + { + value = AssistantMessage; + return IsAssistantMessage; + } + /// /// A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
/// Args:
@@ -201,6 +292,19 @@ namespace Letta #endif public bool IsApprovalRequestMessage => ApprovalRequestMessage != null; + /// + /// + /// + public bool TryPickApprovalRequestMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalRequestMessage? value) + { + value = ApprovalRequestMessage; + return IsApprovalRequestMessage; + } + /// /// A message representing a response form the user indicating whether a tool has been approved to run.
/// Args:
@@ -225,6 +329,19 @@ namespace Letta #endif public bool IsApprovalResponseMessage => ApprovalResponseMessage != null; + /// + /// + /// + public bool TryPickApprovalResponseMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ApprovalResponseMessage? value) + { + value = ApprovalResponseMessage; + return IsApprovalResponseMessage; + } + /// /// A message representing a summary of the conversation. Sent to the LLM as a user or system message depending on the provider. /// @@ -242,6 +359,19 @@ namespace Letta #endif public bool IsSummaryMessage => SummaryMessage != null; + /// + /// + /// + public bool TryPickSummaryMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SummaryMessage? value) + { + value = SummaryMessage; + return IsSummaryMessage; + } + /// /// A message for notifying the developer that an event that has occured (e.g. a compaction). Events are NOT part of the context window. /// @@ -258,6 +388,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(EventMessage))] #endif public bool IsEventMessage => EventMessage != null; + + /// + /// + /// + public bool TryPickEventMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.EventMessage? value) + { + value = EventMessage; + return IsEventMessage; + } /// /// /// @@ -535,17 +678,17 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? systemMessage = null, - global::System.Func? userMessage = null, - global::System.Func? reasoningMessage = null, - global::System.Func? hiddenReasoningMessage = null, - global::System.Func? toolCallMessage = null, - global::System.Func? toolReturnMessage = null, - global::System.Func? assistantMessage = null, - global::System.Func? approvalRequestMessage = null, - global::System.Func? approvalResponseMessage = null, - global::System.Func? summaryMessage = null, - global::System.Func? eventMessage = null, + global::System.Func? systemMessage = null, + global::System.Func? userMessage = null, + global::System.Func? reasoningMessage = null, + global::System.Func? hiddenReasoningMessage = null, + global::System.Func? toolCallMessage = null, + global::System.Func? toolReturnMessage = null, + global::System.Func? assistantMessage = null, + global::System.Func? approvalRequestMessage = null, + global::System.Func? approvalResponseMessage = null, + global::System.Func? summaryMessage = null, + global::System.Func? eventMessage = null, bool validate = true) { if (validate) @@ -605,17 +748,95 @@ public bool Validate() /// ///
public void Match( - global::System.Action? systemMessage = null, - global::System.Action? userMessage = null, - global::System.Action? reasoningMessage = null, - global::System.Action? hiddenReasoningMessage = null, - global::System.Action? toolCallMessage = null, - global::System.Action? toolReturnMessage = null, - global::System.Action? assistantMessage = null, - global::System.Action? approvalRequestMessage = null, - global::System.Action? approvalResponseMessage = null, - global::System.Action? summaryMessage = null, - global::System.Action? eventMessage = null, + global::System.Action? systemMessage = null, + + global::System.Action? userMessage = null, + + global::System.Action? reasoningMessage = null, + + global::System.Action? hiddenReasoningMessage = null, + + global::System.Action? toolCallMessage = null, + + global::System.Action? toolReturnMessage = null, + + global::System.Action? assistantMessage = null, + + global::System.Action? approvalRequestMessage = null, + + global::System.Action? approvalResponseMessage = null, + + global::System.Action? summaryMessage = null, + + global::System.Action? eventMessage = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSystemMessage) + { + systemMessage?.Invoke(SystemMessage!); + } + else if (IsUserMessage) + { + userMessage?.Invoke(UserMessage!); + } + else if (IsReasoningMessage) + { + reasoningMessage?.Invoke(ReasoningMessage!); + } + else if (IsHiddenReasoningMessage) + { + hiddenReasoningMessage?.Invoke(HiddenReasoningMessage!); + } + else if (IsToolCallMessage) + { + toolCallMessage?.Invoke(ToolCallMessage!); + } + else if (IsToolReturnMessage) + { + toolReturnMessage?.Invoke(ToolReturnMessage!); + } + else if (IsAssistantMessage) + { + assistantMessage?.Invoke(AssistantMessage!); + } + else if (IsApprovalRequestMessage) + { + approvalRequestMessage?.Invoke(ApprovalRequestMessage!); + } + else if (IsApprovalResponseMessage) + { + approvalResponseMessage?.Invoke(ApprovalResponseMessage!); + } + else if (IsSummaryMessage) + { + summaryMessage?.Invoke(SummaryMessage!); + } + else if (IsEventMessage) + { + eventMessage?.Invoke(EventMessage!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? systemMessage = null, + global::System.Action? userMessage = null, + global::System.Action? reasoningMessage = null, + global::System.Action? hiddenReasoningMessage = null, + global::System.Action? toolCallMessage = null, + global::System.Action? toolReturnMessage = null, + global::System.Action? assistantMessage = null, + global::System.Action? approvalRequestMessage = null, + global::System.Action? approvalResponseMessage = null, + global::System.Action? summaryMessage = null, + global::System.Action? eventMessage = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.PolicyItem.g.cs b/src/libs/Letta/Generated/Letta.Models.PolicyItem.g.cs index b31dc0de..f26efcf4 100644 --- a/src/libs/Letta/Generated/Letta.Models.PolicyItem.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.PolicyItem.g.cs @@ -25,6 +25,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Agent))] #endif public bool IsAgent => Agent != null; + + /// + /// + /// + public bool TryPickAgent( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ClientSideAccessTokensCreateClientSideAccessTokenRequestPolicyItemVariant1? value) + { + value = Agent; + return IsAgent; + } /// /// /// @@ -69,7 +82,7 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? agent = null, + global::System.Func? agent = null, bool validate = true) { if (validate) @@ -89,7 +102,25 @@ public bool Validate() /// ///
public void Match( - global::System.Action? agent = null, + global::System.Action? agent = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgent) + { + agent?.Invoke(Agent!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? agent = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ProducerConfig.g.cs b/src/libs/Letta/Generated/Letta.Models.ProducerConfig.g.cs index 6a297ca7..14decf1c 100644 --- a/src/libs/Letta/Generated/Letta.Models.ProducerConfig.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ProducerConfig.g.cs @@ -26,6 +26,19 @@ namespace Letta #endif public bool IsSlackChannelReader => SlackChannelReader != null; + /// + /// + /// + public bool TryPickSlackChannelReader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesCreatePipelineRequestProducerConfigVariant1? value) + { + value = SlackChannelReader; + return IsSlackChannelReader; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomWebhook))] #endif public bool IsCustomWebhook => CustomWebhook != null; + + /// + /// + /// + public bool TryPickCustomWebhook( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesCreatePipelineRequestProducerConfigVariant2? value) + { + value = CustomWebhook; + return IsCustomWebhook; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? slackChannelReader = null, - global::System.Func? customWebhook = null, + global::System.Func? slackChannelReader = null, + global::System.Func? customWebhook = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? slackChannelReader = null, - global::System.Action? customWebhook = null, + global::System.Action? slackChannelReader = null, + + global::System.Action? customWebhook = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSlackChannelReader) + { + slackChannelReader?.Invoke(SlackChannelReader!); + } + else if (IsCustomWebhook) + { + customWebhook?.Invoke(CustomWebhook!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? slackChannelReader = null, + global::System.Action? customWebhook = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ProducerConfig2.g.cs b/src/libs/Letta/Generated/Letta.Models.ProducerConfig2.g.cs index 93445419..5bb17c39 100644 --- a/src/libs/Letta/Generated/Letta.Models.ProducerConfig2.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ProducerConfig2.g.cs @@ -26,6 +26,19 @@ namespace Letta #endif public bool IsSlackChannelReader => SlackChannelReader != null; + /// + /// + /// + public bool TryPickSlackChannelReader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesUpdatePipelineProducerConfigRequestProducerConfigVariant1? value) + { + value = SlackChannelReader; + return IsSlackChannelReader; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomWebhook))] #endif public bool IsCustomWebhook => CustomWebhook != null; + + /// + /// + /// + public bool TryPickCustomWebhook( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesUpdatePipelineProducerConfigRequestProducerConfigVariant2? value) + { + value = CustomWebhook; + return IsCustomWebhook; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? slackChannelReader = null, - global::System.Func? customWebhook = null, + global::System.Func? slackChannelReader = null, + global::System.Func? customWebhook = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? slackChannelReader = null, - global::System.Action? customWebhook = null, + global::System.Action? slackChannelReader = null, + + global::System.Action? customWebhook = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSlackChannelReader) + { + slackChannelReader?.Invoke(SlackChannelReader!); + } + else if (IsCustomWebhook) + { + customWebhook?.Invoke(CustomWebhook!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? slackChannelReader = null, + global::System.Action? customWebhook = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ProducerConfig3.g.cs b/src/libs/Letta/Generated/Letta.Models.ProducerConfig3.g.cs index 5fcfc298..29f82ea1 100644 --- a/src/libs/Letta/Generated/Letta.Models.ProducerConfig3.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ProducerConfig3.g.cs @@ -26,6 +26,19 @@ namespace Letta #endif public bool IsSlackChannelReader => SlackChannelReader != null; + /// + /// + /// + public bool TryPickSlackChannelReader( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesPreviewPipelineRequestProducerConfigVariant1? value) + { + value = SlackChannelReader; + return IsSlackChannelReader; + } + /// /// /// @@ -42,6 +55,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(CustomWebhook))] #endif public bool IsCustomWebhook => CustomWebhook != null; + + /// + /// + /// + public bool TryPickCustomWebhook( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.PipelinesPreviewPipelineRequestProducerConfigVariant2? value) + { + value = CustomWebhook; + return IsCustomWebhook; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? slackChannelReader = null, - global::System.Func? customWebhook = null, + global::System.Func? slackChannelReader = null, + global::System.Func? customWebhook = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// ///
public void Match( - global::System.Action? slackChannelReader = null, - global::System.Action? customWebhook = null, + global::System.Action? slackChannelReader = null, + + global::System.Action? customWebhook = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSlackChannelReader) + { + slackChannelReader?.Invoke(SlackChannelReader!); + } + else if (IsCustomWebhook) + { + customWebhook?.Invoke(CustomWebhook!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? slackChannelReader = null, + global::System.Action? customWebhook = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant1.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant1.g.cs index 6c2e35e4..ec0e9270 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant1.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant1.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant110.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant110.g.cs index 58ea9e33..2be569a0 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant110.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant110.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant111.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant111.g.cs index dd6d2439..410638cc 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant111.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant111.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant112.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant112.g.cs index ae89415f..cd9933f9 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant112.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant112.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant113.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant113.g.cs index 82ac7711..94a81714 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant113.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant113.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant114.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant114.g.cs index 95624b13..6ed72e66 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant114.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant114.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant115.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant115.g.cs index 862e3395..e9828d16 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant115.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant115.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant116.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant116.g.cs index 9719db78..9bc215e7 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant116.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant116.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant117.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant117.g.cs index 57fd75cb..0ab4d5ef 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant117.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant117.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant118.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant118.g.cs index 32f5d8c8..e5e364e8 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant118.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant118.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant12.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant12.g.cs index 210deee1..d16795c4 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant12.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant12.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant13.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant13.g.cs index e4f04362..494be97d 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant13.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant13.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant14.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant14.g.cs index 483d2fed..90e3b271 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant14.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant14.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant15.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant15.g.cs index b0587848..9b62b4be 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant15.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant15.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant16.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant16.g.cs index df450b70..dfe39d15 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant16.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant16.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant17.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant17.g.cs index effc92f3..ed8f4852 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant17.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant17.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant18.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant18.g.cs index 37ab1eda..4f498d40 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant18.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant18.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseFormatVariant19.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant19.g.cs index bcff5e46..bf6dcb54 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant19.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseFormatVariant19.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseSchemaVariant1.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseSchemaVariant1.g.cs index 93af7b76..1e07b47f 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseSchemaVariant1.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseSchemaVariant1.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.ResponseSchemaVariant12.g.cs b/src/libs/Letta/Generated/Letta.Models.ResponseSchemaVariant12.g.cs index 6e45be84..e73c3e53 100644 --- a/src/libs/Letta/Generated/Letta.Models.ResponseSchemaVariant12.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ResponseSchemaVariant12.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsText => Text != null; + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TextResponseFormat? value) + { + value = Text; + return IsText; + } + /// /// Response format for JSON schema-based responses. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsJsonSchema => JsonSchema != null; + /// + /// + /// + public bool TryPickJsonSchema( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.JsonSchemaResponseFormat? value) + { + value = JsonSchema; + return IsJsonSchema; + } + /// /// Response format for JSON object responses. /// @@ -64,6 +90,19 @@ namespace Letta [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::Letta.JsonObjectResponseFormat? value) + { + value = JsonObject; + return IsJsonObject; + } /// /// /// @@ -165,9 +204,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) @@ -195,9 +234,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/Letta/Generated/Letta.Models.SearchAllMessagesResponseItem.g.cs b/src/libs/Letta/Generated/Letta.Models.SearchAllMessagesResponseItem.g.cs index 8dd6e6f2..8f0fec16 100644 --- a/src/libs/Letta/Generated/Letta.Models.SearchAllMessagesResponseItem.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.SearchAllMessagesResponseItem.g.cs @@ -32,6 +32,19 @@ namespace Letta #endif public bool IsSystemMessage => SystemMessage != null; + /// + /// + /// + public bool TryPickSystemMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.SystemMessageListResult? value) + { + value = SystemMessage; + return IsSystemMessage; + } + /// /// User message list result with agent context.
/// Shape is identical to UpdateUserMessage but includes the owning agent_id and message id. @@ -50,6 +63,19 @@ namespace Letta #endif public bool IsUserMessage => UserMessage != null; + /// + /// + /// + public bool TryPickUserMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.UserMessageListResult? value) + { + value = UserMessage; + return IsUserMessage; + } + /// /// Reasoning message list result with agent context.
/// Shape is identical to UpdateReasoningMessage but includes the owning agent_id and message id. @@ -68,6 +94,19 @@ namespace Letta #endif public bool IsReasoningMessage => ReasoningMessage != null; + /// + /// + /// + public bool TryPickReasoningMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ReasoningMessageListResult? value) + { + value = ReasoningMessage; + return IsReasoningMessage; + } + /// /// Assistant message list result with agent context.
/// Shape is identical to UpdateAssistantMessage but includes the owning agent_id and message id. @@ -85,6 +124,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AssistantMessage))] #endif public bool IsAssistantMessage => AssistantMessage != null; + + /// + /// + /// + public bool TryPickAssistantMessage( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.AssistantMessageListResult? value) + { + value = AssistantMessage; + return IsAssistantMessage; + } /// /// /// @@ -208,10 +260,10 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? systemMessage = null, - global::System.Func? userMessage = null, - global::System.Func? reasoningMessage = null, - global::System.Func? assistantMessage = null, + global::System.Func? systemMessage = null, + global::System.Func? userMessage = null, + global::System.Func? reasoningMessage = null, + global::System.Func? assistantMessage = null, bool validate = true) { if (validate) @@ -243,10 +295,46 @@ public bool Validate() /// ///
public void Match( - global::System.Action? systemMessage = null, - global::System.Action? userMessage = null, - global::System.Action? reasoningMessage = null, - global::System.Action? assistantMessage = null, + global::System.Action? systemMessage = null, + + global::System.Action? userMessage = null, + + global::System.Action? reasoningMessage = null, + + global::System.Action? assistantMessage = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSystemMessage) + { + systemMessage?.Invoke(SystemMessage!); + } + else if (IsUserMessage) + { + userMessage?.Invoke(UserMessage!); + } + else if (IsReasoningMessage) + { + reasoningMessage?.Invoke(ReasoningMessage!); + } + else if (IsAssistantMessage) + { + assistantMessage?.Invoke(AssistantMessage!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? systemMessage = null, + global::System.Action? userMessage = null, + global::System.Action? reasoningMessage = null, + global::System.Action? assistantMessage = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.Source.g.cs b/src/libs/Letta/Generated/Letta.Models.Source.g.cs index 90b32174..ddde73f4 100644 --- a/src/libs/Letta/Generated/Letta.Models.Source.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.Source.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsUrl => Url != null; + /// + /// + /// + public bool TryPickUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.UrlImage? value) + { + value = Url; + return IsUrl; + } + /// /// /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsBase64 => Base64 != null; + /// + /// + /// + public bool TryPickBase64( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.Base64Image? value) + { + value = Base64; + return IsBase64; + } + /// /// /// @@ -64,6 +90,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Letta))] #endif public bool IsLetta => Letta != null; + + /// + /// + /// + public bool TryPickLetta( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.LettaImage? value) + { + value = Letta; + return IsLetta; + } /// /// /// @@ -165,9 +204,9 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? url = null, - global::System.Func? base64 = null, - global::System.Func? letta = null, + global::System.Func? url = null, + global::System.Func? base64 = null, + global::System.Func? letta = null, bool validate = true) { if (validate) @@ -195,9 +234,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? url = null, - global::System.Action? base64 = null, - global::System.Action? letta = null, + global::System.Action? url = null, + + global::System.Action? base64 = null, + + global::System.Action? letta = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsUrl) + { + url?.Invoke(Url!); + } + else if (IsBase64) + { + base64?.Invoke(Base64!); + } + else if (IsLetta) + { + letta?.Invoke(Letta!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? url = null, + global::System.Action? base64 = null, + global::System.Action? letta = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.TemplatesCreateTemplateNoProjectRequest.g.cs b/src/libs/Letta/Generated/Letta.Models.TemplatesCreateTemplateNoProjectRequest.g.cs index 0d4eff16..5e755b25 100644 --- a/src/libs/Letta/Generated/Letta.Models.TemplatesCreateTemplateNoProjectRequest.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.TemplatesCreateTemplateNoProjectRequest.g.cs @@ -26,6 +26,19 @@ namespace Letta #endif public bool IsAgent => Agent != null; + /// + /// + /// + public bool TryPickAgent( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TemplatesCreateTemplateNoProjectRequestVariant1? value) + { + value = Agent; + return IsAgent; + } + /// /// Create a template from an uploaded agent file /// @@ -42,6 +55,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgentFile))] #endif public bool IsAgentFile => AgentFile != null; + + /// + /// + /// + public bool TryPickAgentFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TemplatesCreateTemplateNoProjectRequestVariant2? value) + { + value = AgentFile; + return IsAgentFile; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? agent = null, - global::System.Func? agentFile = null, + global::System.Func? agent = null, + global::System.Func? agentFile = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? agent = null, - global::System.Action? agentFile = null, + global::System.Action? agent = null, + + global::System.Action? agentFile = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgent) + { + agent?.Invoke(Agent!); + } + else if (IsAgentFile) + { + agentFile?.Invoke(AgentFile!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? agent = null, + global::System.Action? agentFile = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.TemplatesCreateTemplateRequest.g.cs b/src/libs/Letta/Generated/Letta.Models.TemplatesCreateTemplateRequest.g.cs index d055c0fd..88007962 100644 --- a/src/libs/Letta/Generated/Letta.Models.TemplatesCreateTemplateRequest.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.TemplatesCreateTemplateRequest.g.cs @@ -26,6 +26,19 @@ namespace Letta #endif public bool IsAgent => Agent != null; + /// + /// + /// + public bool TryPickAgent( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TemplatesCreateTemplateRequestVariant1? value) + { + value = Agent; + return IsAgent; + } + /// /// Create a template from an uploaded agent file /// @@ -42,6 +55,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgentFile))] #endif public bool IsAgentFile => AgentFile != null; + + /// + /// + /// + public bool TryPickAgentFile( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TemplatesCreateTemplateRequestVariant2? value) + { + value = AgentFile; + return IsAgentFile; + } /// /// /// @@ -118,8 +144,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? agent = null, - global::System.Func? agentFile = null, + global::System.Func? agent = null, + global::System.Func? agentFile = null, bool validate = true) { if (validate) @@ -143,8 +169,32 @@ public bool Validate() /// /// public void Match( - global::System.Action? agent = null, - global::System.Action? agentFile = null, + global::System.Action? agent = null, + + global::System.Action? agentFile = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsAgent) + { + agent?.Invoke(Agent!); + } + else if (IsAgentFile) + { + agentFile?.Invoke(AgentFile!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? agent = null, + global::System.Action? agentFile = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item.g.cs b/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item.g.cs index 32d02005..146e2070 100644 --- a/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsConstrainChildTools => ConstrainChildTools != null; + /// + /// + /// + public bool TryPickConstrainChildTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChildToolRule? value) + { + value = ConstrainChildTools; + return IsConstrainChildTools; + } + /// /// Represents the initial tool rule configuration. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsRunFirst => RunFirst != null; + /// + /// + /// + public bool TryPickRunFirst( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.InitToolRule? value) + { + value = RunFirst; + return IsRunFirst; + } + /// /// Represents a terminal tool rule configuration where if this tool gets called, it must end the agent loop. /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsExitLoop => ExitLoop != null; + /// + /// + /// + public bool TryPickExitLoop( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TerminalToolRule? value) + { + value = ExitLoop; + return IsExitLoop; + } + /// /// A ToolRule that conditionally maps to different child tools based on the output. /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsConditional => Conditional != null; + /// + /// + /// + public bool TryPickConditional( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ConditionalToolRule? value) + { + value = Conditional; + return IsConditional; + } + /// /// Represents a tool rule configuration where if this tool gets called, it must continue the agent loop. /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsContinueLoop => ContinueLoop != null; + /// + /// + /// + public bool TryPickContinueLoop( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ContinueToolRule? value) + { + value = ContinueLoop; + return IsContinueLoop; + } + /// /// Represents a tool rule configuration where this tool must be called before the agent loop can exit. /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRequiredBeforeExit => RequiredBeforeExit != null; + /// + /// + /// + public bool TryPickRequiredBeforeExit( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RequiredBeforeExitToolRule? value) + { + value = RequiredBeforeExit; + return IsRequiredBeforeExit; + } + /// /// Represents a tool rule configuration which constrains the total number of times this tool can be invoked in a single step. /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsMaxCountPerStep => MaxCountPerStep != null; + /// + /// + /// + public bool TryPickMaxCountPerStep( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.MaxCountPerStepToolRule? value) + { + value = MaxCountPerStep; + return IsMaxCountPerStep; + } + /// /// A ToolRule that only allows a child tool to be called if the parent has been called. /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsParentLastTool => ParentLastTool != null; + /// + /// + /// + public bool TryPickParentLastTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ParentToolRule? value) + { + value = ParentLastTool; + return IsParentLastTool; + } + /// /// Represents a tool rule configuration which requires approval before the tool can be invoked. /// @@ -166,6 +270,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RequiresApproval))] #endif public bool IsRequiresApproval => RequiresApproval != null; + + /// + /// + /// + public bool TryPickRequiresApproval( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RequiresApprovalToolRule? value) + { + value = RequiresApproval; + return IsRequiresApproval; + } /// /// /// @@ -399,15 +516,15 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? constrainChildTools = null, - global::System.Func? runFirst = null, - global::System.Func? exitLoop = null, - global::System.Func? conditional = null, - global::System.Func? continueLoop = null, - global::System.Func? requiredBeforeExit = null, - global::System.Func? maxCountPerStep = null, - global::System.Func? parentLastTool = null, - global::System.Func? requiresApproval = null, + global::System.Func? constrainChildTools = null, + global::System.Func? runFirst = null, + global::System.Func? exitLoop = null, + global::System.Func? conditional = null, + global::System.Func? continueLoop = null, + global::System.Func? requiredBeforeExit = null, + global::System.Func? maxCountPerStep = null, + global::System.Func? parentLastTool = null, + global::System.Func? requiresApproval = null, bool validate = true) { if (validate) @@ -459,15 +576,81 @@ public bool Validate() /// /// public void Match( - global::System.Action? constrainChildTools = null, - global::System.Action? runFirst = null, - global::System.Action? exitLoop = null, - global::System.Action? conditional = null, - global::System.Action? continueLoop = null, - global::System.Action? requiredBeforeExit = null, - global::System.Action? maxCountPerStep = null, - global::System.Action? parentLastTool = null, - global::System.Action? requiresApproval = null, + global::System.Action? constrainChildTools = null, + + global::System.Action? runFirst = null, + + global::System.Action? exitLoop = null, + + global::System.Action? conditional = null, + + global::System.Action? continueLoop = null, + + global::System.Action? requiredBeforeExit = null, + + global::System.Action? maxCountPerStep = null, + + global::System.Action? parentLastTool = null, + + global::System.Action? requiresApproval = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsConstrainChildTools) + { + constrainChildTools?.Invoke(ConstrainChildTools!); + } + else if (IsRunFirst) + { + runFirst?.Invoke(RunFirst!); + } + else if (IsExitLoop) + { + exitLoop?.Invoke(ExitLoop!); + } + else if (IsConditional) + { + conditional?.Invoke(Conditional!); + } + else if (IsContinueLoop) + { + continueLoop?.Invoke(ContinueLoop!); + } + else if (IsRequiredBeforeExit) + { + requiredBeforeExit?.Invoke(RequiredBeforeExit!); + } + else if (IsMaxCountPerStep) + { + maxCountPerStep?.Invoke(MaxCountPerStep!); + } + else if (IsParentLastTool) + { + parentLastTool?.Invoke(ParentLastTool!); + } + else if (IsRequiresApproval) + { + requiresApproval?.Invoke(RequiresApproval!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? constrainChildTools = null, + global::System.Action? runFirst = null, + global::System.Action? exitLoop = null, + global::System.Action? conditional = null, + global::System.Action? continueLoop = null, + global::System.Action? requiredBeforeExit = null, + global::System.Action? maxCountPerStep = null, + global::System.Action? parentLastTool = null, + global::System.Action? requiresApproval = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item2.g.cs b/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item2.g.cs index 61aebf7d..55b7bf71 100644 --- a/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item2.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item2.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsConstrainChildTools => ConstrainChildTools != null; + /// + /// + /// + public bool TryPickConstrainChildTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChildToolRule? value) + { + value = ConstrainChildTools; + return IsConstrainChildTools; + } + /// /// Represents the initial tool rule configuration. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsRunFirst => RunFirst != null; + /// + /// + /// + public bool TryPickRunFirst( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.InitToolRule? value) + { + value = RunFirst; + return IsRunFirst; + } + /// /// Represents a terminal tool rule configuration where if this tool gets called, it must end the agent loop. /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsExitLoop => ExitLoop != null; + /// + /// + /// + public bool TryPickExitLoop( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TerminalToolRule? value) + { + value = ExitLoop; + return IsExitLoop; + } + /// /// A ToolRule that conditionally maps to different child tools based on the output. /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsConditional => Conditional != null; + /// + /// + /// + public bool TryPickConditional( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ConditionalToolRule? value) + { + value = Conditional; + return IsConditional; + } + /// /// Represents a tool rule configuration where if this tool gets called, it must continue the agent loop. /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsContinueLoop => ContinueLoop != null; + /// + /// + /// + public bool TryPickContinueLoop( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ContinueToolRule? value) + { + value = ContinueLoop; + return IsContinueLoop; + } + /// /// Represents a tool rule configuration where this tool must be called before the agent loop can exit. /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRequiredBeforeExit => RequiredBeforeExit != null; + /// + /// + /// + public bool TryPickRequiredBeforeExit( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RequiredBeforeExitToolRule? value) + { + value = RequiredBeforeExit; + return IsRequiredBeforeExit; + } + /// /// Represents a tool rule configuration which constrains the total number of times this tool can be invoked in a single step. /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsMaxCountPerStep => MaxCountPerStep != null; + /// + /// + /// + public bool TryPickMaxCountPerStep( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.MaxCountPerStepToolRule? value) + { + value = MaxCountPerStep; + return IsMaxCountPerStep; + } + /// /// A ToolRule that only allows a child tool to be called if the parent has been called. /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsParentLastTool => ParentLastTool != null; + /// + /// + /// + public bool TryPickParentLastTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ParentToolRule? value) + { + value = ParentLastTool; + return IsParentLastTool; + } + /// /// Represents a tool rule configuration which requires approval before the tool can be invoked. /// @@ -166,6 +270,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RequiresApproval))] #endif public bool IsRequiresApproval => RequiresApproval != null; + + /// + /// + /// + public bool TryPickRequiresApproval( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RequiresApprovalToolRule? value) + { + value = RequiresApproval; + return IsRequiresApproval; + } /// /// /// @@ -399,15 +516,15 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? constrainChildTools = null, - global::System.Func? runFirst = null, - global::System.Func? exitLoop = null, - global::System.Func? conditional = null, - global::System.Func? continueLoop = null, - global::System.Func? requiredBeforeExit = null, - global::System.Func? maxCountPerStep = null, - global::System.Func? parentLastTool = null, - global::System.Func? requiresApproval = null, + global::System.Func? constrainChildTools = null, + global::System.Func? runFirst = null, + global::System.Func? exitLoop = null, + global::System.Func? conditional = null, + global::System.Func? continueLoop = null, + global::System.Func? requiredBeforeExit = null, + global::System.Func? maxCountPerStep = null, + global::System.Func? parentLastTool = null, + global::System.Func? requiresApproval = null, bool validate = true) { if (validate) @@ -459,15 +576,81 @@ public bool Validate() /// /// public void Match( - global::System.Action? constrainChildTools = null, - global::System.Action? runFirst = null, - global::System.Action? exitLoop = null, - global::System.Action? conditional = null, - global::System.Action? continueLoop = null, - global::System.Action? requiredBeforeExit = null, - global::System.Action? maxCountPerStep = null, - global::System.Action? parentLastTool = null, - global::System.Action? requiresApproval = null, + global::System.Action? constrainChildTools = null, + + global::System.Action? runFirst = null, + + global::System.Action? exitLoop = null, + + global::System.Action? conditional = null, + + global::System.Action? continueLoop = null, + + global::System.Action? requiredBeforeExit = null, + + global::System.Action? maxCountPerStep = null, + + global::System.Action? parentLastTool = null, + + global::System.Action? requiresApproval = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsConstrainChildTools) + { + constrainChildTools?.Invoke(ConstrainChildTools!); + } + else if (IsRunFirst) + { + runFirst?.Invoke(RunFirst!); + } + else if (IsExitLoop) + { + exitLoop?.Invoke(ExitLoop!); + } + else if (IsConditional) + { + conditional?.Invoke(Conditional!); + } + else if (IsContinueLoop) + { + continueLoop?.Invoke(ContinueLoop!); + } + else if (IsRequiredBeforeExit) + { + requiredBeforeExit?.Invoke(RequiredBeforeExit!); + } + else if (IsMaxCountPerStep) + { + maxCountPerStep?.Invoke(MaxCountPerStep!); + } + else if (IsParentLastTool) + { + parentLastTool?.Invoke(ParentLastTool!); + } + else if (IsRequiresApproval) + { + requiresApproval?.Invoke(RequiresApproval!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? constrainChildTools = null, + global::System.Action? runFirst = null, + global::System.Action? exitLoop = null, + global::System.Action? conditional = null, + global::System.Action? continueLoop = null, + global::System.Action? requiredBeforeExit = null, + global::System.Action? maxCountPerStep = null, + global::System.Action? parentLastTool = null, + global::System.Action? requiresApproval = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item3.g.cs b/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item3.g.cs index fb36f984..33b9ebde 100644 --- a/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item3.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item3.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsConstrainChildTools => ConstrainChildTools != null; + /// + /// + /// + public bool TryPickConstrainChildTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChildToolRule? value) + { + value = ConstrainChildTools; + return IsConstrainChildTools; + } + /// /// Represents the initial tool rule configuration. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsRunFirst => RunFirst != null; + /// + /// + /// + public bool TryPickRunFirst( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.InitToolRule? value) + { + value = RunFirst; + return IsRunFirst; + } + /// /// Represents a terminal tool rule configuration where if this tool gets called, it must end the agent loop. /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsExitLoop => ExitLoop != null; + /// + /// + /// + public bool TryPickExitLoop( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TerminalToolRule? value) + { + value = ExitLoop; + return IsExitLoop; + } + /// /// A ToolRule that conditionally maps to different child tools based on the output. /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsConditional => Conditional != null; + /// + /// + /// + public bool TryPickConditional( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ConditionalToolRule? value) + { + value = Conditional; + return IsConditional; + } + /// /// Represents a tool rule configuration where if this tool gets called, it must continue the agent loop. /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsContinueLoop => ContinueLoop != null; + /// + /// + /// + public bool TryPickContinueLoop( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ContinueToolRule? value) + { + value = ContinueLoop; + return IsContinueLoop; + } + /// /// Represents a tool rule configuration where this tool must be called before the agent loop can exit. /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRequiredBeforeExit => RequiredBeforeExit != null; + /// + /// + /// + public bool TryPickRequiredBeforeExit( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RequiredBeforeExitToolRule? value) + { + value = RequiredBeforeExit; + return IsRequiredBeforeExit; + } + /// /// Represents a tool rule configuration which constrains the total number of times this tool can be invoked in a single step. /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsMaxCountPerStep => MaxCountPerStep != null; + /// + /// + /// + public bool TryPickMaxCountPerStep( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.MaxCountPerStepToolRule? value) + { + value = MaxCountPerStep; + return IsMaxCountPerStep; + } + /// /// A ToolRule that only allows a child tool to be called if the parent has been called. /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsParentLastTool => ParentLastTool != null; + /// + /// + /// + public bool TryPickParentLastTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ParentToolRule? value) + { + value = ParentLastTool; + return IsParentLastTool; + } + /// /// Represents a tool rule configuration which requires approval before the tool can be invoked. /// @@ -166,6 +270,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RequiresApproval))] #endif public bool IsRequiresApproval => RequiresApproval != null; + + /// + /// + /// + public bool TryPickRequiresApproval( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RequiresApprovalToolRule? value) + { + value = RequiresApproval; + return IsRequiresApproval; + } /// /// /// @@ -399,15 +516,15 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? constrainChildTools = null, - global::System.Func? runFirst = null, - global::System.Func? exitLoop = null, - global::System.Func? conditional = null, - global::System.Func? continueLoop = null, - global::System.Func? requiredBeforeExit = null, - global::System.Func? maxCountPerStep = null, - global::System.Func? parentLastTool = null, - global::System.Func? requiresApproval = null, + global::System.Func? constrainChildTools = null, + global::System.Func? runFirst = null, + global::System.Func? exitLoop = null, + global::System.Func? conditional = null, + global::System.Func? continueLoop = null, + global::System.Func? requiredBeforeExit = null, + global::System.Func? maxCountPerStep = null, + global::System.Func? parentLastTool = null, + global::System.Func? requiresApproval = null, bool validate = true) { if (validate) @@ -459,15 +576,81 @@ public bool Validate() /// /// public void Match( - global::System.Action? constrainChildTools = null, - global::System.Action? runFirst = null, - global::System.Action? exitLoop = null, - global::System.Action? conditional = null, - global::System.Action? continueLoop = null, - global::System.Action? requiredBeforeExit = null, - global::System.Action? maxCountPerStep = null, - global::System.Action? parentLastTool = null, - global::System.Action? requiresApproval = null, + global::System.Action? constrainChildTools = null, + + global::System.Action? runFirst = null, + + global::System.Action? exitLoop = null, + + global::System.Action? conditional = null, + + global::System.Action? continueLoop = null, + + global::System.Action? requiredBeforeExit = null, + + global::System.Action? maxCountPerStep = null, + + global::System.Action? parentLastTool = null, + + global::System.Action? requiresApproval = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsConstrainChildTools) + { + constrainChildTools?.Invoke(ConstrainChildTools!); + } + else if (IsRunFirst) + { + runFirst?.Invoke(RunFirst!); + } + else if (IsExitLoop) + { + exitLoop?.Invoke(ExitLoop!); + } + else if (IsConditional) + { + conditional?.Invoke(Conditional!); + } + else if (IsContinueLoop) + { + continueLoop?.Invoke(ContinueLoop!); + } + else if (IsRequiredBeforeExit) + { + requiredBeforeExit?.Invoke(RequiredBeforeExit!); + } + else if (IsMaxCountPerStep) + { + maxCountPerStep?.Invoke(MaxCountPerStep!); + } + else if (IsParentLastTool) + { + parentLastTool?.Invoke(ParentLastTool!); + } + else if (IsRequiresApproval) + { + requiresApproval?.Invoke(RequiresApproval!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? constrainChildTools = null, + global::System.Action? runFirst = null, + global::System.Action? exitLoop = null, + global::System.Action? conditional = null, + global::System.Action? continueLoop = null, + global::System.Action? requiredBeforeExit = null, + global::System.Action? maxCountPerStep = null, + global::System.Action? parentLastTool = null, + global::System.Action? requiresApproval = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item4.g.cs b/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item4.g.cs index d81a1a4d..04cb324a 100644 --- a/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item4.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item4.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsConstrainChildTools => ConstrainChildTools != null; + /// + /// + /// + public bool TryPickConstrainChildTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChildToolRule? value) + { + value = ConstrainChildTools; + return IsConstrainChildTools; + } + /// /// Represents the initial tool rule configuration. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsRunFirst => RunFirst != null; + /// + /// + /// + public bool TryPickRunFirst( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.InitToolRule? value) + { + value = RunFirst; + return IsRunFirst; + } + /// /// Represents a terminal tool rule configuration where if this tool gets called, it must end the agent loop. /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsExitLoop => ExitLoop != null; + /// + /// + /// + public bool TryPickExitLoop( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TerminalToolRule? value) + { + value = ExitLoop; + return IsExitLoop; + } + /// /// A ToolRule that conditionally maps to different child tools based on the output. /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsConditional => Conditional != null; + /// + /// + /// + public bool TryPickConditional( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ConditionalToolRule? value) + { + value = Conditional; + return IsConditional; + } + /// /// Represents a tool rule configuration where if this tool gets called, it must continue the agent loop. /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsContinueLoop => ContinueLoop != null; + /// + /// + /// + public bool TryPickContinueLoop( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ContinueToolRule? value) + { + value = ContinueLoop; + return IsContinueLoop; + } + /// /// Represents a tool rule configuration where this tool must be called before the agent loop can exit. /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRequiredBeforeExit => RequiredBeforeExit != null; + /// + /// + /// + public bool TryPickRequiredBeforeExit( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RequiredBeforeExitToolRule? value) + { + value = RequiredBeforeExit; + return IsRequiredBeforeExit; + } + /// /// Represents a tool rule configuration which constrains the total number of times this tool can be invoked in a single step. /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsMaxCountPerStep => MaxCountPerStep != null; + /// + /// + /// + public bool TryPickMaxCountPerStep( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.MaxCountPerStepToolRule? value) + { + value = MaxCountPerStep; + return IsMaxCountPerStep; + } + /// /// A ToolRule that only allows a child tool to be called if the parent has been called. /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsParentLastTool => ParentLastTool != null; + /// + /// + /// + public bool TryPickParentLastTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ParentToolRule? value) + { + value = ParentLastTool; + return IsParentLastTool; + } + /// /// Represents a tool rule configuration which requires approval before the tool can be invoked. /// @@ -166,6 +270,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RequiresApproval))] #endif public bool IsRequiresApproval => RequiresApproval != null; + + /// + /// + /// + public bool TryPickRequiresApproval( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RequiresApprovalToolRule? value) + { + value = RequiresApproval; + return IsRequiresApproval; + } /// /// /// @@ -399,15 +516,15 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? constrainChildTools = null, - global::System.Func? runFirst = null, - global::System.Func? exitLoop = null, - global::System.Func? conditional = null, - global::System.Func? continueLoop = null, - global::System.Func? requiredBeforeExit = null, - global::System.Func? maxCountPerStep = null, - global::System.Func? parentLastTool = null, - global::System.Func? requiresApproval = null, + global::System.Func? constrainChildTools = null, + global::System.Func? runFirst = null, + global::System.Func? exitLoop = null, + global::System.Func? conditional = null, + global::System.Func? continueLoop = null, + global::System.Func? requiredBeforeExit = null, + global::System.Func? maxCountPerStep = null, + global::System.Func? parentLastTool = null, + global::System.Func? requiresApproval = null, bool validate = true) { if (validate) @@ -459,15 +576,81 @@ public bool Validate() /// /// public void Match( - global::System.Action? constrainChildTools = null, - global::System.Action? runFirst = null, - global::System.Action? exitLoop = null, - global::System.Action? conditional = null, - global::System.Action? continueLoop = null, - global::System.Action? requiredBeforeExit = null, - global::System.Action? maxCountPerStep = null, - global::System.Action? parentLastTool = null, - global::System.Action? requiresApproval = null, + global::System.Action? constrainChildTools = null, + + global::System.Action? runFirst = null, + + global::System.Action? exitLoop = null, + + global::System.Action? conditional = null, + + global::System.Action? continueLoop = null, + + global::System.Action? requiredBeforeExit = null, + + global::System.Action? maxCountPerStep = null, + + global::System.Action? parentLastTool = null, + + global::System.Action? requiresApproval = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsConstrainChildTools) + { + constrainChildTools?.Invoke(ConstrainChildTools!); + } + else if (IsRunFirst) + { + runFirst?.Invoke(RunFirst!); + } + else if (IsExitLoop) + { + exitLoop?.Invoke(ExitLoop!); + } + else if (IsConditional) + { + conditional?.Invoke(Conditional!); + } + else if (IsContinueLoop) + { + continueLoop?.Invoke(ContinueLoop!); + } + else if (IsRequiredBeforeExit) + { + requiredBeforeExit?.Invoke(RequiredBeforeExit!); + } + else if (IsMaxCountPerStep) + { + maxCountPerStep?.Invoke(MaxCountPerStep!); + } + else if (IsParentLastTool) + { + parentLastTool?.Invoke(ParentLastTool!); + } + else if (IsRequiresApproval) + { + requiresApproval?.Invoke(RequiresApproval!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? constrainChildTools = null, + global::System.Action? runFirst = null, + global::System.Action? exitLoop = null, + global::System.Action? conditional = null, + global::System.Action? continueLoop = null, + global::System.Action? requiredBeforeExit = null, + global::System.Action? maxCountPerStep = null, + global::System.Action? parentLastTool = null, + global::System.Action? requiresApproval = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item5.g.cs b/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item5.g.cs index 556893bb..2a84c231 100644 --- a/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item5.g.cs +++ b/src/libs/Letta/Generated/Letta.Models.ToolRulesVariant1Item5.g.cs @@ -31,6 +31,19 @@ namespace Letta #endif public bool IsConstrainChildTools => ConstrainChildTools != null; + /// + /// + /// + public bool TryPickConstrainChildTools( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ChildToolRule? value) + { + value = ConstrainChildTools; + return IsConstrainChildTools; + } + /// /// Represents the initial tool rule configuration. /// @@ -48,6 +61,19 @@ namespace Letta #endif public bool IsRunFirst => RunFirst != null; + /// + /// + /// + public bool TryPickRunFirst( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.InitToolRule? value) + { + value = RunFirst; + return IsRunFirst; + } + /// /// Represents a terminal tool rule configuration where if this tool gets called, it must end the agent loop. /// @@ -65,6 +91,19 @@ namespace Letta #endif public bool IsExitLoop => ExitLoop != null; + /// + /// + /// + public bool TryPickExitLoop( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.TerminalToolRule? value) + { + value = ExitLoop; + return IsExitLoop; + } + /// /// A ToolRule that conditionally maps to different child tools based on the output. /// @@ -82,6 +121,19 @@ namespace Letta #endif public bool IsConditional => Conditional != null; + /// + /// + /// + public bool TryPickConditional( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ConditionalToolRule? value) + { + value = Conditional; + return IsConditional; + } + /// /// Represents a tool rule configuration where if this tool gets called, it must continue the agent loop. /// @@ -99,6 +151,19 @@ namespace Letta #endif public bool IsContinueLoop => ContinueLoop != null; + /// + /// + /// + public bool TryPickContinueLoop( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ContinueToolRule? value) + { + value = ContinueLoop; + return IsContinueLoop; + } + /// /// Represents a tool rule configuration where this tool must be called before the agent loop can exit. /// @@ -116,6 +181,19 @@ namespace Letta #endif public bool IsRequiredBeforeExit => RequiredBeforeExit != null; + /// + /// + /// + public bool TryPickRequiredBeforeExit( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RequiredBeforeExitToolRule? value) + { + value = RequiredBeforeExit; + return IsRequiredBeforeExit; + } + /// /// Represents a tool rule configuration which constrains the total number of times this tool can be invoked in a single step. /// @@ -133,6 +211,19 @@ namespace Letta #endif public bool IsMaxCountPerStep => MaxCountPerStep != null; + /// + /// + /// + public bool TryPickMaxCountPerStep( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.MaxCountPerStepToolRule? value) + { + value = MaxCountPerStep; + return IsMaxCountPerStep; + } + /// /// A ToolRule that only allows a child tool to be called if the parent has been called. /// @@ -150,6 +241,19 @@ namespace Letta #endif public bool IsParentLastTool => ParentLastTool != null; + /// + /// + /// + public bool TryPickParentLastTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.ParentToolRule? value) + { + value = ParentLastTool; + return IsParentLastTool; + } + /// /// Represents a tool rule configuration which requires approval before the tool can be invoked. /// @@ -166,6 +270,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RequiresApproval))] #endif public bool IsRequiresApproval => RequiresApproval != null; + + /// + /// + /// + public bool TryPickRequiresApproval( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Letta.RequiresApprovalToolRule? value) + { + value = RequiresApproval; + return IsRequiresApproval; + } /// /// /// @@ -399,15 +516,15 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? constrainChildTools = null, - global::System.Func? runFirst = null, - global::System.Func? exitLoop = null, - global::System.Func? conditional = null, - global::System.Func? continueLoop = null, - global::System.Func? requiredBeforeExit = null, - global::System.Func? maxCountPerStep = null, - global::System.Func? parentLastTool = null, - global::System.Func? requiresApproval = null, + global::System.Func? constrainChildTools = null, + global::System.Func? runFirst = null, + global::System.Func? exitLoop = null, + global::System.Func? conditional = null, + global::System.Func? continueLoop = null, + global::System.Func? requiredBeforeExit = null, + global::System.Func? maxCountPerStep = null, + global::System.Func? parentLastTool = null, + global::System.Func? requiresApproval = null, bool validate = true) { if (validate) @@ -459,15 +576,81 @@ public bool Validate() /// /// public void Match( - global::System.Action? constrainChildTools = null, - global::System.Action? runFirst = null, - global::System.Action? exitLoop = null, - global::System.Action? conditional = null, - global::System.Action? continueLoop = null, - global::System.Action? requiredBeforeExit = null, - global::System.Action? maxCountPerStep = null, - global::System.Action? parentLastTool = null, - global::System.Action? requiresApproval = null, + global::System.Action? constrainChildTools = null, + + global::System.Action? runFirst = null, + + global::System.Action? exitLoop = null, + + global::System.Action? conditional = null, + + global::System.Action? continueLoop = null, + + global::System.Action? requiredBeforeExit = null, + + global::System.Action? maxCountPerStep = null, + + global::System.Action? parentLastTool = null, + + global::System.Action? requiresApproval = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsConstrainChildTools) + { + constrainChildTools?.Invoke(ConstrainChildTools!); + } + else if (IsRunFirst) + { + runFirst?.Invoke(RunFirst!); + } + else if (IsExitLoop) + { + exitLoop?.Invoke(ExitLoop!); + } + else if (IsConditional) + { + conditional?.Invoke(Conditional!); + } + else if (IsContinueLoop) + { + continueLoop?.Invoke(ContinueLoop!); + } + else if (IsRequiredBeforeExit) + { + requiredBeforeExit?.Invoke(RequiredBeforeExit!); + } + else if (IsMaxCountPerStep) + { + maxCountPerStep?.Invoke(MaxCountPerStep!); + } + else if (IsParentLastTool) + { + parentLastTool?.Invoke(ParentLastTool!); + } + else if (IsRequiresApproval) + { + requiresApproval?.Invoke(RequiresApproval!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? constrainChildTools = null, + global::System.Action? runFirst = null, + global::System.Action? exitLoop = null, + global::System.Action? conditional = null, + global::System.Action? continueLoop = null, + global::System.Action? requiredBeforeExit = null, + global::System.Action? maxCountPerStep = null, + global::System.Action? parentLastTool = null, + global::System.Action? requiresApproval = null, bool validate = true) { if (validate) diff --git a/src/libs/Letta/Generated/Letta.OneOf.2.g.cs b/src/libs/Letta/Generated/Letta.OneOf.2.g.cs index d8033e2d..40e312b6 100644 --- a/src/libs/Letta/Generated/Letta.OneOf.2.g.cs +++ b/src/libs/Letta/Generated/Letta.OneOf.2.g.cs @@ -25,6 +25,19 @@ namespace Letta #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 Letta [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/Letta/Generated/Letta.OneOf.6.g.cs b/src/libs/Letta/Generated/Letta.OneOf.6.g.cs index 7de53264..d809839e 100644 --- a/src/libs/Letta/Generated/Letta.OneOf.6.g.cs +++ b/src/libs/Letta/Generated/Letta.OneOf.6.g.cs @@ -25,6 +25,19 @@ namespace Letta #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 Letta #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 Letta #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 Letta #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; + } + /// /// /// @@ -93,6 +145,19 @@ namespace Letta #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; + } + /// /// /// @@ -109,6 +174,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value6))] #endif public bool IsValue6 => Value6 != null; + + /// + /// + /// + public bool TryPickValue6( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T6? value) + { + value = Value6; + return IsValue6; + } /// /// /// @@ -319,6 +397,54 @@ 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, + + global::System.Action? value6 = 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!); + } + else if (IsValue6) + { + value6?.Invoke(Value6!); + } + } + + /// + /// + /// + 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/Letta/Generated/Letta.OneOf.9.g.cs b/src/libs/Letta/Generated/Letta.OneOf.9.g.cs index 397b0bff..63abbbee 100644 --- a/src/libs/Letta/Generated/Letta.OneOf.9.g.cs +++ b/src/libs/Letta/Generated/Letta.OneOf.9.g.cs @@ -25,6 +25,19 @@ namespace Letta #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 Letta #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 Letta #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 Letta #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; + } + /// /// /// @@ -93,6 +145,19 @@ namespace Letta #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; + } + /// /// /// @@ -110,6 +175,19 @@ namespace Letta #endif public bool IsValue6 => Value6 != null; + /// + /// + /// + public bool TryPickValue6( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T6? value) + { + value = Value6; + return IsValue6; + } + /// /// /// @@ -127,6 +205,19 @@ namespace Letta #endif public bool IsValue7 => Value7 != null; + /// + /// + /// + public bool TryPickValue7( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T7? value) + { + value = Value7; + return IsValue7; + } + /// /// /// @@ -144,6 +235,19 @@ namespace Letta #endif public bool IsValue8 => Value8 != null; + /// + /// + /// + public bool TryPickValue8( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T8? value) + { + value = Value8; + return IsValue8; + } + /// /// /// @@ -160,6 +264,19 @@ namespace Letta [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value9))] #endif public bool IsValue9 => Value9 != null; + + /// + /// + /// + public bool TryPickValue9( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T9? value) + { + value = Value9; + return IsValue9; + } /// /// /// @@ -451,6 +568,72 @@ 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, + + global::System.Action? value6 = null, + + global::System.Action? value7 = null, + + global::System.Action? value8 = null, + + global::System.Action? value9 = 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!); + } + else if (IsValue6) + { + value6?.Invoke(Value6!); + } + else if (IsValue7) + { + value7?.Invoke(Value7!); + } + else if (IsValue8) + { + value8?.Invoke(Value8!); + } + else if (IsValue9) + { + value9?.Invoke(Value9!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, global::System.Action? value4 = null,