diff --git a/src/libs/PromptLayer/Generated/PromptLayer.AnyOf.2.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.AnyOf.2.g.cs index 33f663c..95c9297 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.AnyOf.2.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.AnyOf.2.g.cs @@ -38,6 +38,13 @@ public bool TryPickValue1( return IsValue1; } + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -67,6 +74,13 @@ public bool TryPickValue2( value = Value2; return IsValue2; } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); /// /// /// @@ -85,6 +99,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -103,6 +122,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.AnyOf.3.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.AnyOf.3.g.cs index f26dba0..14bca73 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.AnyOf.3.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.AnyOf.3.g.cs @@ -38,6 +38,13 @@ public bool TryPickValue1( return IsValue1; } + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -68,6 +75,13 @@ public bool TryPickValue2( return IsValue2; } + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// /// /// @@ -97,6 +111,13 @@ public bool TryPickValue3( value = Value3; return IsValue3; } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); /// /// /// @@ -115,6 +136,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -133,6 +159,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -151,6 +182,11 @@ public AnyOf(T3? value) Value3 = value; } + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem.g.cs index d12d440..2a27212 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem.g.cs @@ -44,6 +44,13 @@ public bool TryPickText( return IsText; } + /// + /// + /// + public global::PromptLayer.TextContent PickText() => IsText + ? Text! + : throw new global::System.InvalidOperationException($"Expected union variant 'Text' but the value was {ToString()}."); + /// /// /// @@ -74,6 +81,13 @@ public bool TryPickThinking( return IsThinking; } + /// + /// + /// + public global::PromptLayer.ThinkingContent PickThinking() => IsThinking + ? Thinking! + : throw new global::System.InvalidOperationException($"Expected union variant 'Thinking' but the value was {ToString()}."); + /// /// Code content block (e.g. from code execution tools). /// @@ -104,6 +118,13 @@ public bool TryPickCode( return IsCode; } + /// + /// + /// + public global::PromptLayer.CodeContent PickCode() => IsCode + ? Code! + : throw new global::System.InvalidOperationException($"Expected union variant 'Code' but the value was {ToString()}."); + /// /// /// @@ -134,6 +155,13 @@ public bool TryPickImageUrl( return IsImageUrl; } + /// + /// + /// + public global::PromptLayer.ImageContent PickImageUrl() => IsImageUrl + ? ImageUrl! + : throw new global::System.InvalidOperationException($"Expected union variant 'ImageUrl' but the value was {ToString()}."); + /// /// /// @@ -164,6 +192,13 @@ public bool TryPickMedia( return IsMedia; } + /// + /// + /// + public global::PromptLayer.MediaContent PickMedia() => IsMedia + ? Media! + : throw new global::System.InvalidOperationException($"Expected union variant 'Media' but the value was {ToString()}."); + /// /// /// @@ -194,6 +229,13 @@ public bool TryPickMediaVariable( return IsMediaVariable; } + /// + /// + /// + public global::PromptLayer.MediaVariable PickMediaVariable() => IsMediaVariable + ? MediaVariable! + : throw new global::System.InvalidOperationException($"Expected union variant 'MediaVariable' but the value was {ToString()}."); + /// /// LLM-generated media output (e.g. from image generation tools). /// @@ -224,6 +266,13 @@ public bool TryPickOutputMedia( return IsOutputMedia; } + /// + /// + /// + public global::PromptLayer.OutputMediaContent PickOutputMedia() => IsOutputMedia + ? OutputMedia! + : throw new global::System.InvalidOperationException($"Expected union variant 'OutputMedia' but the value was {ToString()}."); + /// /// Server-side tool use block (e.g. web search, code execution). /// @@ -254,6 +303,13 @@ public bool TryPickServerToolUse( return IsServerToolUse; } + /// + /// + /// + public global::PromptLayer.ServerToolUseContent PickServerToolUse() => IsServerToolUse + ? ServerToolUse! + : throw new global::System.InvalidOperationException($"Expected union variant 'ServerToolUse' but the value was {ToString()}."); + /// /// Results from a web search tool invocation. /// @@ -284,6 +340,13 @@ public bool TryPickWebSearchToolResult( return IsWebSearchToolResult; } + /// + /// + /// + public global::PromptLayer.WebSearchToolResultContent PickWebSearchToolResult() => IsWebSearchToolResult + ? WebSearchToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'WebSearchToolResult' but the value was {ToString()}."); + /// /// Result from a code execution tool. /// @@ -314,6 +377,13 @@ public bool TryPickCodeExecutionResult( return IsCodeExecutionResult; } + /// + /// + /// + public global::PromptLayer.CodeExecutionResultContent PickCodeExecutionResult() => IsCodeExecutionResult + ? CodeExecutionResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'CodeExecutionResult' but the value was {ToString()}."); + /// /// MCP list tools response block. /// @@ -344,6 +414,13 @@ public bool TryPickMcpListTools( return IsMcpListTools; } + /// + /// + /// + public global::PromptLayer.McpListToolsContent PickMcpListTools() => IsMcpListTools + ? McpListTools! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpListTools' but the value was {ToString()}."); + /// /// MCP tool call block. /// @@ -374,6 +451,13 @@ public bool TryPickMcpCall( return IsMcpCall; } + /// + /// + /// + public global::PromptLayer.McpCallContent PickMcpCall() => IsMcpCall + ? McpCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpCall' but the value was {ToString()}."); + /// /// MCP tool approval request block. /// @@ -404,6 +488,13 @@ public bool TryPickMcpApprovalRequest( return IsMcpApprovalRequest; } + /// + /// + /// + public global::PromptLayer.McpApprovalRequestContent PickMcpApprovalRequest() => IsMcpApprovalRequest + ? McpApprovalRequest! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalRequest' but the value was {ToString()}."); + /// /// MCP tool approval response block. /// @@ -434,6 +525,13 @@ public bool TryPickMcpApprovalResponse( return IsMcpApprovalResponse; } + /// + /// + /// + public global::PromptLayer.McpApprovalResponseContent PickMcpApprovalResponse() => IsMcpApprovalResponse + ? McpApprovalResponse! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalResponse' but the value was {ToString()}."); + /// /// Result from bash code execution tool. /// @@ -464,6 +562,13 @@ public bool TryPickBashCodeExecutionToolResult( return IsBashCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.BashCodeExecutionToolResultContent PickBashCodeExecutionToolResult() => IsBashCodeExecutionToolResult + ? BashCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'BashCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Result from text editor code execution tool. /// @@ -494,6 +599,13 @@ public bool TryPickTextEditorCodeExecutionToolResult( return IsTextEditorCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.TextEditorCodeExecutionToolResultContent PickTextEditorCodeExecutionToolResult() => IsTextEditorCodeExecutionToolResult + ? TextEditorCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'TextEditorCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Shell tool call block. /// @@ -524,6 +636,13 @@ public bool TryPickShellCall( return IsShellCall; } + /// + /// + /// + public global::PromptLayer.ShellCallContent PickShellCall() => IsShellCall + ? ShellCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCall' but the value was {ToString()}."); + /// /// Shell tool output block. /// @@ -554,6 +673,13 @@ public bool TryPickShellCallOutput( return IsShellCallOutput; } + /// + /// + /// + public global::PromptLayer.ShellCallOutputContent PickShellCallOutput() => IsShellCallOutput + ? ShellCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCallOutput' but the value was {ToString()}."); + /// /// Apply patch tool call block. /// @@ -584,6 +710,13 @@ public bool TryPickApplyPatchCall( return IsApplyPatchCall; } + /// + /// + /// + public global::PromptLayer.ApplyPatchCallContent PickApplyPatchCall() => IsApplyPatchCall + ? ApplyPatchCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCall' but the value was {ToString()}."); + /// /// Apply patch tool output block. /// @@ -613,6 +746,13 @@ public bool TryPickApplyPatchCallOutput( value = ApplyPatchCallOutput; return IsApplyPatchCallOutput; } + + /// + /// + /// + public global::PromptLayer.ApplyPatchCallOutputContent PickApplyPatchCallOutput() => IsApplyPatchCallOutput + ? ApplyPatchCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCallOutput' but the value was {ToString()}."); /// /// /// @@ -631,6 +771,11 @@ public ContentItem(global::PromptLayer.TextContent? value) Text = value; } + /// + /// + /// + public static ContentItem FromText(global::PromptLayer.TextContent? value) => new ContentItem(value); + /// /// /// @@ -649,6 +794,11 @@ public ContentItem(global::PromptLayer.ThinkingContent? value) Thinking = value; } + /// + /// + /// + public static ContentItem FromThinking(global::PromptLayer.ThinkingContent? value) => new ContentItem(value); + /// /// /// @@ -667,6 +817,11 @@ public ContentItem(global::PromptLayer.CodeContent? value) Code = value; } + /// + /// + /// + public static ContentItem FromCode(global::PromptLayer.CodeContent? value) => new ContentItem(value); + /// /// /// @@ -685,6 +840,11 @@ public ContentItem(global::PromptLayer.ImageContent? value) ImageUrl = value; } + /// + /// + /// + public static ContentItem FromImageUrl(global::PromptLayer.ImageContent? value) => new ContentItem(value); + /// /// /// @@ -703,6 +863,11 @@ public ContentItem(global::PromptLayer.MediaContent? value) Media = value; } + /// + /// + /// + public static ContentItem FromMedia(global::PromptLayer.MediaContent? value) => new ContentItem(value); + /// /// /// @@ -721,6 +886,11 @@ public ContentItem(global::PromptLayer.MediaVariable? value) MediaVariable = value; } + /// + /// + /// + public static ContentItem FromMediaVariable(global::PromptLayer.MediaVariable? value) => new ContentItem(value); + /// /// /// @@ -739,6 +909,11 @@ public ContentItem(global::PromptLayer.OutputMediaContent? value) OutputMedia = value; } + /// + /// + /// + public static ContentItem FromOutputMedia(global::PromptLayer.OutputMediaContent? value) => new ContentItem(value); + /// /// /// @@ -757,6 +932,11 @@ public ContentItem(global::PromptLayer.ServerToolUseContent? value) ServerToolUse = value; } + /// + /// + /// + public static ContentItem FromServerToolUse(global::PromptLayer.ServerToolUseContent? value) => new ContentItem(value); + /// /// /// @@ -775,6 +955,11 @@ public ContentItem(global::PromptLayer.WebSearchToolResultContent? value) WebSearchToolResult = value; } + /// + /// + /// + public static ContentItem FromWebSearchToolResult(global::PromptLayer.WebSearchToolResultContent? value) => new ContentItem(value); + /// /// /// @@ -793,6 +978,11 @@ public ContentItem(global::PromptLayer.CodeExecutionResultContent? value) CodeExecutionResult = value; } + /// + /// + /// + public static ContentItem FromCodeExecutionResult(global::PromptLayer.CodeExecutionResultContent? value) => new ContentItem(value); + /// /// /// @@ -811,6 +1001,11 @@ public ContentItem(global::PromptLayer.McpListToolsContent? value) McpListTools = value; } + /// + /// + /// + public static ContentItem FromMcpListTools(global::PromptLayer.McpListToolsContent? value) => new ContentItem(value); + /// /// /// @@ -829,6 +1024,11 @@ public ContentItem(global::PromptLayer.McpCallContent? value) McpCall = value; } + /// + /// + /// + public static ContentItem FromMcpCall(global::PromptLayer.McpCallContent? value) => new ContentItem(value); + /// /// /// @@ -847,6 +1047,11 @@ public ContentItem(global::PromptLayer.McpApprovalRequestContent? value) McpApprovalRequest = value; } + /// + /// + /// + public static ContentItem FromMcpApprovalRequest(global::PromptLayer.McpApprovalRequestContent? value) => new ContentItem(value); + /// /// /// @@ -865,6 +1070,11 @@ public ContentItem(global::PromptLayer.McpApprovalResponseContent? value) McpApprovalResponse = value; } + /// + /// + /// + public static ContentItem FromMcpApprovalResponse(global::PromptLayer.McpApprovalResponseContent? value) => new ContentItem(value); + /// /// /// @@ -883,6 +1093,11 @@ public ContentItem(global::PromptLayer.BashCodeExecutionToolResultContent? value BashCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentItem FromBashCodeExecutionToolResult(global::PromptLayer.BashCodeExecutionToolResultContent? value) => new ContentItem(value); + /// /// /// @@ -901,6 +1116,11 @@ public ContentItem(global::PromptLayer.TextEditorCodeExecutionToolResultContent? TextEditorCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentItem FromTextEditorCodeExecutionToolResult(global::PromptLayer.TextEditorCodeExecutionToolResultContent? value) => new ContentItem(value); + /// /// /// @@ -919,6 +1139,11 @@ public ContentItem(global::PromptLayer.ShellCallContent? value) ShellCall = value; } + /// + /// + /// + public static ContentItem FromShellCall(global::PromptLayer.ShellCallContent? value) => new ContentItem(value); + /// /// /// @@ -937,6 +1162,11 @@ public ContentItem(global::PromptLayer.ShellCallOutputContent? value) ShellCallOutput = value; } + /// + /// + /// + public static ContentItem FromShellCallOutput(global::PromptLayer.ShellCallOutputContent? value) => new ContentItem(value); + /// /// /// @@ -955,6 +1185,11 @@ public ContentItem(global::PromptLayer.ApplyPatchCallContent? value) ApplyPatchCall = value; } + /// + /// + /// + public static ContentItem FromApplyPatchCall(global::PromptLayer.ApplyPatchCallContent? value) => new ContentItem(value); + /// /// /// @@ -973,6 +1208,11 @@ public ContentItem(global::PromptLayer.ApplyPatchCallOutputContent? value) ApplyPatchCallOutput = value; } + /// + /// + /// + public static ContentItem FromApplyPatchCallOutput(global::PromptLayer.ApplyPatchCallOutputContent? value) => new ContentItem(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem2.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem2.g.cs index f5037ee..c2d0483 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem2.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem2.g.cs @@ -44,6 +44,13 @@ public bool TryPickText( return IsText; } + /// + /// + /// + public global::PromptLayer.TextContent PickText() => IsText + ? Text! + : throw new global::System.InvalidOperationException($"Expected union variant 'Text' but the value was {ToString()}."); + /// /// /// @@ -74,6 +81,13 @@ public bool TryPickThinking( return IsThinking; } + /// + /// + /// + public global::PromptLayer.ThinkingContent PickThinking() => IsThinking + ? Thinking! + : throw new global::System.InvalidOperationException($"Expected union variant 'Thinking' but the value was {ToString()}."); + /// /// Code content block (e.g. from code execution tools). /// @@ -104,6 +118,13 @@ public bool TryPickCode( return IsCode; } + /// + /// + /// + public global::PromptLayer.CodeContent PickCode() => IsCode + ? Code! + : throw new global::System.InvalidOperationException($"Expected union variant 'Code' but the value was {ToString()}."); + /// /// /// @@ -134,6 +155,13 @@ public bool TryPickImageUrl( return IsImageUrl; } + /// + /// + /// + public global::PromptLayer.ImageContent PickImageUrl() => IsImageUrl + ? ImageUrl! + : throw new global::System.InvalidOperationException($"Expected union variant 'ImageUrl' but the value was {ToString()}."); + /// /// /// @@ -164,6 +192,13 @@ public bool TryPickMedia( return IsMedia; } + /// + /// + /// + public global::PromptLayer.MediaContent PickMedia() => IsMedia + ? Media! + : throw new global::System.InvalidOperationException($"Expected union variant 'Media' but the value was {ToString()}."); + /// /// /// @@ -194,6 +229,13 @@ public bool TryPickMediaVariable( return IsMediaVariable; } + /// + /// + /// + public global::PromptLayer.MediaVariable PickMediaVariable() => IsMediaVariable + ? MediaVariable! + : throw new global::System.InvalidOperationException($"Expected union variant 'MediaVariable' but the value was {ToString()}."); + /// /// LLM-generated media output (e.g. from image generation tools). /// @@ -224,6 +266,13 @@ public bool TryPickOutputMedia( return IsOutputMedia; } + /// + /// + /// + public global::PromptLayer.OutputMediaContent PickOutputMedia() => IsOutputMedia + ? OutputMedia! + : throw new global::System.InvalidOperationException($"Expected union variant 'OutputMedia' but the value was {ToString()}."); + /// /// Server-side tool use block (e.g. web search, code execution). /// @@ -254,6 +303,13 @@ public bool TryPickServerToolUse( return IsServerToolUse; } + /// + /// + /// + public global::PromptLayer.ServerToolUseContent PickServerToolUse() => IsServerToolUse + ? ServerToolUse! + : throw new global::System.InvalidOperationException($"Expected union variant 'ServerToolUse' but the value was {ToString()}."); + /// /// Results from a web search tool invocation. /// @@ -284,6 +340,13 @@ public bool TryPickWebSearchToolResult( return IsWebSearchToolResult; } + /// + /// + /// + public global::PromptLayer.WebSearchToolResultContent PickWebSearchToolResult() => IsWebSearchToolResult + ? WebSearchToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'WebSearchToolResult' but the value was {ToString()}."); + /// /// Result from a code execution tool. /// @@ -314,6 +377,13 @@ public bool TryPickCodeExecutionResult( return IsCodeExecutionResult; } + /// + /// + /// + public global::PromptLayer.CodeExecutionResultContent PickCodeExecutionResult() => IsCodeExecutionResult + ? CodeExecutionResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'CodeExecutionResult' but the value was {ToString()}."); + /// /// MCP list tools response block. /// @@ -344,6 +414,13 @@ public bool TryPickMcpListTools( return IsMcpListTools; } + /// + /// + /// + public global::PromptLayer.McpListToolsContent PickMcpListTools() => IsMcpListTools + ? McpListTools! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpListTools' but the value was {ToString()}."); + /// /// MCP tool call block. /// @@ -374,6 +451,13 @@ public bool TryPickMcpCall( return IsMcpCall; } + /// + /// + /// + public global::PromptLayer.McpCallContent PickMcpCall() => IsMcpCall + ? McpCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpCall' but the value was {ToString()}."); + /// /// MCP tool approval request block. /// @@ -404,6 +488,13 @@ public bool TryPickMcpApprovalRequest( return IsMcpApprovalRequest; } + /// + /// + /// + public global::PromptLayer.McpApprovalRequestContent PickMcpApprovalRequest() => IsMcpApprovalRequest + ? McpApprovalRequest! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalRequest' but the value was {ToString()}."); + /// /// MCP tool approval response block. /// @@ -434,6 +525,13 @@ public bool TryPickMcpApprovalResponse( return IsMcpApprovalResponse; } + /// + /// + /// + public global::PromptLayer.McpApprovalResponseContent PickMcpApprovalResponse() => IsMcpApprovalResponse + ? McpApprovalResponse! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalResponse' but the value was {ToString()}."); + /// /// Result from bash code execution tool. /// @@ -464,6 +562,13 @@ public bool TryPickBashCodeExecutionToolResult( return IsBashCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.BashCodeExecutionToolResultContent PickBashCodeExecutionToolResult() => IsBashCodeExecutionToolResult + ? BashCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'BashCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Result from text editor code execution tool. /// @@ -494,6 +599,13 @@ public bool TryPickTextEditorCodeExecutionToolResult( return IsTextEditorCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.TextEditorCodeExecutionToolResultContent PickTextEditorCodeExecutionToolResult() => IsTextEditorCodeExecutionToolResult + ? TextEditorCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'TextEditorCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Shell tool call block. /// @@ -524,6 +636,13 @@ public bool TryPickShellCall( return IsShellCall; } + /// + /// + /// + public global::PromptLayer.ShellCallContent PickShellCall() => IsShellCall + ? ShellCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCall' but the value was {ToString()}."); + /// /// Shell tool output block. /// @@ -554,6 +673,13 @@ public bool TryPickShellCallOutput( return IsShellCallOutput; } + /// + /// + /// + public global::PromptLayer.ShellCallOutputContent PickShellCallOutput() => IsShellCallOutput + ? ShellCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCallOutput' but the value was {ToString()}."); + /// /// Apply patch tool call block. /// @@ -584,6 +710,13 @@ public bool TryPickApplyPatchCall( return IsApplyPatchCall; } + /// + /// + /// + public global::PromptLayer.ApplyPatchCallContent PickApplyPatchCall() => IsApplyPatchCall + ? ApplyPatchCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCall' but the value was {ToString()}."); + /// /// Apply patch tool output block. /// @@ -613,6 +746,13 @@ public bool TryPickApplyPatchCallOutput( value = ApplyPatchCallOutput; return IsApplyPatchCallOutput; } + + /// + /// + /// + public global::PromptLayer.ApplyPatchCallOutputContent PickApplyPatchCallOutput() => IsApplyPatchCallOutput + ? ApplyPatchCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCallOutput' but the value was {ToString()}."); /// /// /// @@ -631,6 +771,11 @@ public ContentItem2(global::PromptLayer.TextContent? value) Text = value; } + /// + /// + /// + public static ContentItem2 FromText(global::PromptLayer.TextContent? value) => new ContentItem2(value); + /// /// /// @@ -649,6 +794,11 @@ public ContentItem2(global::PromptLayer.ThinkingContent? value) Thinking = value; } + /// + /// + /// + public static ContentItem2 FromThinking(global::PromptLayer.ThinkingContent? value) => new ContentItem2(value); + /// /// /// @@ -667,6 +817,11 @@ public ContentItem2(global::PromptLayer.CodeContent? value) Code = value; } + /// + /// + /// + public static ContentItem2 FromCode(global::PromptLayer.CodeContent? value) => new ContentItem2(value); + /// /// /// @@ -685,6 +840,11 @@ public ContentItem2(global::PromptLayer.ImageContent? value) ImageUrl = value; } + /// + /// + /// + public static ContentItem2 FromImageUrl(global::PromptLayer.ImageContent? value) => new ContentItem2(value); + /// /// /// @@ -703,6 +863,11 @@ public ContentItem2(global::PromptLayer.MediaContent? value) Media = value; } + /// + /// + /// + public static ContentItem2 FromMedia(global::PromptLayer.MediaContent? value) => new ContentItem2(value); + /// /// /// @@ -721,6 +886,11 @@ public ContentItem2(global::PromptLayer.MediaVariable? value) MediaVariable = value; } + /// + /// + /// + public static ContentItem2 FromMediaVariable(global::PromptLayer.MediaVariable? value) => new ContentItem2(value); + /// /// /// @@ -739,6 +909,11 @@ public ContentItem2(global::PromptLayer.OutputMediaContent? value) OutputMedia = value; } + /// + /// + /// + public static ContentItem2 FromOutputMedia(global::PromptLayer.OutputMediaContent? value) => new ContentItem2(value); + /// /// /// @@ -757,6 +932,11 @@ public ContentItem2(global::PromptLayer.ServerToolUseContent? value) ServerToolUse = value; } + /// + /// + /// + public static ContentItem2 FromServerToolUse(global::PromptLayer.ServerToolUseContent? value) => new ContentItem2(value); + /// /// /// @@ -775,6 +955,11 @@ public ContentItem2(global::PromptLayer.WebSearchToolResultContent? value) WebSearchToolResult = value; } + /// + /// + /// + public static ContentItem2 FromWebSearchToolResult(global::PromptLayer.WebSearchToolResultContent? value) => new ContentItem2(value); + /// /// /// @@ -793,6 +978,11 @@ public ContentItem2(global::PromptLayer.CodeExecutionResultContent? value) CodeExecutionResult = value; } + /// + /// + /// + public static ContentItem2 FromCodeExecutionResult(global::PromptLayer.CodeExecutionResultContent? value) => new ContentItem2(value); + /// /// /// @@ -811,6 +1001,11 @@ public ContentItem2(global::PromptLayer.McpListToolsContent? value) McpListTools = value; } + /// + /// + /// + public static ContentItem2 FromMcpListTools(global::PromptLayer.McpListToolsContent? value) => new ContentItem2(value); + /// /// /// @@ -829,6 +1024,11 @@ public ContentItem2(global::PromptLayer.McpCallContent? value) McpCall = value; } + /// + /// + /// + public static ContentItem2 FromMcpCall(global::PromptLayer.McpCallContent? value) => new ContentItem2(value); + /// /// /// @@ -847,6 +1047,11 @@ public ContentItem2(global::PromptLayer.McpApprovalRequestContent? value) McpApprovalRequest = value; } + /// + /// + /// + public static ContentItem2 FromMcpApprovalRequest(global::PromptLayer.McpApprovalRequestContent? value) => new ContentItem2(value); + /// /// /// @@ -865,6 +1070,11 @@ public ContentItem2(global::PromptLayer.McpApprovalResponseContent? value) McpApprovalResponse = value; } + /// + /// + /// + public static ContentItem2 FromMcpApprovalResponse(global::PromptLayer.McpApprovalResponseContent? value) => new ContentItem2(value); + /// /// /// @@ -883,6 +1093,11 @@ public ContentItem2(global::PromptLayer.BashCodeExecutionToolResultContent? valu BashCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentItem2 FromBashCodeExecutionToolResult(global::PromptLayer.BashCodeExecutionToolResultContent? value) => new ContentItem2(value); + /// /// /// @@ -901,6 +1116,11 @@ public ContentItem2(global::PromptLayer.TextEditorCodeExecutionToolResultContent TextEditorCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentItem2 FromTextEditorCodeExecutionToolResult(global::PromptLayer.TextEditorCodeExecutionToolResultContent? value) => new ContentItem2(value); + /// /// /// @@ -919,6 +1139,11 @@ public ContentItem2(global::PromptLayer.ShellCallContent? value) ShellCall = value; } + /// + /// + /// + public static ContentItem2 FromShellCall(global::PromptLayer.ShellCallContent? value) => new ContentItem2(value); + /// /// /// @@ -937,6 +1162,11 @@ public ContentItem2(global::PromptLayer.ShellCallOutputContent? value) ShellCallOutput = value; } + /// + /// + /// + public static ContentItem2 FromShellCallOutput(global::PromptLayer.ShellCallOutputContent? value) => new ContentItem2(value); + /// /// /// @@ -955,6 +1185,11 @@ public ContentItem2(global::PromptLayer.ApplyPatchCallContent? value) ApplyPatchCall = value; } + /// + /// + /// + public static ContentItem2 FromApplyPatchCall(global::PromptLayer.ApplyPatchCallContent? value) => new ContentItem2(value); + /// /// /// @@ -973,6 +1208,11 @@ public ContentItem2(global::PromptLayer.ApplyPatchCallOutputContent? value) ApplyPatchCallOutput = value; } + /// + /// + /// + public static ContentItem2 FromApplyPatchCallOutput(global::PromptLayer.ApplyPatchCallOutputContent? value) => new ContentItem2(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem3.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem3.g.cs index 09d4d83..e7e2d29 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem3.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem3.g.cs @@ -44,6 +44,13 @@ public bool TryPickText( return IsText; } + /// + /// + /// + public global::PromptLayer.TextContent PickText() => IsText + ? Text! + : throw new global::System.InvalidOperationException($"Expected union variant 'Text' but the value was {ToString()}."); + /// /// /// @@ -74,6 +81,13 @@ public bool TryPickThinking( return IsThinking; } + /// + /// + /// + public global::PromptLayer.ThinkingContent PickThinking() => IsThinking + ? Thinking! + : throw new global::System.InvalidOperationException($"Expected union variant 'Thinking' but the value was {ToString()}."); + /// /// Code content block (e.g. from code execution tools). /// @@ -104,6 +118,13 @@ public bool TryPickCode( return IsCode; } + /// + /// + /// + public global::PromptLayer.CodeContent PickCode() => IsCode + ? Code! + : throw new global::System.InvalidOperationException($"Expected union variant 'Code' but the value was {ToString()}."); + /// /// /// @@ -134,6 +155,13 @@ public bool TryPickImageUrl( return IsImageUrl; } + /// + /// + /// + public global::PromptLayer.ImageContent PickImageUrl() => IsImageUrl + ? ImageUrl! + : throw new global::System.InvalidOperationException($"Expected union variant 'ImageUrl' but the value was {ToString()}."); + /// /// /// @@ -164,6 +192,13 @@ public bool TryPickMedia( return IsMedia; } + /// + /// + /// + public global::PromptLayer.MediaContent PickMedia() => IsMedia + ? Media! + : throw new global::System.InvalidOperationException($"Expected union variant 'Media' but the value was {ToString()}."); + /// /// /// @@ -194,6 +229,13 @@ public bool TryPickMediaVariable( return IsMediaVariable; } + /// + /// + /// + public global::PromptLayer.MediaVariable PickMediaVariable() => IsMediaVariable + ? MediaVariable! + : throw new global::System.InvalidOperationException($"Expected union variant 'MediaVariable' but the value was {ToString()}."); + /// /// LLM-generated media output (e.g. from image generation tools). /// @@ -224,6 +266,13 @@ public bool TryPickOutputMedia( return IsOutputMedia; } + /// + /// + /// + public global::PromptLayer.OutputMediaContent PickOutputMedia() => IsOutputMedia + ? OutputMedia! + : throw new global::System.InvalidOperationException($"Expected union variant 'OutputMedia' but the value was {ToString()}."); + /// /// Server-side tool use block (e.g. web search, code execution). /// @@ -254,6 +303,13 @@ public bool TryPickServerToolUse( return IsServerToolUse; } + /// + /// + /// + public global::PromptLayer.ServerToolUseContent PickServerToolUse() => IsServerToolUse + ? ServerToolUse! + : throw new global::System.InvalidOperationException($"Expected union variant 'ServerToolUse' but the value was {ToString()}."); + /// /// Results from a web search tool invocation. /// @@ -284,6 +340,13 @@ public bool TryPickWebSearchToolResult( return IsWebSearchToolResult; } + /// + /// + /// + public global::PromptLayer.WebSearchToolResultContent PickWebSearchToolResult() => IsWebSearchToolResult + ? WebSearchToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'WebSearchToolResult' but the value was {ToString()}."); + /// /// Result from a code execution tool. /// @@ -314,6 +377,13 @@ public bool TryPickCodeExecutionResult( return IsCodeExecutionResult; } + /// + /// + /// + public global::PromptLayer.CodeExecutionResultContent PickCodeExecutionResult() => IsCodeExecutionResult + ? CodeExecutionResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'CodeExecutionResult' but the value was {ToString()}."); + /// /// MCP list tools response block. /// @@ -344,6 +414,13 @@ public bool TryPickMcpListTools( return IsMcpListTools; } + /// + /// + /// + public global::PromptLayer.McpListToolsContent PickMcpListTools() => IsMcpListTools + ? McpListTools! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpListTools' but the value was {ToString()}."); + /// /// MCP tool call block. /// @@ -374,6 +451,13 @@ public bool TryPickMcpCall( return IsMcpCall; } + /// + /// + /// + public global::PromptLayer.McpCallContent PickMcpCall() => IsMcpCall + ? McpCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpCall' but the value was {ToString()}."); + /// /// MCP tool approval request block. /// @@ -404,6 +488,13 @@ public bool TryPickMcpApprovalRequest( return IsMcpApprovalRequest; } + /// + /// + /// + public global::PromptLayer.McpApprovalRequestContent PickMcpApprovalRequest() => IsMcpApprovalRequest + ? McpApprovalRequest! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalRequest' but the value was {ToString()}."); + /// /// MCP tool approval response block. /// @@ -434,6 +525,13 @@ public bool TryPickMcpApprovalResponse( return IsMcpApprovalResponse; } + /// + /// + /// + public global::PromptLayer.McpApprovalResponseContent PickMcpApprovalResponse() => IsMcpApprovalResponse + ? McpApprovalResponse! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalResponse' but the value was {ToString()}."); + /// /// Result from bash code execution tool. /// @@ -464,6 +562,13 @@ public bool TryPickBashCodeExecutionToolResult( return IsBashCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.BashCodeExecutionToolResultContent PickBashCodeExecutionToolResult() => IsBashCodeExecutionToolResult + ? BashCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'BashCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Result from text editor code execution tool. /// @@ -494,6 +599,13 @@ public bool TryPickTextEditorCodeExecutionToolResult( return IsTextEditorCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.TextEditorCodeExecutionToolResultContent PickTextEditorCodeExecutionToolResult() => IsTextEditorCodeExecutionToolResult + ? TextEditorCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'TextEditorCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Shell tool call block. /// @@ -524,6 +636,13 @@ public bool TryPickShellCall( return IsShellCall; } + /// + /// + /// + public global::PromptLayer.ShellCallContent PickShellCall() => IsShellCall + ? ShellCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCall' but the value was {ToString()}."); + /// /// Shell tool output block. /// @@ -554,6 +673,13 @@ public bool TryPickShellCallOutput( return IsShellCallOutput; } + /// + /// + /// + public global::PromptLayer.ShellCallOutputContent PickShellCallOutput() => IsShellCallOutput + ? ShellCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCallOutput' but the value was {ToString()}."); + /// /// Apply patch tool call block. /// @@ -584,6 +710,13 @@ public bool TryPickApplyPatchCall( return IsApplyPatchCall; } + /// + /// + /// + public global::PromptLayer.ApplyPatchCallContent PickApplyPatchCall() => IsApplyPatchCall + ? ApplyPatchCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCall' but the value was {ToString()}."); + /// /// Apply patch tool output block. /// @@ -613,6 +746,13 @@ public bool TryPickApplyPatchCallOutput( value = ApplyPatchCallOutput; return IsApplyPatchCallOutput; } + + /// + /// + /// + public global::PromptLayer.ApplyPatchCallOutputContent PickApplyPatchCallOutput() => IsApplyPatchCallOutput + ? ApplyPatchCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCallOutput' but the value was {ToString()}."); /// /// /// @@ -631,6 +771,11 @@ public ContentItem3(global::PromptLayer.TextContent? value) Text = value; } + /// + /// + /// + public static ContentItem3 FromText(global::PromptLayer.TextContent? value) => new ContentItem3(value); + /// /// /// @@ -649,6 +794,11 @@ public ContentItem3(global::PromptLayer.ThinkingContent? value) Thinking = value; } + /// + /// + /// + public static ContentItem3 FromThinking(global::PromptLayer.ThinkingContent? value) => new ContentItem3(value); + /// /// /// @@ -667,6 +817,11 @@ public ContentItem3(global::PromptLayer.CodeContent? value) Code = value; } + /// + /// + /// + public static ContentItem3 FromCode(global::PromptLayer.CodeContent? value) => new ContentItem3(value); + /// /// /// @@ -685,6 +840,11 @@ public ContentItem3(global::PromptLayer.ImageContent? value) ImageUrl = value; } + /// + /// + /// + public static ContentItem3 FromImageUrl(global::PromptLayer.ImageContent? value) => new ContentItem3(value); + /// /// /// @@ -703,6 +863,11 @@ public ContentItem3(global::PromptLayer.MediaContent? value) Media = value; } + /// + /// + /// + public static ContentItem3 FromMedia(global::PromptLayer.MediaContent? value) => new ContentItem3(value); + /// /// /// @@ -721,6 +886,11 @@ public ContentItem3(global::PromptLayer.MediaVariable? value) MediaVariable = value; } + /// + /// + /// + public static ContentItem3 FromMediaVariable(global::PromptLayer.MediaVariable? value) => new ContentItem3(value); + /// /// /// @@ -739,6 +909,11 @@ public ContentItem3(global::PromptLayer.OutputMediaContent? value) OutputMedia = value; } + /// + /// + /// + public static ContentItem3 FromOutputMedia(global::PromptLayer.OutputMediaContent? value) => new ContentItem3(value); + /// /// /// @@ -757,6 +932,11 @@ public ContentItem3(global::PromptLayer.ServerToolUseContent? value) ServerToolUse = value; } + /// + /// + /// + public static ContentItem3 FromServerToolUse(global::PromptLayer.ServerToolUseContent? value) => new ContentItem3(value); + /// /// /// @@ -775,6 +955,11 @@ public ContentItem3(global::PromptLayer.WebSearchToolResultContent? value) WebSearchToolResult = value; } + /// + /// + /// + public static ContentItem3 FromWebSearchToolResult(global::PromptLayer.WebSearchToolResultContent? value) => new ContentItem3(value); + /// /// /// @@ -793,6 +978,11 @@ public ContentItem3(global::PromptLayer.CodeExecutionResultContent? value) CodeExecutionResult = value; } + /// + /// + /// + public static ContentItem3 FromCodeExecutionResult(global::PromptLayer.CodeExecutionResultContent? value) => new ContentItem3(value); + /// /// /// @@ -811,6 +1001,11 @@ public ContentItem3(global::PromptLayer.McpListToolsContent? value) McpListTools = value; } + /// + /// + /// + public static ContentItem3 FromMcpListTools(global::PromptLayer.McpListToolsContent? value) => new ContentItem3(value); + /// /// /// @@ -829,6 +1024,11 @@ public ContentItem3(global::PromptLayer.McpCallContent? value) McpCall = value; } + /// + /// + /// + public static ContentItem3 FromMcpCall(global::PromptLayer.McpCallContent? value) => new ContentItem3(value); + /// /// /// @@ -847,6 +1047,11 @@ public ContentItem3(global::PromptLayer.McpApprovalRequestContent? value) McpApprovalRequest = value; } + /// + /// + /// + public static ContentItem3 FromMcpApprovalRequest(global::PromptLayer.McpApprovalRequestContent? value) => new ContentItem3(value); + /// /// /// @@ -865,6 +1070,11 @@ public ContentItem3(global::PromptLayer.McpApprovalResponseContent? value) McpApprovalResponse = value; } + /// + /// + /// + public static ContentItem3 FromMcpApprovalResponse(global::PromptLayer.McpApprovalResponseContent? value) => new ContentItem3(value); + /// /// /// @@ -883,6 +1093,11 @@ public ContentItem3(global::PromptLayer.BashCodeExecutionToolResultContent? valu BashCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentItem3 FromBashCodeExecutionToolResult(global::PromptLayer.BashCodeExecutionToolResultContent? value) => new ContentItem3(value); + /// /// /// @@ -901,6 +1116,11 @@ public ContentItem3(global::PromptLayer.TextEditorCodeExecutionToolResultContent TextEditorCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentItem3 FromTextEditorCodeExecutionToolResult(global::PromptLayer.TextEditorCodeExecutionToolResultContent? value) => new ContentItem3(value); + /// /// /// @@ -919,6 +1139,11 @@ public ContentItem3(global::PromptLayer.ShellCallContent? value) ShellCall = value; } + /// + /// + /// + public static ContentItem3 FromShellCall(global::PromptLayer.ShellCallContent? value) => new ContentItem3(value); + /// /// /// @@ -937,6 +1162,11 @@ public ContentItem3(global::PromptLayer.ShellCallOutputContent? value) ShellCallOutput = value; } + /// + /// + /// + public static ContentItem3 FromShellCallOutput(global::PromptLayer.ShellCallOutputContent? value) => new ContentItem3(value); + /// /// /// @@ -955,6 +1185,11 @@ public ContentItem3(global::PromptLayer.ApplyPatchCallContent? value) ApplyPatchCall = value; } + /// + /// + /// + public static ContentItem3 FromApplyPatchCall(global::PromptLayer.ApplyPatchCallContent? value) => new ContentItem3(value); + /// /// /// @@ -973,6 +1208,11 @@ public ContentItem3(global::PromptLayer.ApplyPatchCallOutputContent? value) ApplyPatchCallOutput = value; } + /// + /// + /// + public static ContentItem3 FromApplyPatchCallOutput(global::PromptLayer.ApplyPatchCallOutputContent? value) => new ContentItem3(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem4.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem4.g.cs index 09b0182..ee55338 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem4.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem4.g.cs @@ -44,6 +44,13 @@ public bool TryPickText( return IsText; } + /// + /// + /// + public global::PromptLayer.TextContent PickText() => IsText + ? Text! + : throw new global::System.InvalidOperationException($"Expected union variant 'Text' but the value was {ToString()}."); + /// /// /// @@ -74,6 +81,13 @@ public bool TryPickThinking( return IsThinking; } + /// + /// + /// + public global::PromptLayer.ThinkingContent PickThinking() => IsThinking + ? Thinking! + : throw new global::System.InvalidOperationException($"Expected union variant 'Thinking' but the value was {ToString()}."); + /// /// Code content block (e.g. from code execution tools). /// @@ -104,6 +118,13 @@ public bool TryPickCode( return IsCode; } + /// + /// + /// + public global::PromptLayer.CodeContent PickCode() => IsCode + ? Code! + : throw new global::System.InvalidOperationException($"Expected union variant 'Code' but the value was {ToString()}."); + /// /// /// @@ -134,6 +155,13 @@ public bool TryPickImageUrl( return IsImageUrl; } + /// + /// + /// + public global::PromptLayer.ImageContent PickImageUrl() => IsImageUrl + ? ImageUrl! + : throw new global::System.InvalidOperationException($"Expected union variant 'ImageUrl' but the value was {ToString()}."); + /// /// /// @@ -164,6 +192,13 @@ public bool TryPickMedia( return IsMedia; } + /// + /// + /// + public global::PromptLayer.MediaContent PickMedia() => IsMedia + ? Media! + : throw new global::System.InvalidOperationException($"Expected union variant 'Media' but the value was {ToString()}."); + /// /// /// @@ -194,6 +229,13 @@ public bool TryPickMediaVariable( return IsMediaVariable; } + /// + /// + /// + public global::PromptLayer.MediaVariable PickMediaVariable() => IsMediaVariable + ? MediaVariable! + : throw new global::System.InvalidOperationException($"Expected union variant 'MediaVariable' but the value was {ToString()}."); + /// /// LLM-generated media output (e.g. from image generation tools). /// @@ -224,6 +266,13 @@ public bool TryPickOutputMedia( return IsOutputMedia; } + /// + /// + /// + public global::PromptLayer.OutputMediaContent PickOutputMedia() => IsOutputMedia + ? OutputMedia! + : throw new global::System.InvalidOperationException($"Expected union variant 'OutputMedia' but the value was {ToString()}."); + /// /// Server-side tool use block (e.g. web search, code execution). /// @@ -254,6 +303,13 @@ public bool TryPickServerToolUse( return IsServerToolUse; } + /// + /// + /// + public global::PromptLayer.ServerToolUseContent PickServerToolUse() => IsServerToolUse + ? ServerToolUse! + : throw new global::System.InvalidOperationException($"Expected union variant 'ServerToolUse' but the value was {ToString()}."); + /// /// Results from a web search tool invocation. /// @@ -284,6 +340,13 @@ public bool TryPickWebSearchToolResult( return IsWebSearchToolResult; } + /// + /// + /// + public global::PromptLayer.WebSearchToolResultContent PickWebSearchToolResult() => IsWebSearchToolResult + ? WebSearchToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'WebSearchToolResult' but the value was {ToString()}."); + /// /// Result from a code execution tool. /// @@ -314,6 +377,13 @@ public bool TryPickCodeExecutionResult( return IsCodeExecutionResult; } + /// + /// + /// + public global::PromptLayer.CodeExecutionResultContent PickCodeExecutionResult() => IsCodeExecutionResult + ? CodeExecutionResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'CodeExecutionResult' but the value was {ToString()}."); + /// /// MCP list tools response block. /// @@ -344,6 +414,13 @@ public bool TryPickMcpListTools( return IsMcpListTools; } + /// + /// + /// + public global::PromptLayer.McpListToolsContent PickMcpListTools() => IsMcpListTools + ? McpListTools! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpListTools' but the value was {ToString()}."); + /// /// MCP tool call block. /// @@ -374,6 +451,13 @@ public bool TryPickMcpCall( return IsMcpCall; } + /// + /// + /// + public global::PromptLayer.McpCallContent PickMcpCall() => IsMcpCall + ? McpCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpCall' but the value was {ToString()}."); + /// /// MCP tool approval request block. /// @@ -404,6 +488,13 @@ public bool TryPickMcpApprovalRequest( return IsMcpApprovalRequest; } + /// + /// + /// + public global::PromptLayer.McpApprovalRequestContent PickMcpApprovalRequest() => IsMcpApprovalRequest + ? McpApprovalRequest! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalRequest' but the value was {ToString()}."); + /// /// MCP tool approval response block. /// @@ -434,6 +525,13 @@ public bool TryPickMcpApprovalResponse( return IsMcpApprovalResponse; } + /// + /// + /// + public global::PromptLayer.McpApprovalResponseContent PickMcpApprovalResponse() => IsMcpApprovalResponse + ? McpApprovalResponse! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalResponse' but the value was {ToString()}."); + /// /// Result from bash code execution tool. /// @@ -464,6 +562,13 @@ public bool TryPickBashCodeExecutionToolResult( return IsBashCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.BashCodeExecutionToolResultContent PickBashCodeExecutionToolResult() => IsBashCodeExecutionToolResult + ? BashCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'BashCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Result from text editor code execution tool. /// @@ -494,6 +599,13 @@ public bool TryPickTextEditorCodeExecutionToolResult( return IsTextEditorCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.TextEditorCodeExecutionToolResultContent PickTextEditorCodeExecutionToolResult() => IsTextEditorCodeExecutionToolResult + ? TextEditorCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'TextEditorCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Shell tool call block. /// @@ -524,6 +636,13 @@ public bool TryPickShellCall( return IsShellCall; } + /// + /// + /// + public global::PromptLayer.ShellCallContent PickShellCall() => IsShellCall + ? ShellCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCall' but the value was {ToString()}."); + /// /// Shell tool output block. /// @@ -554,6 +673,13 @@ public bool TryPickShellCallOutput( return IsShellCallOutput; } + /// + /// + /// + public global::PromptLayer.ShellCallOutputContent PickShellCallOutput() => IsShellCallOutput + ? ShellCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCallOutput' but the value was {ToString()}."); + /// /// Apply patch tool call block. /// @@ -584,6 +710,13 @@ public bool TryPickApplyPatchCall( return IsApplyPatchCall; } + /// + /// + /// + public global::PromptLayer.ApplyPatchCallContent PickApplyPatchCall() => IsApplyPatchCall + ? ApplyPatchCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCall' but the value was {ToString()}."); + /// /// Apply patch tool output block. /// @@ -613,6 +746,13 @@ public bool TryPickApplyPatchCallOutput( value = ApplyPatchCallOutput; return IsApplyPatchCallOutput; } + + /// + /// + /// + public global::PromptLayer.ApplyPatchCallOutputContent PickApplyPatchCallOutput() => IsApplyPatchCallOutput + ? ApplyPatchCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCallOutput' but the value was {ToString()}."); /// /// /// @@ -631,6 +771,11 @@ public ContentItem4(global::PromptLayer.TextContent? value) Text = value; } + /// + /// + /// + public static ContentItem4 FromText(global::PromptLayer.TextContent? value) => new ContentItem4(value); + /// /// /// @@ -649,6 +794,11 @@ public ContentItem4(global::PromptLayer.ThinkingContent? value) Thinking = value; } + /// + /// + /// + public static ContentItem4 FromThinking(global::PromptLayer.ThinkingContent? value) => new ContentItem4(value); + /// /// /// @@ -667,6 +817,11 @@ public ContentItem4(global::PromptLayer.CodeContent? value) Code = value; } + /// + /// + /// + public static ContentItem4 FromCode(global::PromptLayer.CodeContent? value) => new ContentItem4(value); + /// /// /// @@ -685,6 +840,11 @@ public ContentItem4(global::PromptLayer.ImageContent? value) ImageUrl = value; } + /// + /// + /// + public static ContentItem4 FromImageUrl(global::PromptLayer.ImageContent? value) => new ContentItem4(value); + /// /// /// @@ -703,6 +863,11 @@ public ContentItem4(global::PromptLayer.MediaContent? value) Media = value; } + /// + /// + /// + public static ContentItem4 FromMedia(global::PromptLayer.MediaContent? value) => new ContentItem4(value); + /// /// /// @@ -721,6 +886,11 @@ public ContentItem4(global::PromptLayer.MediaVariable? value) MediaVariable = value; } + /// + /// + /// + public static ContentItem4 FromMediaVariable(global::PromptLayer.MediaVariable? value) => new ContentItem4(value); + /// /// /// @@ -739,6 +909,11 @@ public ContentItem4(global::PromptLayer.OutputMediaContent? value) OutputMedia = value; } + /// + /// + /// + public static ContentItem4 FromOutputMedia(global::PromptLayer.OutputMediaContent? value) => new ContentItem4(value); + /// /// /// @@ -757,6 +932,11 @@ public ContentItem4(global::PromptLayer.ServerToolUseContent? value) ServerToolUse = value; } + /// + /// + /// + public static ContentItem4 FromServerToolUse(global::PromptLayer.ServerToolUseContent? value) => new ContentItem4(value); + /// /// /// @@ -775,6 +955,11 @@ public ContentItem4(global::PromptLayer.WebSearchToolResultContent? value) WebSearchToolResult = value; } + /// + /// + /// + public static ContentItem4 FromWebSearchToolResult(global::PromptLayer.WebSearchToolResultContent? value) => new ContentItem4(value); + /// /// /// @@ -793,6 +978,11 @@ public ContentItem4(global::PromptLayer.CodeExecutionResultContent? value) CodeExecutionResult = value; } + /// + /// + /// + public static ContentItem4 FromCodeExecutionResult(global::PromptLayer.CodeExecutionResultContent? value) => new ContentItem4(value); + /// /// /// @@ -811,6 +1001,11 @@ public ContentItem4(global::PromptLayer.McpListToolsContent? value) McpListTools = value; } + /// + /// + /// + public static ContentItem4 FromMcpListTools(global::PromptLayer.McpListToolsContent? value) => new ContentItem4(value); + /// /// /// @@ -829,6 +1024,11 @@ public ContentItem4(global::PromptLayer.McpCallContent? value) McpCall = value; } + /// + /// + /// + public static ContentItem4 FromMcpCall(global::PromptLayer.McpCallContent? value) => new ContentItem4(value); + /// /// /// @@ -847,6 +1047,11 @@ public ContentItem4(global::PromptLayer.McpApprovalRequestContent? value) McpApprovalRequest = value; } + /// + /// + /// + public static ContentItem4 FromMcpApprovalRequest(global::PromptLayer.McpApprovalRequestContent? value) => new ContentItem4(value); + /// /// /// @@ -865,6 +1070,11 @@ public ContentItem4(global::PromptLayer.McpApprovalResponseContent? value) McpApprovalResponse = value; } + /// + /// + /// + public static ContentItem4 FromMcpApprovalResponse(global::PromptLayer.McpApprovalResponseContent? value) => new ContentItem4(value); + /// /// /// @@ -883,6 +1093,11 @@ public ContentItem4(global::PromptLayer.BashCodeExecutionToolResultContent? valu BashCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentItem4 FromBashCodeExecutionToolResult(global::PromptLayer.BashCodeExecutionToolResultContent? value) => new ContentItem4(value); + /// /// /// @@ -901,6 +1116,11 @@ public ContentItem4(global::PromptLayer.TextEditorCodeExecutionToolResultContent TextEditorCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentItem4 FromTextEditorCodeExecutionToolResult(global::PromptLayer.TextEditorCodeExecutionToolResultContent? value) => new ContentItem4(value); + /// /// /// @@ -919,6 +1139,11 @@ public ContentItem4(global::PromptLayer.ShellCallContent? value) ShellCall = value; } + /// + /// + /// + public static ContentItem4 FromShellCall(global::PromptLayer.ShellCallContent? value) => new ContentItem4(value); + /// /// /// @@ -937,6 +1162,11 @@ public ContentItem4(global::PromptLayer.ShellCallOutputContent? value) ShellCallOutput = value; } + /// + /// + /// + public static ContentItem4 FromShellCallOutput(global::PromptLayer.ShellCallOutputContent? value) => new ContentItem4(value); + /// /// /// @@ -955,6 +1185,11 @@ public ContentItem4(global::PromptLayer.ApplyPatchCallContent? value) ApplyPatchCall = value; } + /// + /// + /// + public static ContentItem4 FromApplyPatchCall(global::PromptLayer.ApplyPatchCallContent? value) => new ContentItem4(value); + /// /// /// @@ -973,6 +1208,11 @@ public ContentItem4(global::PromptLayer.ApplyPatchCallOutputContent? value) ApplyPatchCallOutput = value; } + /// + /// + /// + public static ContentItem4 FromApplyPatchCallOutput(global::PromptLayer.ApplyPatchCallOutputContent? value) => new ContentItem4(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem5.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem5.g.cs index e95c736..2822748 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem5.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentItem5.g.cs @@ -44,6 +44,13 @@ public bool TryPickText( return IsText; } + /// + /// + /// + public global::PromptLayer.TextContent PickText() => IsText + ? Text! + : throw new global::System.InvalidOperationException($"Expected union variant 'Text' but the value was {ToString()}."); + /// /// /// @@ -74,6 +81,13 @@ public bool TryPickThinking( return IsThinking; } + /// + /// + /// + public global::PromptLayer.ThinkingContent PickThinking() => IsThinking + ? Thinking! + : throw new global::System.InvalidOperationException($"Expected union variant 'Thinking' but the value was {ToString()}."); + /// /// Code content block (e.g. from code execution tools). /// @@ -104,6 +118,13 @@ public bool TryPickCode( return IsCode; } + /// + /// + /// + public global::PromptLayer.CodeContent PickCode() => IsCode + ? Code! + : throw new global::System.InvalidOperationException($"Expected union variant 'Code' but the value was {ToString()}."); + /// /// /// @@ -134,6 +155,13 @@ public bool TryPickImageUrl( return IsImageUrl; } + /// + /// + /// + public global::PromptLayer.ImageContent PickImageUrl() => IsImageUrl + ? ImageUrl! + : throw new global::System.InvalidOperationException($"Expected union variant 'ImageUrl' but the value was {ToString()}."); + /// /// /// @@ -164,6 +192,13 @@ public bool TryPickMedia( return IsMedia; } + /// + /// + /// + public global::PromptLayer.MediaContent PickMedia() => IsMedia + ? Media! + : throw new global::System.InvalidOperationException($"Expected union variant 'Media' but the value was {ToString()}."); + /// /// /// @@ -194,6 +229,13 @@ public bool TryPickMediaVariable( return IsMediaVariable; } + /// + /// + /// + public global::PromptLayer.MediaVariable PickMediaVariable() => IsMediaVariable + ? MediaVariable! + : throw new global::System.InvalidOperationException($"Expected union variant 'MediaVariable' but the value was {ToString()}."); + /// /// LLM-generated media output (e.g. from image generation tools). /// @@ -224,6 +266,13 @@ public bool TryPickOutputMedia( return IsOutputMedia; } + /// + /// + /// + public global::PromptLayer.OutputMediaContent PickOutputMedia() => IsOutputMedia + ? OutputMedia! + : throw new global::System.InvalidOperationException($"Expected union variant 'OutputMedia' but the value was {ToString()}."); + /// /// Server-side tool use block (e.g. web search, code execution). /// @@ -254,6 +303,13 @@ public bool TryPickServerToolUse( return IsServerToolUse; } + /// + /// + /// + public global::PromptLayer.ServerToolUseContent PickServerToolUse() => IsServerToolUse + ? ServerToolUse! + : throw new global::System.InvalidOperationException($"Expected union variant 'ServerToolUse' but the value was {ToString()}."); + /// /// Results from a web search tool invocation. /// @@ -284,6 +340,13 @@ public bool TryPickWebSearchToolResult( return IsWebSearchToolResult; } + /// + /// + /// + public global::PromptLayer.WebSearchToolResultContent PickWebSearchToolResult() => IsWebSearchToolResult + ? WebSearchToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'WebSearchToolResult' but the value was {ToString()}."); + /// /// Result from a code execution tool. /// @@ -314,6 +377,13 @@ public bool TryPickCodeExecutionResult( return IsCodeExecutionResult; } + /// + /// + /// + public global::PromptLayer.CodeExecutionResultContent PickCodeExecutionResult() => IsCodeExecutionResult + ? CodeExecutionResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'CodeExecutionResult' but the value was {ToString()}."); + /// /// MCP list tools response block. /// @@ -344,6 +414,13 @@ public bool TryPickMcpListTools( return IsMcpListTools; } + /// + /// + /// + public global::PromptLayer.McpListToolsContent PickMcpListTools() => IsMcpListTools + ? McpListTools! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpListTools' but the value was {ToString()}."); + /// /// MCP tool call block. /// @@ -374,6 +451,13 @@ public bool TryPickMcpCall( return IsMcpCall; } + /// + /// + /// + public global::PromptLayer.McpCallContent PickMcpCall() => IsMcpCall + ? McpCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpCall' but the value was {ToString()}."); + /// /// MCP tool approval request block. /// @@ -404,6 +488,13 @@ public bool TryPickMcpApprovalRequest( return IsMcpApprovalRequest; } + /// + /// + /// + public global::PromptLayer.McpApprovalRequestContent PickMcpApprovalRequest() => IsMcpApprovalRequest + ? McpApprovalRequest! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalRequest' but the value was {ToString()}."); + /// /// MCP tool approval response block. /// @@ -434,6 +525,13 @@ public bool TryPickMcpApprovalResponse( return IsMcpApprovalResponse; } + /// + /// + /// + public global::PromptLayer.McpApprovalResponseContent PickMcpApprovalResponse() => IsMcpApprovalResponse + ? McpApprovalResponse! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalResponse' but the value was {ToString()}."); + /// /// Result from bash code execution tool. /// @@ -464,6 +562,13 @@ public bool TryPickBashCodeExecutionToolResult( return IsBashCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.BashCodeExecutionToolResultContent PickBashCodeExecutionToolResult() => IsBashCodeExecutionToolResult + ? BashCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'BashCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Result from text editor code execution tool. /// @@ -494,6 +599,13 @@ public bool TryPickTextEditorCodeExecutionToolResult( return IsTextEditorCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.TextEditorCodeExecutionToolResultContent PickTextEditorCodeExecutionToolResult() => IsTextEditorCodeExecutionToolResult + ? TextEditorCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'TextEditorCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Shell tool call block. /// @@ -524,6 +636,13 @@ public bool TryPickShellCall( return IsShellCall; } + /// + /// + /// + public global::PromptLayer.ShellCallContent PickShellCall() => IsShellCall + ? ShellCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCall' but the value was {ToString()}."); + /// /// Shell tool output block. /// @@ -554,6 +673,13 @@ public bool TryPickShellCallOutput( return IsShellCallOutput; } + /// + /// + /// + public global::PromptLayer.ShellCallOutputContent PickShellCallOutput() => IsShellCallOutput + ? ShellCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCallOutput' but the value was {ToString()}."); + /// /// Apply patch tool call block. /// @@ -584,6 +710,13 @@ public bool TryPickApplyPatchCall( return IsApplyPatchCall; } + /// + /// + /// + public global::PromptLayer.ApplyPatchCallContent PickApplyPatchCall() => IsApplyPatchCall + ? ApplyPatchCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCall' but the value was {ToString()}."); + /// /// Apply patch tool output block. /// @@ -613,6 +746,13 @@ public bool TryPickApplyPatchCallOutput( value = ApplyPatchCallOutput; return IsApplyPatchCallOutput; } + + /// + /// + /// + public global::PromptLayer.ApplyPatchCallOutputContent PickApplyPatchCallOutput() => IsApplyPatchCallOutput + ? ApplyPatchCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCallOutput' but the value was {ToString()}."); /// /// /// @@ -631,6 +771,11 @@ public ContentItem5(global::PromptLayer.TextContent? value) Text = value; } + /// + /// + /// + public static ContentItem5 FromText(global::PromptLayer.TextContent? value) => new ContentItem5(value); + /// /// /// @@ -649,6 +794,11 @@ public ContentItem5(global::PromptLayer.ThinkingContent? value) Thinking = value; } + /// + /// + /// + public static ContentItem5 FromThinking(global::PromptLayer.ThinkingContent? value) => new ContentItem5(value); + /// /// /// @@ -667,6 +817,11 @@ public ContentItem5(global::PromptLayer.CodeContent? value) Code = value; } + /// + /// + /// + public static ContentItem5 FromCode(global::PromptLayer.CodeContent? value) => new ContentItem5(value); + /// /// /// @@ -685,6 +840,11 @@ public ContentItem5(global::PromptLayer.ImageContent? value) ImageUrl = value; } + /// + /// + /// + public static ContentItem5 FromImageUrl(global::PromptLayer.ImageContent? value) => new ContentItem5(value); + /// /// /// @@ -703,6 +863,11 @@ public ContentItem5(global::PromptLayer.MediaContent? value) Media = value; } + /// + /// + /// + public static ContentItem5 FromMedia(global::PromptLayer.MediaContent? value) => new ContentItem5(value); + /// /// /// @@ -721,6 +886,11 @@ public ContentItem5(global::PromptLayer.MediaVariable? value) MediaVariable = value; } + /// + /// + /// + public static ContentItem5 FromMediaVariable(global::PromptLayer.MediaVariable? value) => new ContentItem5(value); + /// /// /// @@ -739,6 +909,11 @@ public ContentItem5(global::PromptLayer.OutputMediaContent? value) OutputMedia = value; } + /// + /// + /// + public static ContentItem5 FromOutputMedia(global::PromptLayer.OutputMediaContent? value) => new ContentItem5(value); + /// /// /// @@ -757,6 +932,11 @@ public ContentItem5(global::PromptLayer.ServerToolUseContent? value) ServerToolUse = value; } + /// + /// + /// + public static ContentItem5 FromServerToolUse(global::PromptLayer.ServerToolUseContent? value) => new ContentItem5(value); + /// /// /// @@ -775,6 +955,11 @@ public ContentItem5(global::PromptLayer.WebSearchToolResultContent? value) WebSearchToolResult = value; } + /// + /// + /// + public static ContentItem5 FromWebSearchToolResult(global::PromptLayer.WebSearchToolResultContent? value) => new ContentItem5(value); + /// /// /// @@ -793,6 +978,11 @@ public ContentItem5(global::PromptLayer.CodeExecutionResultContent? value) CodeExecutionResult = value; } + /// + /// + /// + public static ContentItem5 FromCodeExecutionResult(global::PromptLayer.CodeExecutionResultContent? value) => new ContentItem5(value); + /// /// /// @@ -811,6 +1001,11 @@ public ContentItem5(global::PromptLayer.McpListToolsContent? value) McpListTools = value; } + /// + /// + /// + public static ContentItem5 FromMcpListTools(global::PromptLayer.McpListToolsContent? value) => new ContentItem5(value); + /// /// /// @@ -829,6 +1024,11 @@ public ContentItem5(global::PromptLayer.McpCallContent? value) McpCall = value; } + /// + /// + /// + public static ContentItem5 FromMcpCall(global::PromptLayer.McpCallContent? value) => new ContentItem5(value); + /// /// /// @@ -847,6 +1047,11 @@ public ContentItem5(global::PromptLayer.McpApprovalRequestContent? value) McpApprovalRequest = value; } + /// + /// + /// + public static ContentItem5 FromMcpApprovalRequest(global::PromptLayer.McpApprovalRequestContent? value) => new ContentItem5(value); + /// /// /// @@ -865,6 +1070,11 @@ public ContentItem5(global::PromptLayer.McpApprovalResponseContent? value) McpApprovalResponse = value; } + /// + /// + /// + public static ContentItem5 FromMcpApprovalResponse(global::PromptLayer.McpApprovalResponseContent? value) => new ContentItem5(value); + /// /// /// @@ -883,6 +1093,11 @@ public ContentItem5(global::PromptLayer.BashCodeExecutionToolResultContent? valu BashCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentItem5 FromBashCodeExecutionToolResult(global::PromptLayer.BashCodeExecutionToolResultContent? value) => new ContentItem5(value); + /// /// /// @@ -901,6 +1116,11 @@ public ContentItem5(global::PromptLayer.TextEditorCodeExecutionToolResultContent TextEditorCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentItem5 FromTextEditorCodeExecutionToolResult(global::PromptLayer.TextEditorCodeExecutionToolResultContent? value) => new ContentItem5(value); + /// /// /// @@ -919,6 +1139,11 @@ public ContentItem5(global::PromptLayer.ShellCallContent? value) ShellCall = value; } + /// + /// + /// + public static ContentItem5 FromShellCall(global::PromptLayer.ShellCallContent? value) => new ContentItem5(value); + /// /// /// @@ -937,6 +1162,11 @@ public ContentItem5(global::PromptLayer.ShellCallOutputContent? value) ShellCallOutput = value; } + /// + /// + /// + public static ContentItem5 FromShellCallOutput(global::PromptLayer.ShellCallOutputContent? value) => new ContentItem5(value); + /// /// /// @@ -955,6 +1185,11 @@ public ContentItem5(global::PromptLayer.ApplyPatchCallContent? value) ApplyPatchCall = value; } + /// + /// + /// + public static ContentItem5 FromApplyPatchCall(global::PromptLayer.ApplyPatchCallContent? value) => new ContentItem5(value); + /// /// /// @@ -973,6 +1208,11 @@ public ContentItem5(global::PromptLayer.ApplyPatchCallOutputContent? value) ApplyPatchCallOutput = value; } + /// + /// + /// + public static ContentItem5 FromApplyPatchCallOutput(global::PromptLayer.ApplyPatchCallOutputContent? value) => new ContentItem5(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item.g.cs index 76c4fb3..326477a 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item.g.cs @@ -44,6 +44,13 @@ public bool TryPickText( return IsText; } + /// + /// + /// + public global::PromptLayer.TextContent PickText() => IsText + ? Text! + : throw new global::System.InvalidOperationException($"Expected union variant 'Text' but the value was {ToString()}."); + /// /// /// @@ -74,6 +81,13 @@ public bool TryPickThinking( return IsThinking; } + /// + /// + /// + public global::PromptLayer.ThinkingContent PickThinking() => IsThinking + ? Thinking! + : throw new global::System.InvalidOperationException($"Expected union variant 'Thinking' but the value was {ToString()}."); + /// /// Code content block (e.g. from code execution tools). /// @@ -104,6 +118,13 @@ public bool TryPickCode( return IsCode; } + /// + /// + /// + public global::PromptLayer.CodeContent PickCode() => IsCode + ? Code! + : throw new global::System.InvalidOperationException($"Expected union variant 'Code' but the value was {ToString()}."); + /// /// /// @@ -134,6 +155,13 @@ public bool TryPickImageUrl( return IsImageUrl; } + /// + /// + /// + public global::PromptLayer.ImageContent PickImageUrl() => IsImageUrl + ? ImageUrl! + : throw new global::System.InvalidOperationException($"Expected union variant 'ImageUrl' but the value was {ToString()}."); + /// /// /// @@ -164,6 +192,13 @@ public bool TryPickMedia( return IsMedia; } + /// + /// + /// + public global::PromptLayer.MediaContent PickMedia() => IsMedia + ? Media! + : throw new global::System.InvalidOperationException($"Expected union variant 'Media' but the value was {ToString()}."); + /// /// /// @@ -194,6 +229,13 @@ public bool TryPickMediaVariable( return IsMediaVariable; } + /// + /// + /// + public global::PromptLayer.MediaVariable PickMediaVariable() => IsMediaVariable + ? MediaVariable! + : throw new global::System.InvalidOperationException($"Expected union variant 'MediaVariable' but the value was {ToString()}."); + /// /// LLM-generated media output (e.g. from image generation tools). /// @@ -224,6 +266,13 @@ public bool TryPickOutputMedia( return IsOutputMedia; } + /// + /// + /// + public global::PromptLayer.OutputMediaContent PickOutputMedia() => IsOutputMedia + ? OutputMedia! + : throw new global::System.InvalidOperationException($"Expected union variant 'OutputMedia' but the value was {ToString()}."); + /// /// Server-side tool use block (e.g. web search, code execution). /// @@ -254,6 +303,13 @@ public bool TryPickServerToolUse( return IsServerToolUse; } + /// + /// + /// + public global::PromptLayer.ServerToolUseContent PickServerToolUse() => IsServerToolUse + ? ServerToolUse! + : throw new global::System.InvalidOperationException($"Expected union variant 'ServerToolUse' but the value was {ToString()}."); + /// /// Results from a web search tool invocation. /// @@ -284,6 +340,13 @@ public bool TryPickWebSearchToolResult( return IsWebSearchToolResult; } + /// + /// + /// + public global::PromptLayer.WebSearchToolResultContent PickWebSearchToolResult() => IsWebSearchToolResult + ? WebSearchToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'WebSearchToolResult' but the value was {ToString()}."); + /// /// Result from a code execution tool. /// @@ -314,6 +377,13 @@ public bool TryPickCodeExecutionResult( return IsCodeExecutionResult; } + /// + /// + /// + public global::PromptLayer.CodeExecutionResultContent PickCodeExecutionResult() => IsCodeExecutionResult + ? CodeExecutionResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'CodeExecutionResult' but the value was {ToString()}."); + /// /// MCP list tools response block. /// @@ -344,6 +414,13 @@ public bool TryPickMcpListTools( return IsMcpListTools; } + /// + /// + /// + public global::PromptLayer.McpListToolsContent PickMcpListTools() => IsMcpListTools + ? McpListTools! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpListTools' but the value was {ToString()}."); + /// /// MCP tool call block. /// @@ -374,6 +451,13 @@ public bool TryPickMcpCall( return IsMcpCall; } + /// + /// + /// + public global::PromptLayer.McpCallContent PickMcpCall() => IsMcpCall + ? McpCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpCall' but the value was {ToString()}."); + /// /// MCP tool approval request block. /// @@ -404,6 +488,13 @@ public bool TryPickMcpApprovalRequest( return IsMcpApprovalRequest; } + /// + /// + /// + public global::PromptLayer.McpApprovalRequestContent PickMcpApprovalRequest() => IsMcpApprovalRequest + ? McpApprovalRequest! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalRequest' but the value was {ToString()}."); + /// /// MCP tool approval response block. /// @@ -434,6 +525,13 @@ public bool TryPickMcpApprovalResponse( return IsMcpApprovalResponse; } + /// + /// + /// + public global::PromptLayer.McpApprovalResponseContent PickMcpApprovalResponse() => IsMcpApprovalResponse + ? McpApprovalResponse! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalResponse' but the value was {ToString()}."); + /// /// Result from bash code execution tool. /// @@ -464,6 +562,13 @@ public bool TryPickBashCodeExecutionToolResult( return IsBashCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.BashCodeExecutionToolResultContent PickBashCodeExecutionToolResult() => IsBashCodeExecutionToolResult + ? BashCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'BashCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Result from text editor code execution tool. /// @@ -494,6 +599,13 @@ public bool TryPickTextEditorCodeExecutionToolResult( return IsTextEditorCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.TextEditorCodeExecutionToolResultContent PickTextEditorCodeExecutionToolResult() => IsTextEditorCodeExecutionToolResult + ? TextEditorCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'TextEditorCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Shell tool call block. /// @@ -524,6 +636,13 @@ public bool TryPickShellCall( return IsShellCall; } + /// + /// + /// + public global::PromptLayer.ShellCallContent PickShellCall() => IsShellCall + ? ShellCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCall' but the value was {ToString()}."); + /// /// Shell tool output block. /// @@ -554,6 +673,13 @@ public bool TryPickShellCallOutput( return IsShellCallOutput; } + /// + /// + /// + public global::PromptLayer.ShellCallOutputContent PickShellCallOutput() => IsShellCallOutput + ? ShellCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCallOutput' but the value was {ToString()}."); + /// /// Apply patch tool call block. /// @@ -584,6 +710,13 @@ public bool TryPickApplyPatchCall( return IsApplyPatchCall; } + /// + /// + /// + public global::PromptLayer.ApplyPatchCallContent PickApplyPatchCall() => IsApplyPatchCall + ? ApplyPatchCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCall' but the value was {ToString()}."); + /// /// Apply patch tool output block. /// @@ -613,6 +746,13 @@ public bool TryPickApplyPatchCallOutput( value = ApplyPatchCallOutput; return IsApplyPatchCallOutput; } + + /// + /// + /// + public global::PromptLayer.ApplyPatchCallOutputContent PickApplyPatchCallOutput() => IsApplyPatchCallOutput + ? ApplyPatchCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCallOutput' but the value was {ToString()}."); /// /// /// @@ -631,6 +771,11 @@ public ContentVariant1Item(global::PromptLayer.TextContent? value) Text = value; } + /// + /// + /// + public static ContentVariant1Item FromText(global::PromptLayer.TextContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -649,6 +794,11 @@ public ContentVariant1Item(global::PromptLayer.ThinkingContent? value) Thinking = value; } + /// + /// + /// + public static ContentVariant1Item FromThinking(global::PromptLayer.ThinkingContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -667,6 +817,11 @@ public ContentVariant1Item(global::PromptLayer.CodeContent? value) Code = value; } + /// + /// + /// + public static ContentVariant1Item FromCode(global::PromptLayer.CodeContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -685,6 +840,11 @@ public ContentVariant1Item(global::PromptLayer.ImageContent? value) ImageUrl = value; } + /// + /// + /// + public static ContentVariant1Item FromImageUrl(global::PromptLayer.ImageContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -703,6 +863,11 @@ public ContentVariant1Item(global::PromptLayer.MediaContent? value) Media = value; } + /// + /// + /// + public static ContentVariant1Item FromMedia(global::PromptLayer.MediaContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -721,6 +886,11 @@ public ContentVariant1Item(global::PromptLayer.MediaVariable? value) MediaVariable = value; } + /// + /// + /// + public static ContentVariant1Item FromMediaVariable(global::PromptLayer.MediaVariable? value) => new ContentVariant1Item(value); + /// /// /// @@ -739,6 +909,11 @@ public ContentVariant1Item(global::PromptLayer.OutputMediaContent? value) OutputMedia = value; } + /// + /// + /// + public static ContentVariant1Item FromOutputMedia(global::PromptLayer.OutputMediaContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -757,6 +932,11 @@ public ContentVariant1Item(global::PromptLayer.ServerToolUseContent? value) ServerToolUse = value; } + /// + /// + /// + public static ContentVariant1Item FromServerToolUse(global::PromptLayer.ServerToolUseContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -775,6 +955,11 @@ public ContentVariant1Item(global::PromptLayer.WebSearchToolResultContent? value WebSearchToolResult = value; } + /// + /// + /// + public static ContentVariant1Item FromWebSearchToolResult(global::PromptLayer.WebSearchToolResultContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -793,6 +978,11 @@ public ContentVariant1Item(global::PromptLayer.CodeExecutionResultContent? value CodeExecutionResult = value; } + /// + /// + /// + public static ContentVariant1Item FromCodeExecutionResult(global::PromptLayer.CodeExecutionResultContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -811,6 +1001,11 @@ public ContentVariant1Item(global::PromptLayer.McpListToolsContent? value) McpListTools = value; } + /// + /// + /// + public static ContentVariant1Item FromMcpListTools(global::PromptLayer.McpListToolsContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -829,6 +1024,11 @@ public ContentVariant1Item(global::PromptLayer.McpCallContent? value) McpCall = value; } + /// + /// + /// + public static ContentVariant1Item FromMcpCall(global::PromptLayer.McpCallContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -847,6 +1047,11 @@ public ContentVariant1Item(global::PromptLayer.McpApprovalRequestContent? value) McpApprovalRequest = value; } + /// + /// + /// + public static ContentVariant1Item FromMcpApprovalRequest(global::PromptLayer.McpApprovalRequestContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -865,6 +1070,11 @@ public ContentVariant1Item(global::PromptLayer.McpApprovalResponseContent? value McpApprovalResponse = value; } + /// + /// + /// + public static ContentVariant1Item FromMcpApprovalResponse(global::PromptLayer.McpApprovalResponseContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -883,6 +1093,11 @@ public ContentVariant1Item(global::PromptLayer.BashCodeExecutionToolResultConten BashCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentVariant1Item FromBashCodeExecutionToolResult(global::PromptLayer.BashCodeExecutionToolResultContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -901,6 +1116,11 @@ public ContentVariant1Item(global::PromptLayer.TextEditorCodeExecutionToolResult TextEditorCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentVariant1Item FromTextEditorCodeExecutionToolResult(global::PromptLayer.TextEditorCodeExecutionToolResultContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -919,6 +1139,11 @@ public ContentVariant1Item(global::PromptLayer.ShellCallContent? value) ShellCall = value; } + /// + /// + /// + public static ContentVariant1Item FromShellCall(global::PromptLayer.ShellCallContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -937,6 +1162,11 @@ public ContentVariant1Item(global::PromptLayer.ShellCallOutputContent? value) ShellCallOutput = value; } + /// + /// + /// + public static ContentVariant1Item FromShellCallOutput(global::PromptLayer.ShellCallOutputContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -955,6 +1185,11 @@ public ContentVariant1Item(global::PromptLayer.ApplyPatchCallContent? value) ApplyPatchCall = value; } + /// + /// + /// + public static ContentVariant1Item FromApplyPatchCall(global::PromptLayer.ApplyPatchCallContent? value) => new ContentVariant1Item(value); + /// /// /// @@ -973,6 +1208,11 @@ public ContentVariant1Item(global::PromptLayer.ApplyPatchCallOutputContent? valu ApplyPatchCallOutput = value; } + /// + /// + /// + public static ContentVariant1Item FromApplyPatchCallOutput(global::PromptLayer.ApplyPatchCallOutputContent? value) => new ContentVariant1Item(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item2.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item2.g.cs index 84578b5..23f14ce 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item2.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item2.g.cs @@ -44,6 +44,13 @@ public bool TryPickText( return IsText; } + /// + /// + /// + public global::PromptLayer.TextContent PickText() => IsText + ? Text! + : throw new global::System.InvalidOperationException($"Expected union variant 'Text' but the value was {ToString()}."); + /// /// /// @@ -74,6 +81,13 @@ public bool TryPickThinking( return IsThinking; } + /// + /// + /// + public global::PromptLayer.ThinkingContent PickThinking() => IsThinking + ? Thinking! + : throw new global::System.InvalidOperationException($"Expected union variant 'Thinking' but the value was {ToString()}."); + /// /// Code content block (e.g. from code execution tools). /// @@ -104,6 +118,13 @@ public bool TryPickCode( return IsCode; } + /// + /// + /// + public global::PromptLayer.CodeContent PickCode() => IsCode + ? Code! + : throw new global::System.InvalidOperationException($"Expected union variant 'Code' but the value was {ToString()}."); + /// /// /// @@ -134,6 +155,13 @@ public bool TryPickImageUrl( return IsImageUrl; } + /// + /// + /// + public global::PromptLayer.ImageContent PickImageUrl() => IsImageUrl + ? ImageUrl! + : throw new global::System.InvalidOperationException($"Expected union variant 'ImageUrl' but the value was {ToString()}."); + /// /// /// @@ -164,6 +192,13 @@ public bool TryPickMedia( return IsMedia; } + /// + /// + /// + public global::PromptLayer.MediaContent PickMedia() => IsMedia + ? Media! + : throw new global::System.InvalidOperationException($"Expected union variant 'Media' but the value was {ToString()}."); + /// /// /// @@ -194,6 +229,13 @@ public bool TryPickMediaVariable( return IsMediaVariable; } + /// + /// + /// + public global::PromptLayer.MediaVariable PickMediaVariable() => IsMediaVariable + ? MediaVariable! + : throw new global::System.InvalidOperationException($"Expected union variant 'MediaVariable' but the value was {ToString()}."); + /// /// LLM-generated media output (e.g. from image generation tools). /// @@ -224,6 +266,13 @@ public bool TryPickOutputMedia( return IsOutputMedia; } + /// + /// + /// + public global::PromptLayer.OutputMediaContent PickOutputMedia() => IsOutputMedia + ? OutputMedia! + : throw new global::System.InvalidOperationException($"Expected union variant 'OutputMedia' but the value was {ToString()}."); + /// /// Server-side tool use block (e.g. web search, code execution). /// @@ -254,6 +303,13 @@ public bool TryPickServerToolUse( return IsServerToolUse; } + /// + /// + /// + public global::PromptLayer.ServerToolUseContent PickServerToolUse() => IsServerToolUse + ? ServerToolUse! + : throw new global::System.InvalidOperationException($"Expected union variant 'ServerToolUse' but the value was {ToString()}."); + /// /// Results from a web search tool invocation. /// @@ -284,6 +340,13 @@ public bool TryPickWebSearchToolResult( return IsWebSearchToolResult; } + /// + /// + /// + public global::PromptLayer.WebSearchToolResultContent PickWebSearchToolResult() => IsWebSearchToolResult + ? WebSearchToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'WebSearchToolResult' but the value was {ToString()}."); + /// /// Result from a code execution tool. /// @@ -314,6 +377,13 @@ public bool TryPickCodeExecutionResult( return IsCodeExecutionResult; } + /// + /// + /// + public global::PromptLayer.CodeExecutionResultContent PickCodeExecutionResult() => IsCodeExecutionResult + ? CodeExecutionResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'CodeExecutionResult' but the value was {ToString()}."); + /// /// MCP list tools response block. /// @@ -344,6 +414,13 @@ public bool TryPickMcpListTools( return IsMcpListTools; } + /// + /// + /// + public global::PromptLayer.McpListToolsContent PickMcpListTools() => IsMcpListTools + ? McpListTools! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpListTools' but the value was {ToString()}."); + /// /// MCP tool call block. /// @@ -374,6 +451,13 @@ public bool TryPickMcpCall( return IsMcpCall; } + /// + /// + /// + public global::PromptLayer.McpCallContent PickMcpCall() => IsMcpCall + ? McpCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpCall' but the value was {ToString()}."); + /// /// MCP tool approval request block. /// @@ -404,6 +488,13 @@ public bool TryPickMcpApprovalRequest( return IsMcpApprovalRequest; } + /// + /// + /// + public global::PromptLayer.McpApprovalRequestContent PickMcpApprovalRequest() => IsMcpApprovalRequest + ? McpApprovalRequest! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalRequest' but the value was {ToString()}."); + /// /// MCP tool approval response block. /// @@ -434,6 +525,13 @@ public bool TryPickMcpApprovalResponse( return IsMcpApprovalResponse; } + /// + /// + /// + public global::PromptLayer.McpApprovalResponseContent PickMcpApprovalResponse() => IsMcpApprovalResponse + ? McpApprovalResponse! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalResponse' but the value was {ToString()}."); + /// /// Result from bash code execution tool. /// @@ -464,6 +562,13 @@ public bool TryPickBashCodeExecutionToolResult( return IsBashCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.BashCodeExecutionToolResultContent PickBashCodeExecutionToolResult() => IsBashCodeExecutionToolResult + ? BashCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'BashCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Result from text editor code execution tool. /// @@ -494,6 +599,13 @@ public bool TryPickTextEditorCodeExecutionToolResult( return IsTextEditorCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.TextEditorCodeExecutionToolResultContent PickTextEditorCodeExecutionToolResult() => IsTextEditorCodeExecutionToolResult + ? TextEditorCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'TextEditorCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Shell tool call block. /// @@ -524,6 +636,13 @@ public bool TryPickShellCall( return IsShellCall; } + /// + /// + /// + public global::PromptLayer.ShellCallContent PickShellCall() => IsShellCall + ? ShellCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCall' but the value was {ToString()}."); + /// /// Shell tool output block. /// @@ -554,6 +673,13 @@ public bool TryPickShellCallOutput( return IsShellCallOutput; } + /// + /// + /// + public global::PromptLayer.ShellCallOutputContent PickShellCallOutput() => IsShellCallOutput + ? ShellCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCallOutput' but the value was {ToString()}."); + /// /// Apply patch tool call block. /// @@ -584,6 +710,13 @@ public bool TryPickApplyPatchCall( return IsApplyPatchCall; } + /// + /// + /// + public global::PromptLayer.ApplyPatchCallContent PickApplyPatchCall() => IsApplyPatchCall + ? ApplyPatchCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCall' but the value was {ToString()}."); + /// /// Apply patch tool output block. /// @@ -613,6 +746,13 @@ public bool TryPickApplyPatchCallOutput( value = ApplyPatchCallOutput; return IsApplyPatchCallOutput; } + + /// + /// + /// + public global::PromptLayer.ApplyPatchCallOutputContent PickApplyPatchCallOutput() => IsApplyPatchCallOutput + ? ApplyPatchCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCallOutput' but the value was {ToString()}."); /// /// /// @@ -631,6 +771,11 @@ public ContentVariant1Item2(global::PromptLayer.TextContent? value) Text = value; } + /// + /// + /// + public static ContentVariant1Item2 FromText(global::PromptLayer.TextContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -649,6 +794,11 @@ public ContentVariant1Item2(global::PromptLayer.ThinkingContent? value) Thinking = value; } + /// + /// + /// + public static ContentVariant1Item2 FromThinking(global::PromptLayer.ThinkingContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -667,6 +817,11 @@ public ContentVariant1Item2(global::PromptLayer.CodeContent? value) Code = value; } + /// + /// + /// + public static ContentVariant1Item2 FromCode(global::PromptLayer.CodeContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -685,6 +840,11 @@ public ContentVariant1Item2(global::PromptLayer.ImageContent? value) ImageUrl = value; } + /// + /// + /// + public static ContentVariant1Item2 FromImageUrl(global::PromptLayer.ImageContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -703,6 +863,11 @@ public ContentVariant1Item2(global::PromptLayer.MediaContent? value) Media = value; } + /// + /// + /// + public static ContentVariant1Item2 FromMedia(global::PromptLayer.MediaContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -721,6 +886,11 @@ public ContentVariant1Item2(global::PromptLayer.MediaVariable? value) MediaVariable = value; } + /// + /// + /// + public static ContentVariant1Item2 FromMediaVariable(global::PromptLayer.MediaVariable? value) => new ContentVariant1Item2(value); + /// /// /// @@ -739,6 +909,11 @@ public ContentVariant1Item2(global::PromptLayer.OutputMediaContent? value) OutputMedia = value; } + /// + /// + /// + public static ContentVariant1Item2 FromOutputMedia(global::PromptLayer.OutputMediaContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -757,6 +932,11 @@ public ContentVariant1Item2(global::PromptLayer.ServerToolUseContent? value) ServerToolUse = value; } + /// + /// + /// + public static ContentVariant1Item2 FromServerToolUse(global::PromptLayer.ServerToolUseContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -775,6 +955,11 @@ public ContentVariant1Item2(global::PromptLayer.WebSearchToolResultContent? valu WebSearchToolResult = value; } + /// + /// + /// + public static ContentVariant1Item2 FromWebSearchToolResult(global::PromptLayer.WebSearchToolResultContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -793,6 +978,11 @@ public ContentVariant1Item2(global::PromptLayer.CodeExecutionResultContent? valu CodeExecutionResult = value; } + /// + /// + /// + public static ContentVariant1Item2 FromCodeExecutionResult(global::PromptLayer.CodeExecutionResultContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -811,6 +1001,11 @@ public ContentVariant1Item2(global::PromptLayer.McpListToolsContent? value) McpListTools = value; } + /// + /// + /// + public static ContentVariant1Item2 FromMcpListTools(global::PromptLayer.McpListToolsContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -829,6 +1024,11 @@ public ContentVariant1Item2(global::PromptLayer.McpCallContent? value) McpCall = value; } + /// + /// + /// + public static ContentVariant1Item2 FromMcpCall(global::PromptLayer.McpCallContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -847,6 +1047,11 @@ public ContentVariant1Item2(global::PromptLayer.McpApprovalRequestContent? value McpApprovalRequest = value; } + /// + /// + /// + public static ContentVariant1Item2 FromMcpApprovalRequest(global::PromptLayer.McpApprovalRequestContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -865,6 +1070,11 @@ public ContentVariant1Item2(global::PromptLayer.McpApprovalResponseContent? valu McpApprovalResponse = value; } + /// + /// + /// + public static ContentVariant1Item2 FromMcpApprovalResponse(global::PromptLayer.McpApprovalResponseContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -883,6 +1093,11 @@ public ContentVariant1Item2(global::PromptLayer.BashCodeExecutionToolResultConte BashCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentVariant1Item2 FromBashCodeExecutionToolResult(global::PromptLayer.BashCodeExecutionToolResultContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -901,6 +1116,11 @@ public ContentVariant1Item2(global::PromptLayer.TextEditorCodeExecutionToolResul TextEditorCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentVariant1Item2 FromTextEditorCodeExecutionToolResult(global::PromptLayer.TextEditorCodeExecutionToolResultContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -919,6 +1139,11 @@ public ContentVariant1Item2(global::PromptLayer.ShellCallContent? value) ShellCall = value; } + /// + /// + /// + public static ContentVariant1Item2 FromShellCall(global::PromptLayer.ShellCallContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -937,6 +1162,11 @@ public ContentVariant1Item2(global::PromptLayer.ShellCallOutputContent? value) ShellCallOutput = value; } + /// + /// + /// + public static ContentVariant1Item2 FromShellCallOutput(global::PromptLayer.ShellCallOutputContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -955,6 +1185,11 @@ public ContentVariant1Item2(global::PromptLayer.ApplyPatchCallContent? value) ApplyPatchCall = value; } + /// + /// + /// + public static ContentVariant1Item2 FromApplyPatchCall(global::PromptLayer.ApplyPatchCallContent? value) => new ContentVariant1Item2(value); + /// /// /// @@ -973,6 +1208,11 @@ public ContentVariant1Item2(global::PromptLayer.ApplyPatchCallOutputContent? val ApplyPatchCallOutput = value; } + /// + /// + /// + public static ContentVariant1Item2 FromApplyPatchCallOutput(global::PromptLayer.ApplyPatchCallOutputContent? value) => new ContentVariant1Item2(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item3.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item3.g.cs index d141175..9b2f43e 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item3.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.ContentVariant1Item3.g.cs @@ -44,6 +44,13 @@ public bool TryPickText( return IsText; } + /// + /// + /// + public global::PromptLayer.TextContent PickText() => IsText + ? Text! + : throw new global::System.InvalidOperationException($"Expected union variant 'Text' but the value was {ToString()}."); + /// /// /// @@ -74,6 +81,13 @@ public bool TryPickThinking( return IsThinking; } + /// + /// + /// + public global::PromptLayer.ThinkingContent PickThinking() => IsThinking + ? Thinking! + : throw new global::System.InvalidOperationException($"Expected union variant 'Thinking' but the value was {ToString()}."); + /// /// Code content block (e.g. from code execution tools). /// @@ -104,6 +118,13 @@ public bool TryPickCode( return IsCode; } + /// + /// + /// + public global::PromptLayer.CodeContent PickCode() => IsCode + ? Code! + : throw new global::System.InvalidOperationException($"Expected union variant 'Code' but the value was {ToString()}."); + /// /// /// @@ -134,6 +155,13 @@ public bool TryPickImageUrl( return IsImageUrl; } + /// + /// + /// + public global::PromptLayer.ImageContent PickImageUrl() => IsImageUrl + ? ImageUrl! + : throw new global::System.InvalidOperationException($"Expected union variant 'ImageUrl' but the value was {ToString()}."); + /// /// /// @@ -164,6 +192,13 @@ public bool TryPickMedia( return IsMedia; } + /// + /// + /// + public global::PromptLayer.MediaContent PickMedia() => IsMedia + ? Media! + : throw new global::System.InvalidOperationException($"Expected union variant 'Media' but the value was {ToString()}."); + /// /// /// @@ -194,6 +229,13 @@ public bool TryPickMediaVariable( return IsMediaVariable; } + /// + /// + /// + public global::PromptLayer.MediaVariable PickMediaVariable() => IsMediaVariable + ? MediaVariable! + : throw new global::System.InvalidOperationException($"Expected union variant 'MediaVariable' but the value was {ToString()}."); + /// /// LLM-generated media output (e.g. from image generation tools). /// @@ -224,6 +266,13 @@ public bool TryPickOutputMedia( return IsOutputMedia; } + /// + /// + /// + public global::PromptLayer.OutputMediaContent PickOutputMedia() => IsOutputMedia + ? OutputMedia! + : throw new global::System.InvalidOperationException($"Expected union variant 'OutputMedia' but the value was {ToString()}."); + /// /// Server-side tool use block (e.g. web search, code execution). /// @@ -254,6 +303,13 @@ public bool TryPickServerToolUse( return IsServerToolUse; } + /// + /// + /// + public global::PromptLayer.ServerToolUseContent PickServerToolUse() => IsServerToolUse + ? ServerToolUse! + : throw new global::System.InvalidOperationException($"Expected union variant 'ServerToolUse' but the value was {ToString()}."); + /// /// Results from a web search tool invocation. /// @@ -284,6 +340,13 @@ public bool TryPickWebSearchToolResult( return IsWebSearchToolResult; } + /// + /// + /// + public global::PromptLayer.WebSearchToolResultContent PickWebSearchToolResult() => IsWebSearchToolResult + ? WebSearchToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'WebSearchToolResult' but the value was {ToString()}."); + /// /// Result from a code execution tool. /// @@ -314,6 +377,13 @@ public bool TryPickCodeExecutionResult( return IsCodeExecutionResult; } + /// + /// + /// + public global::PromptLayer.CodeExecutionResultContent PickCodeExecutionResult() => IsCodeExecutionResult + ? CodeExecutionResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'CodeExecutionResult' but the value was {ToString()}."); + /// /// MCP list tools response block. /// @@ -344,6 +414,13 @@ public bool TryPickMcpListTools( return IsMcpListTools; } + /// + /// + /// + public global::PromptLayer.McpListToolsContent PickMcpListTools() => IsMcpListTools + ? McpListTools! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpListTools' but the value was {ToString()}."); + /// /// MCP tool call block. /// @@ -374,6 +451,13 @@ public bool TryPickMcpCall( return IsMcpCall; } + /// + /// + /// + public global::PromptLayer.McpCallContent PickMcpCall() => IsMcpCall + ? McpCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpCall' but the value was {ToString()}."); + /// /// MCP tool approval request block. /// @@ -404,6 +488,13 @@ public bool TryPickMcpApprovalRequest( return IsMcpApprovalRequest; } + /// + /// + /// + public global::PromptLayer.McpApprovalRequestContent PickMcpApprovalRequest() => IsMcpApprovalRequest + ? McpApprovalRequest! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalRequest' but the value was {ToString()}."); + /// /// MCP tool approval response block. /// @@ -434,6 +525,13 @@ public bool TryPickMcpApprovalResponse( return IsMcpApprovalResponse; } + /// + /// + /// + public global::PromptLayer.McpApprovalResponseContent PickMcpApprovalResponse() => IsMcpApprovalResponse + ? McpApprovalResponse! + : throw new global::System.InvalidOperationException($"Expected union variant 'McpApprovalResponse' but the value was {ToString()}."); + /// /// Result from bash code execution tool. /// @@ -464,6 +562,13 @@ public bool TryPickBashCodeExecutionToolResult( return IsBashCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.BashCodeExecutionToolResultContent PickBashCodeExecutionToolResult() => IsBashCodeExecutionToolResult + ? BashCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'BashCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Result from text editor code execution tool. /// @@ -494,6 +599,13 @@ public bool TryPickTextEditorCodeExecutionToolResult( return IsTextEditorCodeExecutionToolResult; } + /// + /// + /// + public global::PromptLayer.TextEditorCodeExecutionToolResultContent PickTextEditorCodeExecutionToolResult() => IsTextEditorCodeExecutionToolResult + ? TextEditorCodeExecutionToolResult! + : throw new global::System.InvalidOperationException($"Expected union variant 'TextEditorCodeExecutionToolResult' but the value was {ToString()}."); + /// /// Shell tool call block. /// @@ -524,6 +636,13 @@ public bool TryPickShellCall( return IsShellCall; } + /// + /// + /// + public global::PromptLayer.ShellCallContent PickShellCall() => IsShellCall + ? ShellCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCall' but the value was {ToString()}."); + /// /// Shell tool output block. /// @@ -554,6 +673,13 @@ public bool TryPickShellCallOutput( return IsShellCallOutput; } + /// + /// + /// + public global::PromptLayer.ShellCallOutputContent PickShellCallOutput() => IsShellCallOutput + ? ShellCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ShellCallOutput' but the value was {ToString()}."); + /// /// Apply patch tool call block. /// @@ -584,6 +710,13 @@ public bool TryPickApplyPatchCall( return IsApplyPatchCall; } + /// + /// + /// + public global::PromptLayer.ApplyPatchCallContent PickApplyPatchCall() => IsApplyPatchCall + ? ApplyPatchCall! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCall' but the value was {ToString()}."); + /// /// Apply patch tool output block. /// @@ -613,6 +746,13 @@ public bool TryPickApplyPatchCallOutput( value = ApplyPatchCallOutput; return IsApplyPatchCallOutput; } + + /// + /// + /// + public global::PromptLayer.ApplyPatchCallOutputContent PickApplyPatchCallOutput() => IsApplyPatchCallOutput + ? ApplyPatchCallOutput! + : throw new global::System.InvalidOperationException($"Expected union variant 'ApplyPatchCallOutput' but the value was {ToString()}."); /// /// /// @@ -631,6 +771,11 @@ public ContentVariant1Item3(global::PromptLayer.TextContent? value) Text = value; } + /// + /// + /// + public static ContentVariant1Item3 FromText(global::PromptLayer.TextContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -649,6 +794,11 @@ public ContentVariant1Item3(global::PromptLayer.ThinkingContent? value) Thinking = value; } + /// + /// + /// + public static ContentVariant1Item3 FromThinking(global::PromptLayer.ThinkingContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -667,6 +817,11 @@ public ContentVariant1Item3(global::PromptLayer.CodeContent? value) Code = value; } + /// + /// + /// + public static ContentVariant1Item3 FromCode(global::PromptLayer.CodeContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -685,6 +840,11 @@ public ContentVariant1Item3(global::PromptLayer.ImageContent? value) ImageUrl = value; } + /// + /// + /// + public static ContentVariant1Item3 FromImageUrl(global::PromptLayer.ImageContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -703,6 +863,11 @@ public ContentVariant1Item3(global::PromptLayer.MediaContent? value) Media = value; } + /// + /// + /// + public static ContentVariant1Item3 FromMedia(global::PromptLayer.MediaContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -721,6 +886,11 @@ public ContentVariant1Item3(global::PromptLayer.MediaVariable? value) MediaVariable = value; } + /// + /// + /// + public static ContentVariant1Item3 FromMediaVariable(global::PromptLayer.MediaVariable? value) => new ContentVariant1Item3(value); + /// /// /// @@ -739,6 +909,11 @@ public ContentVariant1Item3(global::PromptLayer.OutputMediaContent? value) OutputMedia = value; } + /// + /// + /// + public static ContentVariant1Item3 FromOutputMedia(global::PromptLayer.OutputMediaContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -757,6 +932,11 @@ public ContentVariant1Item3(global::PromptLayer.ServerToolUseContent? value) ServerToolUse = value; } + /// + /// + /// + public static ContentVariant1Item3 FromServerToolUse(global::PromptLayer.ServerToolUseContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -775,6 +955,11 @@ public ContentVariant1Item3(global::PromptLayer.WebSearchToolResultContent? valu WebSearchToolResult = value; } + /// + /// + /// + public static ContentVariant1Item3 FromWebSearchToolResult(global::PromptLayer.WebSearchToolResultContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -793,6 +978,11 @@ public ContentVariant1Item3(global::PromptLayer.CodeExecutionResultContent? valu CodeExecutionResult = value; } + /// + /// + /// + public static ContentVariant1Item3 FromCodeExecutionResult(global::PromptLayer.CodeExecutionResultContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -811,6 +1001,11 @@ public ContentVariant1Item3(global::PromptLayer.McpListToolsContent? value) McpListTools = value; } + /// + /// + /// + public static ContentVariant1Item3 FromMcpListTools(global::PromptLayer.McpListToolsContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -829,6 +1024,11 @@ public ContentVariant1Item3(global::PromptLayer.McpCallContent? value) McpCall = value; } + /// + /// + /// + public static ContentVariant1Item3 FromMcpCall(global::PromptLayer.McpCallContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -847,6 +1047,11 @@ public ContentVariant1Item3(global::PromptLayer.McpApprovalRequestContent? value McpApprovalRequest = value; } + /// + /// + /// + public static ContentVariant1Item3 FromMcpApprovalRequest(global::PromptLayer.McpApprovalRequestContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -865,6 +1070,11 @@ public ContentVariant1Item3(global::PromptLayer.McpApprovalResponseContent? valu McpApprovalResponse = value; } + /// + /// + /// + public static ContentVariant1Item3 FromMcpApprovalResponse(global::PromptLayer.McpApprovalResponseContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -883,6 +1093,11 @@ public ContentVariant1Item3(global::PromptLayer.BashCodeExecutionToolResultConte BashCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentVariant1Item3 FromBashCodeExecutionToolResult(global::PromptLayer.BashCodeExecutionToolResultContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -901,6 +1116,11 @@ public ContentVariant1Item3(global::PromptLayer.TextEditorCodeExecutionToolResul TextEditorCodeExecutionToolResult = value; } + /// + /// + /// + public static ContentVariant1Item3 FromTextEditorCodeExecutionToolResult(global::PromptLayer.TextEditorCodeExecutionToolResultContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -919,6 +1139,11 @@ public ContentVariant1Item3(global::PromptLayer.ShellCallContent? value) ShellCall = value; } + /// + /// + /// + public static ContentVariant1Item3 FromShellCall(global::PromptLayer.ShellCallContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -937,6 +1162,11 @@ public ContentVariant1Item3(global::PromptLayer.ShellCallOutputContent? value) ShellCallOutput = value; } + /// + /// + /// + public static ContentVariant1Item3 FromShellCallOutput(global::PromptLayer.ShellCallOutputContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -955,6 +1185,11 @@ public ContentVariant1Item3(global::PromptLayer.ApplyPatchCallContent? value) ApplyPatchCall = value; } + /// + /// + /// + public static ContentVariant1Item3 FromApplyPatchCall(global::PromptLayer.ApplyPatchCallContent? value) => new ContentVariant1Item3(value); + /// /// /// @@ -973,6 +1208,11 @@ public ContentVariant1Item3(global::PromptLayer.ApplyPatchCallOutputContent? val ApplyPatchCallOutput = value; } + /// + /// + /// + public static ContentVariant1Item3 FromApplyPatchCallOutput(global::PromptLayer.ApplyPatchCallOutputContent? value) => new ContentVariant1Item3(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.Input.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.Input.g.cs index 53bc3a0..b930e62 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.Input.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.Input.g.cs @@ -44,6 +44,13 @@ public bool TryPickCompletion( return IsCompletion; } + /// + /// + /// + public global::PromptLayer.CompletionPrompt PickCompletion() => IsCompletion + ? Completion! + : throw new global::System.InvalidOperationException($"Expected union variant 'Completion' but the value was {ToString()}."); + /// /// /// @@ -73,6 +80,13 @@ public bool TryPickChat( value = Chat; return IsChat; } + + /// + /// + /// + public global::PromptLayer.ChatPrompt PickChat() => IsChat + ? Chat! + : throw new global::System.InvalidOperationException($"Expected union variant 'Chat' but the value was {ToString()}."); /// /// /// @@ -91,6 +105,11 @@ public Input(global::PromptLayer.CompletionPrompt? value) Completion = value; } + /// + /// + /// + public static Input FromCompletion(global::PromptLayer.CompletionPrompt? value) => new Input(value); + /// /// /// @@ -109,6 +128,11 @@ public Input(global::PromptLayer.ChatPrompt? value) Chat = value; } + /// + /// + /// + public static Input FromChat(global::PromptLayer.ChatPrompt? value) => new Input(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.MessagesItem.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.MessagesItem.g.cs index dc1cd00..6dfbad8 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.MessagesItem.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.MessagesItem.g.cs @@ -44,6 +44,13 @@ public bool TryPickSystem( return IsSystem; } + /// + /// + /// + public global::PromptLayer.SystemMessage PickSystem() => IsSystem + ? System! + : throw new global::System.InvalidOperationException($"Expected union variant 'System' but the value was {ToString()}."); + /// /// /// @@ -74,6 +81,13 @@ public bool TryPickUser( return IsUser; } + /// + /// + /// + public global::PromptLayer.UserMessage PickUser() => IsUser + ? User! + : throw new global::System.InvalidOperationException($"Expected union variant 'User' but the value was {ToString()}."); + /// /// /// @@ -104,6 +118,13 @@ public bool TryPickAssistant( return IsAssistant; } + /// + /// + /// + public global::PromptLayer.AssistantMessage PickAssistant() => IsAssistant + ? Assistant! + : throw new global::System.InvalidOperationException($"Expected union variant 'Assistant' but the value was {ToString()}."); + /// /// /// @@ -134,6 +155,13 @@ public bool TryPickFunction( return IsFunction; } + /// + /// + /// + public global::PromptLayer.FunctionMessage PickFunction() => IsFunction + ? Function! + : throw new global::System.InvalidOperationException($"Expected union variant 'Function' but the value was {ToString()}."); + /// /// /// @@ -164,6 +192,13 @@ public bool TryPickTool( return IsTool; } + /// + /// + /// + public global::PromptLayer.ToolMessage PickTool() => IsTool + ? Tool! + : throw new global::System.InvalidOperationException($"Expected union variant 'Tool' but the value was {ToString()}."); + /// /// /// @@ -194,6 +229,13 @@ public bool TryPickPlaceholder( return IsPlaceholder; } + /// + /// + /// + public global::PromptLayer.PlaceholderMessage PickPlaceholder() => IsPlaceholder + ? Placeholder! + : throw new global::System.InvalidOperationException($"Expected union variant 'Placeholder' but the value was {ToString()}."); + /// /// /// @@ -223,6 +265,13 @@ public bool TryPickDeveloper( value = Developer; return IsDeveloper; } + + /// + /// + /// + public global::PromptLayer.DeveloperMessage PickDeveloper() => IsDeveloper + ? Developer! + : throw new global::System.InvalidOperationException($"Expected union variant 'Developer' but the value was {ToString()}."); /// /// /// @@ -241,6 +290,11 @@ public MessagesItem(global::PromptLayer.SystemMessage? value) System = value; } + /// + /// + /// + public static MessagesItem FromSystem(global::PromptLayer.SystemMessage? value) => new MessagesItem(value); + /// /// /// @@ -259,6 +313,11 @@ public MessagesItem(global::PromptLayer.UserMessage? value) User = value; } + /// + /// + /// + public static MessagesItem FromUser(global::PromptLayer.UserMessage? value) => new MessagesItem(value); + /// /// /// @@ -277,6 +336,11 @@ public MessagesItem(global::PromptLayer.AssistantMessage? value) Assistant = value; } + /// + /// + /// + public static MessagesItem FromAssistant(global::PromptLayer.AssistantMessage? value) => new MessagesItem(value); + /// /// /// @@ -295,6 +359,11 @@ public MessagesItem(global::PromptLayer.FunctionMessage? value) Function = value; } + /// + /// + /// + public static MessagesItem FromFunction(global::PromptLayer.FunctionMessage? value) => new MessagesItem(value); + /// /// /// @@ -313,6 +382,11 @@ public MessagesItem(global::PromptLayer.ToolMessage? value) Tool = value; } + /// + /// + /// + public static MessagesItem FromTool(global::PromptLayer.ToolMessage? value) => new MessagesItem(value); + /// /// /// @@ -331,6 +405,11 @@ public MessagesItem(global::PromptLayer.PlaceholderMessage? value) Placeholder = value; } + /// + /// + /// + public static MessagesItem FromPlaceholder(global::PromptLayer.PlaceholderMessage? value) => new MessagesItem(value); + /// /// /// @@ -349,6 +428,11 @@ public MessagesItem(global::PromptLayer.DeveloperMessage? value) Developer = value; } + /// + /// + /// + public static MessagesItem FromDeveloper(global::PromptLayer.DeveloperMessage? value) => new MessagesItem(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.Output.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.Output.g.cs index d3bf5e6..7a46930 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.Output.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.Output.g.cs @@ -44,6 +44,13 @@ public bool TryPickCompletion( return IsCompletion; } + /// + /// + /// + public global::PromptLayer.CompletionPrompt PickCompletion() => IsCompletion + ? Completion! + : throw new global::System.InvalidOperationException($"Expected union variant 'Completion' but the value was {ToString()}."); + /// /// /// @@ -73,6 +80,13 @@ public bool TryPickChat( value = Chat; return IsChat; } + + /// + /// + /// + public global::PromptLayer.ChatPrompt PickChat() => IsChat + ? Chat! + : throw new global::System.InvalidOperationException($"Expected union variant 'Chat' but the value was {ToString()}."); /// /// /// @@ -91,6 +105,11 @@ public Output(global::PromptLayer.CompletionPrompt? value) Completion = value; } + /// + /// + /// + public static Output FromCompletion(global::PromptLayer.CompletionPrompt? value) => new Output(value); + /// /// /// @@ -109,6 +128,11 @@ public Output(global::PromptLayer.ChatPrompt? value) Chat = value; } + /// + /// + /// + public static Output FromChat(global::PromptLayer.ChatPrompt? value) => new Output(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate.g.cs index 62dc908..7b373c2 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate.g.cs @@ -44,6 +44,13 @@ public bool TryPickCompletion( return IsCompletion; } + /// + /// + /// + public global::PromptLayer.CompletionPrompt PickCompletion() => IsCompletion + ? Completion! + : throw new global::System.InvalidOperationException($"Expected union variant 'Completion' but the value was {ToString()}."); + /// /// /// @@ -73,6 +80,13 @@ public bool TryPickChat( value = Chat; return IsChat; } + + /// + /// + /// + public global::PromptLayer.ChatPrompt PickChat() => IsChat + ? Chat! + : throw new global::System.InvalidOperationException($"Expected union variant 'Chat' but the value was {ToString()}."); /// /// /// @@ -91,6 +105,11 @@ public PromptTemplate(global::PromptLayer.CompletionPrompt? value) Completion = value; } + /// + /// + /// + public static PromptTemplate FromCompletion(global::PromptLayer.CompletionPrompt? value) => new PromptTemplate(value); + /// /// /// @@ -109,6 +128,11 @@ public PromptTemplate(global::PromptLayer.ChatPrompt? value) Chat = value; } + /// + /// + /// + public static PromptTemplate FromChat(global::PromptLayer.ChatPrompt? value) => new PromptTemplate(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate2.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate2.g.cs index d1d28cf..e544647 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate2.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate2.g.cs @@ -44,6 +44,13 @@ public bool TryPickCompletion( return IsCompletion; } + /// + /// + /// + public global::PromptLayer.CompletionPrompt PickCompletion() => IsCompletion + ? Completion! + : throw new global::System.InvalidOperationException($"Expected union variant 'Completion' but the value was {ToString()}."); + /// /// /// @@ -73,6 +80,13 @@ public bool TryPickChat( value = Chat; return IsChat; } + + /// + /// + /// + public global::PromptLayer.ChatPrompt PickChat() => IsChat + ? Chat! + : throw new global::System.InvalidOperationException($"Expected union variant 'Chat' but the value was {ToString()}."); /// /// /// @@ -91,6 +105,11 @@ public PromptTemplate2(global::PromptLayer.CompletionPrompt? value) Completion = value; } + /// + /// + /// + public static PromptTemplate2 FromCompletion(global::PromptLayer.CompletionPrompt? value) => new PromptTemplate2(value); + /// /// /// @@ -109,6 +128,11 @@ public PromptTemplate2(global::PromptLayer.ChatPrompt? value) Chat = value; } + /// + /// + /// + public static PromptTemplate2 FromChat(global::PromptLayer.ChatPrompt? value) => new PromptTemplate2(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate3.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate3.g.cs index 3bc3772..02f42ff 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate3.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate3.g.cs @@ -44,6 +44,13 @@ public bool TryPickCompletion( return IsCompletion; } + /// + /// + /// + public global::PromptLayer.CompletionPrompt PickCompletion() => IsCompletion + ? Completion! + : throw new global::System.InvalidOperationException($"Expected union variant 'Completion' but the value was {ToString()}."); + /// /// /// @@ -73,6 +80,13 @@ public bool TryPickChat( value = Chat; return IsChat; } + + /// + /// + /// + public global::PromptLayer.ChatPrompt PickChat() => IsChat + ? Chat! + : throw new global::System.InvalidOperationException($"Expected union variant 'Chat' but the value was {ToString()}."); /// /// /// @@ -91,6 +105,11 @@ public PromptTemplate3(global::PromptLayer.CompletionPrompt? value) Completion = value; } + /// + /// + /// + public static PromptTemplate3 FromCompletion(global::PromptLayer.CompletionPrompt? value) => new PromptTemplate3(value); + /// /// /// @@ -109,6 +128,11 @@ public PromptTemplate3(global::PromptLayer.ChatPrompt? value) Chat = value; } + /// + /// + /// + public static PromptTemplate3 FromChat(global::PromptLayer.ChatPrompt? value) => new PromptTemplate3(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate4.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate4.g.cs index e446ba9..8555d4b 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate4.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate4.g.cs @@ -44,6 +44,13 @@ public bool TryPickCompletion( return IsCompletion; } + /// + /// + /// + public global::PromptLayer.CompletionPrompt PickCompletion() => IsCompletion + ? Completion! + : throw new global::System.InvalidOperationException($"Expected union variant 'Completion' but the value was {ToString()}."); + /// /// /// @@ -73,6 +80,13 @@ public bool TryPickChat( value = Chat; return IsChat; } + + /// + /// + /// + public global::PromptLayer.ChatPrompt PickChat() => IsChat + ? Chat! + : throw new global::System.InvalidOperationException($"Expected union variant 'Chat' but the value was {ToString()}."); /// /// /// @@ -91,6 +105,11 @@ public PromptTemplate4(global::PromptLayer.CompletionPrompt? value) Completion = value; } + /// + /// + /// + public static PromptTemplate4 FromCompletion(global::PromptLayer.CompletionPrompt? value) => new PromptTemplate4(value); + /// /// /// @@ -109,6 +128,11 @@ public PromptTemplate4(global::PromptLayer.ChatPrompt? value) Chat = value; } + /// + /// + /// + public static PromptTemplate4 FromChat(global::PromptLayer.ChatPrompt? value) => new PromptTemplate4(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate5.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate5.g.cs index 3dda0ca..4e2cf57 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate5.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate5.g.cs @@ -44,6 +44,13 @@ public bool TryPickCompletion( return IsCompletion; } + /// + /// + /// + public global::PromptLayer.CompletionPrompt PickCompletion() => IsCompletion + ? Completion! + : throw new global::System.InvalidOperationException($"Expected union variant 'Completion' but the value was {ToString()}."); + /// /// /// @@ -73,6 +80,13 @@ public bool TryPickChat( value = Chat; return IsChat; } + + /// + /// + /// + public global::PromptLayer.ChatPrompt PickChat() => IsChat + ? Chat! + : throw new global::System.InvalidOperationException($"Expected union variant 'Chat' but the value was {ToString()}."); /// /// /// @@ -91,6 +105,11 @@ public PromptTemplate5(global::PromptLayer.CompletionPrompt? value) Completion = value; } + /// + /// + /// + public static PromptTemplate5 FromCompletion(global::PromptLayer.CompletionPrompt? value) => new PromptTemplate5(value); + /// /// /// @@ -109,6 +128,11 @@ public PromptTemplate5(global::PromptLayer.ChatPrompt? value) Chat = value; } + /// + /// + /// + public static PromptTemplate5 FromChat(global::PromptLayer.ChatPrompt? value) => new PromptTemplate5(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate6.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate6.g.cs index e7ccb81..c87ec06 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate6.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.PromptTemplate6.g.cs @@ -44,6 +44,13 @@ public bool TryPickCompletion( return IsCompletion; } + /// + /// + /// + public global::PromptLayer.CompletionPrompt PickCompletion() => IsCompletion + ? Completion! + : throw new global::System.InvalidOperationException($"Expected union variant 'Completion' but the value was {ToString()}."); + /// /// /// @@ -73,6 +80,13 @@ public bool TryPickChat( value = Chat; return IsChat; } + + /// + /// + /// + public global::PromptLayer.ChatPrompt PickChat() => IsChat + ? Chat! + : throw new global::System.InvalidOperationException($"Expected union variant 'Chat' but the value was {ToString()}."); /// /// /// @@ -91,6 +105,11 @@ public PromptTemplate6(global::PromptLayer.CompletionPrompt? value) Completion = value; } + /// + /// + /// + public static PromptTemplate6 FromCompletion(global::PromptLayer.CompletionPrompt? value) => new PromptTemplate6(value); + /// /// /// @@ -109,6 +128,11 @@ public PromptTemplate6(global::PromptLayer.ChatPrompt? value) Chat = value; } + /// + /// + /// + public static PromptTemplate6 FromChat(global::PromptLayer.ChatPrompt? value) => new PromptTemplate6(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.SearchRequestLogsRequest.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.SearchRequestLogsRequest.g.cs index 9aad713..cb2e840 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.SearchRequestLogsRequest.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.SearchRequestLogsRequest.g.cs @@ -39,6 +39,13 @@ public bool TryPickRequestLogQuery( return IsRequestLogQuery; } + /// + /// + /// + public global::PromptLayer.RequestLogQuery PickRequestLogQuery() => IsRequestLogQuery + ? RequestLogQuery! + : throw new global::System.InvalidOperationException($"Expected union variant 'RequestLogQuery' but the value was {ToString()}."); + /// /// /// @@ -68,6 +75,13 @@ public bool TryPickSearchRequestLogsRequestVariant2( value = SearchRequestLogsRequestVariant2; return IsSearchRequestLogsRequestVariant2; } + + /// + /// + /// + public global::PromptLayer.SearchRequestLogsRequestVariant2 PickSearchRequestLogsRequestVariant2() => IsSearchRequestLogsRequestVariant2 + ? SearchRequestLogsRequestVariant2! + : throw new global::System.InvalidOperationException($"Expected union variant 'SearchRequestLogsRequestVariant2' but the value was {ToString()}."); /// /// /// @@ -86,6 +100,11 @@ public SearchRequestLogsRequest(global::PromptLayer.RequestLogQuery? value) RequestLogQuery = value; } + /// + /// + /// + public static SearchRequestLogsRequest FromRequestLogQuery(global::PromptLayer.RequestLogQuery? value) => new SearchRequestLogsRequest(value); + /// /// /// @@ -104,6 +123,11 @@ public SearchRequestLogsRequest(global::PromptLayer.SearchRequestLogsRequestVari SearchRequestLogsRequestVariant2 = value; } + /// + /// + /// + public static SearchRequestLogsRequest FromSearchRequestLogsRequestVariant2(global::PromptLayer.SearchRequestLogsRequestVariant2? value) => new SearchRequestLogsRequest(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.Tool.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.Tool.g.cs index 8462f2c..2bb092f 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.Models.Tool.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.Tool.g.cs @@ -44,6 +44,13 @@ public bool TryPickFunction( return IsFunction; } + /// + /// + /// + public global::PromptLayer.FunctionTool PickFunction() => IsFunction + ? Function! + : throw new global::System.InvalidOperationException($"Expected union variant 'Function' but the value was {ToString()}."); + /// /// A provider-native built-in tool (e.g. web search, code interpreter, bash). /// @@ -73,6 +80,13 @@ public bool TryPickWebSearch( value = WebSearch; return IsWebSearch; } + + /// + /// + /// + public global::PromptLayer.BuiltInTool PickWebSearch() => IsWebSearch + ? WebSearch! + : throw new global::System.InvalidOperationException($"Expected union variant 'WebSearch' but the value was {ToString()}."); /// /// /// @@ -91,6 +105,11 @@ public Tool(global::PromptLayer.FunctionTool? value) Function = value; } + /// + /// + /// + public static Tool FromFunction(global::PromptLayer.FunctionTool? value) => new Tool(value); + /// /// /// @@ -109,6 +128,11 @@ public Tool(global::PromptLayer.BuiltInTool? value) WebSearch = value; } + /// + /// + /// + public static Tool FromWebSearch(global::PromptLayer.BuiltInTool? value) => new Tool(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.OneOf.2.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.OneOf.2.g.cs index 77e4b50..df74847 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.OneOf.2.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.OneOf.2.g.cs @@ -38,6 +38,13 @@ public bool TryPickValue1( return IsValue1; } + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -67,6 +74,13 @@ public bool TryPickValue2( value = Value2; return IsValue2; } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); /// /// /// @@ -85,6 +99,11 @@ public OneOf(T1? value) Value1 = value; } + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + /// /// /// @@ -103,6 +122,11 @@ public OneOf(T2? value) Value2 = value; } + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.OneOf.4.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.OneOf.4.g.cs index 03725cc..409c774 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.OneOf.4.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.OneOf.4.g.cs @@ -38,6 +38,13 @@ public bool TryPickValue1( return IsValue1; } + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -68,6 +75,13 @@ public bool TryPickValue2( return IsValue2; } + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// /// /// @@ -98,6 +112,13 @@ public bool TryPickValue3( return IsValue3; } + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + /// /// /// @@ -127,6 +148,13 @@ public bool TryPickValue4( value = Value4; return IsValue4; } + + /// + /// + /// + public T4 PickValue4() => IsValue4 + ? Value4! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value4' but the value was {ToString()}."); /// /// /// @@ -145,6 +173,11 @@ public OneOf(T1? value) Value1 = value; } + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + /// /// /// @@ -163,6 +196,11 @@ public OneOf(T2? value) Value2 = value; } + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + /// /// /// @@ -181,6 +219,11 @@ public OneOf(T3? value) Value3 = value; } + /// + /// + /// + public static OneOf FromValue3(T3? value) => new OneOf(value); + /// /// /// @@ -199,6 +242,11 @@ public OneOf(T4? value) Value4 = value; } + /// + /// + /// + public static OneOf FromValue4(T4? value) => new OneOf(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.OneOf.5.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.OneOf.5.g.cs index abc4036..749448c 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.OneOf.5.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.OneOf.5.g.cs @@ -38,6 +38,13 @@ public bool TryPickValue1( return IsValue1; } + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -68,6 +75,13 @@ public bool TryPickValue2( return IsValue2; } + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// /// /// @@ -98,6 +112,13 @@ public bool TryPickValue3( return IsValue3; } + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + /// /// /// @@ -128,6 +149,13 @@ public bool TryPickValue4( return IsValue4; } + /// + /// + /// + public T4 PickValue4() => IsValue4 + ? Value4! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value4' but the value was {ToString()}."); + /// /// /// @@ -157,6 +185,13 @@ public bool TryPickValue5( value = Value5; return IsValue5; } + + /// + /// + /// + public T5 PickValue5() => IsValue5 + ? Value5! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value5' but the value was {ToString()}."); /// /// /// @@ -175,6 +210,11 @@ public OneOf(T1? value) Value1 = value; } + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + /// /// /// @@ -193,6 +233,11 @@ public OneOf(T2? value) Value2 = value; } + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + /// /// /// @@ -211,6 +256,11 @@ public OneOf(T3? value) Value3 = value; } + /// + /// + /// + public static OneOf FromValue3(T3? value) => new OneOf(value); + /// /// /// @@ -229,6 +279,11 @@ public OneOf(T4? value) Value4 = value; } + /// + /// + /// + public static OneOf FromValue4(T4? value) => new OneOf(value); + /// /// /// @@ -247,6 +302,11 @@ public OneOf(T5? value) Value5 = value; } + /// + /// + /// + public static OneOf FromValue5(T5? value) => new OneOf(value); + /// /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.OptionsSupport.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.OptionsSupport.g.cs index 5d831ba..2e91d11 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.OptionsSupport.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.OptionsSupport.g.cs @@ -54,6 +54,172 @@ public sealed class AutoSDKClientOptions Hooks.Add(hook ?? throw new global::System.ArgumentNullException(nameof(hook))); return this; } + + /// + /// Optional per-request authorization provider invoked before each request is sent. + /// Set this when the client is registered as a singleton in DI but each call needs + /// a fresh credential resolved from a provider, secret-store, or session — instead + /// of mutating the shared Authorizations list at construction time. + /// + public global::PromptLayer.IAutoSDKAuthorizationProvider? AuthorizationProvider { get; set; } + + /// + /// Convenience helper that registers + /// using so request-level auth is resolved without + /// touching shared client state. + /// + /// + public global::PromptLayer.AutoSDKClientOptions UseAuthorizationProvider( + global::PromptLayer.IAutoSDKAuthorizationProvider provider) + { + AuthorizationProvider = provider ?? throw new global::System.ArgumentNullException(nameof(provider)); + if (Hooks.Find(static x => x is global::PromptLayer.AutoSDKAuthorizationProviderHook) == null) + { + Hooks.Add(new global::PromptLayer.AutoSDKAuthorizationProviderHook()); + } + + return this; + } + } + + /// + /// A request-level authorization value supplied by . + /// Mirrors the runtime fields the SDK applies for HTTP / OAuth2 / API-key auth without + /// requiring the consumer to construct the generated EndPointAuthorization type. + /// + public readonly struct AutoSDKAuthorizationValue + { + /// + /// Initializes a new . + /// + /// + /// + /// + /// + /// + public AutoSDKAuthorizationValue( + string value, + string scheme = "Bearer", + string? headerName = null, + string location = "Header", + string type = "Http") + { + Value = value ?? string.Empty; + Scheme = string.IsNullOrWhiteSpace(scheme) ? "Bearer" : scheme; + HeaderName = headerName ?? string.Empty; + Location = string.IsNullOrWhiteSpace(location) ? "Header" : location; + Type = string.IsNullOrWhiteSpace(type) ? "Http" : type; + } + + /// The credential value (token, API key, etc.). + public string Value { get; } + + /// The HTTP authorization scheme — typically Bearer, Basic, or Token. + public string Scheme { get; } + + /// The custom header name when is ApiKey; ignored for HTTP/OAuth2 auth. + public string HeaderName { get; } + + /// The credential location — Header, Query, or Cookie. + public string Location { get; } + + /// The auth type — Http, OAuth2, OpenIdConnect, or ApiKey. + public string Type { get; } + + /// Convenience factory for a Bearer token. + public static global::PromptLayer.AutoSDKAuthorizationValue Bearer(string token) => new(value: token, scheme: "Bearer"); + + /// Convenience factory for an API-key header. + public static global::PromptLayer.AutoSDKAuthorizationValue ApiKeyHeader(string name, string value) => + new(value: value, headerName: name, location: "Header", type: "ApiKey"); + } + + /// + /// Resolves request-level authorization values without mutating the shared client + /// authorization list. Implementations should be safe to invoke concurrently — + /// the hook calls them once per outgoing request. + /// + public interface IAutoSDKAuthorizationProvider + { + /// + /// Returns one or more values to apply to + /// the current request, or an empty list / null to leave the request as-is. + /// + /// + global::System.Threading.Tasks.Task?> ResolveAsync( + global::PromptLayer.AutoSDKHookContext context); + } + + /// + /// Built-in that consults + /// before every outgoing + /// request and stamps the resolved values onto the . + /// + public sealed class AutoSDKAuthorizationProviderHook : global::PromptLayer.AutoSDKHook + { + /// + public override async global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::PromptLayer.AutoSDKHookContext context) + { + context = context ?? throw new global::System.ArgumentNullException(nameof(context)); + + if (context.Request == null) + { + return; + } + + var perRequest = context.RequestOptions?.Authorizations; + if (perRequest != null && perRequest.Count > 0) + { + for (var index = 0; index < perRequest.Count; index++) + { + ApplyAuthorization(context.Request, perRequest[index]); + } + + return; + } + + var provider = context.ClientOptions?.AuthorizationProvider; + if (provider == null) + { + return; + } + + var resolved = await provider.ResolveAsync(context).ConfigureAwait(false); + if (resolved == null || resolved.Count == 0) + { + return; + } + + for (var index = 0; index < resolved.Count; index++) + { + ApplyAuthorization(context.Request, resolved[index]); + } + } + + private static void ApplyAuthorization( + global::System.Net.Http.HttpRequestMessage request, + global::PromptLayer.AutoSDKAuthorizationValue authorization) + { + switch (authorization.Type) + { + case "Http": + case "OAuth2": + case "OpenIdConnect": + request.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: authorization.Scheme, + parameter: authorization.Value); + break; + case "ApiKey": + if (string.Equals(authorization.Location, "Header", global::System.StringComparison.OrdinalIgnoreCase) && + !string.IsNullOrEmpty(authorization.HeaderName)) + { + request.Headers.Remove(authorization.HeaderName); + request.Headers.TryAddWithoutValidation(authorization.HeaderName, authorization.Value ?? string.Empty); + } + break; + } + } } /// @@ -87,6 +253,15 @@ public sealed class AutoSDKRequestOptions /// Overrides response buffering for this request when set. /// public bool? ReadResponseAsString { get; set; } + + /// + /// Optional per-request authorization values. When non-empty, the built-in + /// applies these instead of consulting + /// for this request only. + /// Useful for multi-tenant routing or "act-as" admin tooling that needs a different + /// credential per call without mutating shared client state. + /// + public global::System.Collections.Generic.IReadOnlyList? Authorizations { get; set; } } ///