diff --git a/src/libs/Braintrust/Generated/Braintrust.AllOf.2.g.cs b/src/libs/Braintrust/Generated/Braintrust.AllOf.2.g.cs index fb36823..527b80f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AllOf.2.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AllOf.2.g.cs @@ -85,6 +85,11 @@ public AllOf(T1? value) Value1 = value; } + /// + /// + /// + public static AllOf FromValue1(T1? value) => new AllOf(value); + /// /// /// @@ -103,6 +108,11 @@ public AllOf(T2? value) Value2 = value; } + /// + /// + /// + public static AllOf FromValue2(T2? value) => new AllOf(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.AnyOf.2.g.cs b/src/libs/Braintrust/Generated/Braintrust.AnyOf.2.g.cs index 0b14c50..c1b8dba 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AnyOf.2.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AnyOf.2.g.cs @@ -85,6 +85,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -103,6 +108,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.AnyOf.3.g.cs b/src/libs/Braintrust/Generated/Braintrust.AnyOf.3.g.cs index 50895a1..1afcf96 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AnyOf.3.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AnyOf.3.g.cs @@ -115,6 +115,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -133,6 +138,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -151,6 +161,11 @@ public AnyOf(T3? value) Value3 = value; } + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.AnyOf.4.g.cs b/src/libs/Braintrust/Generated/Braintrust.AnyOf.4.g.cs index f4b9c30..c21a662 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AnyOf.4.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AnyOf.4.g.cs @@ -145,6 +145,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -163,6 +168,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -181,6 +191,11 @@ public AnyOf(T3? value) Value3 = value; } + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + /// /// /// @@ -199,6 +214,11 @@ public AnyOf(T4? value) Value4 = value; } + /// + /// + /// + public static AnyOf FromValue4(T4? value) => new AnyOf(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.AISecretType.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.AISecretType.g.cs index 0edc1c9..17d95db 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.AISecretType.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.AISecretType.g.cs @@ -86,6 +86,11 @@ public AISecretType(string? value) AISecretTypeVariant1 = value; } + /// + /// + /// + public static AISecretType FromAISecretTypeVariant1(string? value) => new AISecretType(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionContentPart.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionContentPart.g.cs index e938bf8..0010949 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionContentPart.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionContentPart.g.cs @@ -116,6 +116,11 @@ public ChatCompletionContentPart(global::Braintrust.ChatCompletionContentPartTex Text = value; } + /// + /// + /// + public static ChatCompletionContentPart FromText(global::Braintrust.ChatCompletionContentPartTextWithTitle? value) => new ChatCompletionContentPart(value); + /// /// /// @@ -134,6 +139,11 @@ public ChatCompletionContentPart(global::Braintrust.ChatCompletionContentPartIma ImageUrl = value; } + /// + /// + /// + public static ChatCompletionContentPart FromImageUrl(global::Braintrust.ChatCompletionContentPartImageWithTitle? value) => new ChatCompletionContentPart(value); + /// /// /// @@ -152,6 +162,11 @@ public ChatCompletionContentPart(global::Braintrust.ChatCompletionContentPartFil File = value; } + /// + /// + /// + public static ChatCompletionContentPart FromFile(global::Braintrust.ChatCompletionContentPartFileWithTitle? value) => new ChatCompletionContentPart(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionMessageParam.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionMessageParam.g.cs index 7939a4d..00424a9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionMessageParam.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ChatCompletionMessageParam.g.cs @@ -236,6 +236,11 @@ public ChatCompletionMessageParam(global::Braintrust.ChatCompletionMessageParamS System = value; } + /// + /// + /// + public static ChatCompletionMessageParam FromSystem(global::Braintrust.ChatCompletionMessageParamSystem? value) => new ChatCompletionMessageParam(value); + /// /// /// @@ -254,6 +259,11 @@ public ChatCompletionMessageParam(global::Braintrust.ChatCompletionMessageParamU User = value; } + /// + /// + /// + public static ChatCompletionMessageParam FromUser(global::Braintrust.ChatCompletionMessageParamUser? value) => new ChatCompletionMessageParam(value); + /// /// /// @@ -272,6 +282,11 @@ public ChatCompletionMessageParam(global::Braintrust.ChatCompletionMessageParamA Assistant = value; } + /// + /// + /// + public static ChatCompletionMessageParam FromAssistant(global::Braintrust.ChatCompletionMessageParamAssistant? value) => new ChatCompletionMessageParam(value); + /// /// /// @@ -290,6 +305,11 @@ public ChatCompletionMessageParam(global::Braintrust.ChatCompletionMessageParamT Tool = value; } + /// + /// + /// + public static ChatCompletionMessageParam FromTool(global::Braintrust.ChatCompletionMessageParamTool? value) => new ChatCompletionMessageParam(value); + /// /// /// @@ -308,6 +328,11 @@ public ChatCompletionMessageParam(global::Braintrust.ChatCompletionMessageParamF Function = value; } + /// + /// + /// + public static ChatCompletionMessageParam FromFunction(global::Braintrust.ChatCompletionMessageParamFunction? value) => new ChatCompletionMessageParam(value); + /// /// /// @@ -326,6 +351,11 @@ public ChatCompletionMessageParam(global::Braintrust.ChatCompletionMessageParamD Developer = value; } + /// + /// + /// + public static ChatCompletionMessageParam FromDeveloper(global::Braintrust.ChatCompletionMessageParamDeveloper? value) => new ChatCompletionMessageParam(value); + /// /// /// @@ -344,6 +374,11 @@ public ChatCompletionMessageParam(global::Braintrust.ChatCompletionMessageParamF Fallback = value; } + /// + /// + /// + public static ChatCompletionMessageParam FromFallback(global::Braintrust.ChatCompletionMessageParamFallback? value) => new ChatCompletionMessageParam(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionData.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionData.g.cs index e7ce7aa..0bf7715 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionData.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionData.g.cs @@ -296,6 +296,11 @@ public FunctionData(global::Braintrust.FunctionDataPrompt? value) Prompt = value; } + /// + /// + /// + public static FunctionData FromPrompt(global::Braintrust.FunctionDataPrompt? value) => new FunctionData(value); + /// /// /// @@ -314,6 +319,11 @@ public FunctionData(global::Braintrust.FunctionDataCode? value) Code = value; } + /// + /// + /// + public static FunctionData FromCode(global::Braintrust.FunctionDataCode? value) => new FunctionData(value); + /// /// /// @@ -332,6 +342,11 @@ public FunctionData(global::Braintrust.GraphData? value) Graph = value; } + /// + /// + /// + public static FunctionData FromGraph(global::Braintrust.GraphData? value) => new FunctionData(value); + /// /// /// @@ -350,6 +365,11 @@ public FunctionData(global::Braintrust.FunctionDataRemoteEval? value) RemoteEval = value; } + /// + /// + /// + public static FunctionData FromRemoteEval(global::Braintrust.FunctionDataRemoteEval? value) => new FunctionData(value); + /// /// /// @@ -368,6 +388,11 @@ public FunctionData(global::Braintrust.FunctionDataGlobal? value) Global = value; } + /// + /// + /// + public static FunctionData FromGlobal(global::Braintrust.FunctionDataGlobal? value) => new FunctionData(value); + /// /// /// @@ -386,6 +411,11 @@ public FunctionData(global::Braintrust.FacetData? value) Facet = value; } + /// + /// + /// + public static FunctionData FromFacet(global::Braintrust.FacetData? value) => new FunctionData(value); + /// /// /// @@ -404,6 +434,11 @@ public FunctionData(global::Braintrust.BatchedFacetData? value) BatchedFacet = value; } + /// + /// + /// + public static FunctionData FromBatchedFacet(global::Braintrust.BatchedFacetData? value) => new FunctionData(value); + /// /// /// @@ -422,6 +457,11 @@ public FunctionData(global::Braintrust.FunctionDataParameters? value) Parameters = value; } + /// + /// + /// + public static FunctionData FromParameters(global::Braintrust.FunctionDataParameters? value) => new FunctionData(value); + /// /// /// @@ -440,6 +480,11 @@ public FunctionData(global::Braintrust.AllOf + /// + /// + public static FunctionData FromFunctionDataVariant9(global::Braintrust.AllOf? value) => new FunctionData(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionDataNullish.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionDataNullish.g.cs index c95cd79..22addd3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionDataNullish.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionDataNullish.g.cs @@ -326,6 +326,11 @@ public FunctionDataNullish(global::Braintrust.FunctionDataNullishPrompt? value) Prompt = value; } + /// + /// + /// + public static FunctionDataNullish FromPrompt(global::Braintrust.FunctionDataNullishPrompt? value) => new FunctionDataNullish(value); + /// /// /// @@ -344,6 +349,11 @@ public FunctionDataNullish(global::Braintrust.FunctionDataNullishCode? value) Code = value; } + /// + /// + /// + public static FunctionDataNullish FromCode(global::Braintrust.FunctionDataNullishCode? value) => new FunctionDataNullish(value); + /// /// /// @@ -362,6 +372,11 @@ public FunctionDataNullish(global::Braintrust.GraphData? value) Graph = value; } + /// + /// + /// + public static FunctionDataNullish FromGraph(global::Braintrust.GraphData? value) => new FunctionDataNullish(value); + /// /// /// @@ -380,6 +395,11 @@ public FunctionDataNullish(global::Braintrust.FunctionDataNullishRemoteEval? val RemoteEval = value; } + /// + /// + /// + public static FunctionDataNullish FromRemoteEval(global::Braintrust.FunctionDataNullishRemoteEval? value) => new FunctionDataNullish(value); + /// /// /// @@ -398,6 +418,11 @@ public FunctionDataNullish(global::Braintrust.FunctionDataNullishGlobal? value) Global = value; } + /// + /// + /// + public static FunctionDataNullish FromGlobal(global::Braintrust.FunctionDataNullishGlobal? value) => new FunctionDataNullish(value); + /// /// /// @@ -416,6 +441,11 @@ public FunctionDataNullish(global::Braintrust.FacetData? value) Facet = value; } + /// + /// + /// + public static FunctionDataNullish FromFacet(global::Braintrust.FacetData? value) => new FunctionDataNullish(value); + /// /// /// @@ -434,6 +464,11 @@ public FunctionDataNullish(global::Braintrust.BatchedFacetData? value) BatchedFacet = value; } + /// + /// + /// + public static FunctionDataNullish FromBatchedFacet(global::Braintrust.BatchedFacetData? value) => new FunctionDataNullish(value); + /// /// /// @@ -452,6 +487,11 @@ public FunctionDataNullish(global::Braintrust.FunctionDataNullishParameters? val Parameters = value; } + /// + /// + /// + public static FunctionDataNullish FromParameters(global::Braintrust.FunctionDataNullishParameters? value) => new FunctionDataNullish(value); + /// /// /// @@ -470,6 +510,11 @@ public FunctionDataNullish(global::Braintrust.AllOf + /// + /// + public static FunctionDataNullish FromFunctionDataNullishVariant9(global::Braintrust.AllOf? value) => new FunctionDataNullish(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionId.g.cs index 1a5889b..5f7f13f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.FunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.FunctionId.g.cs @@ -236,6 +236,11 @@ public FunctionId(global::Braintrust.FunctionIdFunctionId1? value) Id1 = value; } + /// + /// + /// + public static FunctionId FromId1(global::Braintrust.FunctionIdFunctionId1? value) => new FunctionId(value); + /// /// /// @@ -254,6 +259,11 @@ public FunctionId(global::Braintrust.FunctionIdProjectSlug? value) ProjectSlug = value; } + /// + /// + /// + public static FunctionId FromProjectSlug(global::Braintrust.FunctionIdProjectSlug? value) => new FunctionId(value); + /// /// /// @@ -272,6 +282,11 @@ public FunctionId(global::Braintrust.FunctionIdGlobalFunction? value) GlobalFunction = value; } + /// + /// + /// + public static FunctionId FromGlobalFunction(global::Braintrust.FunctionIdGlobalFunction? value) => new FunctionId(value); + /// /// /// @@ -290,6 +305,11 @@ public FunctionId(global::Braintrust.FunctionIdPromptSessionId? value) PromptSessionId = value; } + /// + /// + /// + public static FunctionId FromPromptSessionId(global::Braintrust.FunctionIdPromptSessionId? value) => new FunctionId(value); + /// /// /// @@ -308,6 +328,11 @@ public FunctionId(global::Braintrust.FunctionIdInlineCode? value) InlineCode = value; } + /// + /// + /// + public static FunctionId FromInlineCode(global::Braintrust.FunctionIdInlineCode? value) => new FunctionId(value); + /// /// /// @@ -326,6 +351,11 @@ public FunctionId(global::Braintrust.FunctionIdInlineFunction? value) InlineFunction = value; } + /// + /// + /// + public static FunctionId FromInlineFunction(global::Braintrust.FunctionIdInlineFunction? value) => new FunctionId(value); + /// /// /// @@ -344,6 +374,11 @@ public FunctionId(global::Braintrust.FunctionIdInlinePrompt? value) InlinePrompt = value; } + /// + /// + /// + public static FunctionId FromInlinePrompt(global::Braintrust.FunctionIdInlinePrompt? value) => new FunctionId(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.GraphNode.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.GraphNode.g.cs index a6b1586..b4a474b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.GraphNode.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.GraphNode.g.cs @@ -266,6 +266,11 @@ public GraphNode(global::Braintrust.GraphNodeVariant1? value) GraphNodeVariant1 = value; } + /// + /// + /// + public static GraphNode FromGraphNodeVariant1(global::Braintrust.GraphNodeVariant1? value) => new GraphNode(value); + /// /// /// @@ -284,6 +289,11 @@ public GraphNode(global::Braintrust.GraphNodeVariant2? value) GraphNodeVariant2 = value; } + /// + /// + /// + public static GraphNode FromGraphNodeVariant2(global::Braintrust.GraphNodeVariant2? value) => new GraphNode(value); + /// /// /// @@ -302,6 +312,11 @@ public GraphNode(global::Braintrust.GraphNodeVariant3? value) GraphNodeVariant3 = value; } + /// + /// + /// + public static GraphNode FromGraphNodeVariant3(global::Braintrust.GraphNodeVariant3? value) => new GraphNode(value); + /// /// /// @@ -320,6 +335,11 @@ public GraphNode(global::Braintrust.GraphNodeVariant4? value) GraphNodeVariant4 = value; } + /// + /// + /// + public static GraphNode FromGraphNodeVariant4(global::Braintrust.GraphNodeVariant4? value) => new GraphNode(value); + /// /// /// @@ -338,6 +358,11 @@ public GraphNode(global::Braintrust.GraphNodeVariant5? value) GraphNodeVariant5 = value; } + /// + /// + /// + public static GraphNode FromGraphNodeVariant5(global::Braintrust.GraphNodeVariant5? value) => new GraphNode(value); + /// /// /// @@ -356,6 +381,11 @@ public GraphNode(global::Braintrust.GraphNodeVariant6? value) GraphNodeVariant6 = value; } + /// + /// + /// + public static GraphNode FromGraphNodeVariant6(global::Braintrust.GraphNodeVariant6? value) => new GraphNode(value); + /// /// /// @@ -374,6 +404,11 @@ public GraphNode(global::Braintrust.GraphNodeVariant7? value) GraphNodeVariant7 = value; } + /// + /// + /// + public static GraphNode FromGraphNodeVariant7(global::Braintrust.GraphNodeVariant7? value) => new GraphNode(value); + /// /// /// @@ -392,6 +427,11 @@ public GraphNode(global::Braintrust.GraphNodeVariant8? value) GraphNodeVariant8 = value; } + /// + /// + /// + public static GraphNode FromGraphNodeVariant8(global::Braintrust.GraphNodeVariant8? value) => new GraphNode(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.Ids.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.Ids.g.cs index d9fd3a6..1b70cb0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.Ids.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.Ids.g.cs @@ -86,6 +86,11 @@ public Ids(global::System.Guid? value) Guid = value; } + /// + /// + /// + public static Ids FromGuid(global::System.Guid? value) => new Ids(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.InvokeParent.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.InvokeParent.g.cs index 73b3610..54b101a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.InvokeParent.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.InvokeParent.g.cs @@ -86,6 +86,11 @@ public InvokeParent(global::Braintrust.InvokeParentSpanParentStruct? value) SpanParentStruct = value; } + /// + /// + /// + public static InvokeParent FromSpanParentStruct(global::Braintrust.InvokeParentSpanParentStruct? value) => new InvokeParent(value); + /// /// /// @@ -104,6 +109,11 @@ public InvokeParent(string? value) InvokeParentVariant2 = value; } + /// + /// + /// + public static InvokeParent FromInvokeParentVariant2(string? value) => new InvokeParent(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ModelParams.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ModelParams.g.cs index a2fe1fd..f7a1ee2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ModelParams.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ModelParams.g.cs @@ -176,6 +176,11 @@ public ModelParams(global::Braintrust.ModelParamsOpenAIModelParams? value) OpenAIModelParams = value; } + /// + /// + /// + public static ModelParams FromOpenAIModelParams(global::Braintrust.ModelParamsOpenAIModelParams? value) => new ModelParams(value); + /// /// /// @@ -194,6 +199,11 @@ public ModelParams(global::Braintrust.ModelParamsAnthropicModelParams? value) AnthropicModelParams = value; } + /// + /// + /// + public static ModelParams FromAnthropicModelParams(global::Braintrust.ModelParamsAnthropicModelParams? value) => new ModelParams(value); + /// /// /// @@ -212,6 +222,11 @@ public ModelParams(global::Braintrust.ModelParamsGoogleModelParams? value) GoogleModelParams = value; } + /// + /// + /// + public static ModelParams FromGoogleModelParams(global::Braintrust.ModelParamsGoogleModelParams? value) => new ModelParams(value); + /// /// /// @@ -230,6 +245,11 @@ public ModelParams(global::Braintrust.ModelParamsWindowAIModelParams? value) WindowAIModelParams = value; } + /// + /// + /// + public static ModelParams FromWindowAIModelParams(global::Braintrust.ModelParamsWindowAIModelParams? value) => new ModelParams(value); + /// /// /// @@ -248,6 +268,11 @@ public ModelParams(global::Braintrust.ModelParamsJsCompletionParams? value) JsCompletionParams = value; } + /// + /// + /// + public static ModelParams FromJsCompletionParams(global::Braintrust.ModelParamsJsCompletionParams? value) => new ModelParams(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.NullableSavedFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.NullableSavedFunctionId.g.cs index e53f13d..d84f0f2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.NullableSavedFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.NullableSavedFunctionId.g.cs @@ -116,6 +116,11 @@ public NullableSavedFunctionId(global::Braintrust.NullableSavedFunctionIdFunctio Function = value; } + /// + /// + /// + public static NullableSavedFunctionId FromFunction(global::Braintrust.NullableSavedFunctionIdFunction? value) => new NullableSavedFunctionId(value); + /// /// /// @@ -134,6 +139,11 @@ public NullableSavedFunctionId(global::Braintrust.NullableSavedFunctionIdGlobal? Global = value; } + /// + /// + /// + public static NullableSavedFunctionId FromGlobal(global::Braintrust.NullableSavedFunctionIdGlobal? value) => new NullableSavedFunctionId(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ProjectScoreCategories.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ProjectScoreCategories.g.cs index a4ac75b..b96d61b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ProjectScoreCategories.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ProjectScoreCategories.g.cs @@ -146,6 +146,11 @@ public ProjectScoreCategories(global::System.Collections.Generic.Dictionary + /// + /// + public static ProjectScoreCategories FromWeighted(global::System.Collections.Generic.Dictionary? value) => new ProjectScoreCategories(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockData.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockData.g.cs index 6aec776..bf6ac84 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockData.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockData.g.cs @@ -86,6 +86,11 @@ public PromptBlockData(global::Braintrust.PromptBlockDataChat? value) Chat = value; } + /// + /// + /// + public static PromptBlockData FromChat(global::Braintrust.PromptBlockDataChat? value) => new PromptBlockData(value); + /// /// /// @@ -104,6 +109,11 @@ public PromptBlockData(global::Braintrust.PromptBlockDataCompletion? value) Completion = value; } + /// + /// + /// + public static PromptBlockData FromCompletion(global::Braintrust.PromptBlockDataCompletion? value) => new PromptBlockData(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockDataNullish.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockDataNullish.g.cs index 25990e9..8a53941 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockDataNullish.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.PromptBlockDataNullish.g.cs @@ -116,6 +116,11 @@ public PromptBlockDataNullish(global::Braintrust.PromptBlockDataNullishChat? val Chat = value; } + /// + /// + /// + public static PromptBlockDataNullish FromChat(global::Braintrust.PromptBlockDataNullishChat? value) => new PromptBlockDataNullish(value); + /// /// /// @@ -134,6 +139,11 @@ public PromptBlockDataNullish(global::Braintrust.PromptBlockDataNullishCompletio Completion = value; } + /// + /// + /// + public static PromptBlockDataNullish FromCompletion(global::Braintrust.PromptBlockDataNullishCompletion? value) => new PromptBlockDataNullish(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ResponseFormatNullish.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ResponseFormatNullish.g.cs index 9532e09..24ed509 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ResponseFormatNullish.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ResponseFormatNullish.g.cs @@ -146,6 +146,11 @@ public ResponseFormatNullish(global::Braintrust.ResponseFormatNullishJsonObject? JsonObject = value; } + /// + /// + /// + public static ResponseFormatNullish FromJsonObject(global::Braintrust.ResponseFormatNullishJsonObject? value) => new ResponseFormatNullish(value); + /// /// /// @@ -164,6 +169,11 @@ public ResponseFormatNullish(global::Braintrust.ResponseFormatNullishJsonSchema? JsonSchema = value; } + /// + /// + /// + public static ResponseFormatNullish FromJsonSchema(global::Braintrust.ResponseFormatNullishJsonSchema? value) => new ResponseFormatNullish(value); + /// /// /// @@ -182,6 +192,11 @@ public ResponseFormatNullish(global::Braintrust.ResponseFormatNullishText? value Text = value; } + /// + /// + /// + public static ResponseFormatNullish FromText(global::Braintrust.ResponseFormatNullishText? value) => new ResponseFormatNullish(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.SavedFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.SavedFunctionId.g.cs index dba62cc..4481159 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.SavedFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.SavedFunctionId.g.cs @@ -116,6 +116,11 @@ public SavedFunctionId(global::Braintrust.SavedFunctionIdFunction? value) Function = value; } + /// + /// + /// + public static SavedFunctionId FromFunction(global::Braintrust.SavedFunctionIdFunction? value) => new SavedFunctionId(value); + /// /// /// @@ -134,6 +139,11 @@ public SavedFunctionId(global::Braintrust.SavedFunctionIdGlobal? value) Global = value; } + /// + /// + /// + public static SavedFunctionId FromGlobal(global::Braintrust.SavedFunctionIdGlobal? value) => new SavedFunctionId(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.TopicAutomationDataScope.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.TopicAutomationDataScope.g.cs index bab5d55..e818802 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.TopicAutomationDataScope.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.TopicAutomationDataScope.g.cs @@ -146,6 +146,11 @@ public TopicAutomationDataScope(global::Braintrust.TopicAutomationDataScopeVaria TopicAutomationDataScopeVariant1 = value; } + /// + /// + /// + public static TopicAutomationDataScope FromTopicAutomationDataScopeVariant1(global::Braintrust.TopicAutomationDataScopeVariant1? value) => new TopicAutomationDataScope(value); + /// /// /// @@ -164,6 +169,11 @@ public TopicAutomationDataScope(global::Braintrust.TopicAutomationDataScopeVaria TopicAutomationDataScopeVariant2 = value; } + /// + /// + /// + public static TopicAutomationDataScope FromTopicAutomationDataScopeVariant2(global::Braintrust.TopicAutomationDataScopeVariant2? value) => new TopicAutomationDataScope(value); + /// /// /// @@ -182,6 +192,11 @@ public TopicAutomationDataScope(global::Braintrust.TopicAutomationDataScopeVaria TopicAutomationDataScopeVariant3 = value; } + /// + /// + /// + public static TopicAutomationDataScope FromTopicAutomationDataScopeVariant3(global::Braintrust.TopicAutomationDataScopeVariant3? value) => new TopicAutomationDataScope(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.UserEmail.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.UserEmail.g.cs index a8d2ddd..251315f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.UserEmail.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.UserEmail.g.cs @@ -86,6 +86,11 @@ public UserEmail(string? value) UserEmailVariant1 = value; } + /// + /// + /// + public static UserEmail FromUserEmailVariant1(string? value) => new UserEmail(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.UserFamilyName.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.UserFamilyName.g.cs index 23b3583..e6b0971 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.UserFamilyName.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.UserFamilyName.g.cs @@ -86,6 +86,11 @@ public UserFamilyName(string? value) UserFamilyNameVariant1 = value; } + /// + /// + /// + public static UserFamilyName FromUserFamilyNameVariant1(string? value) => new UserFamilyName(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.UserGivenName.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.UserGivenName.g.cs index ec26a29..c6836e3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.UserGivenName.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.UserGivenName.g.cs @@ -86,6 +86,11 @@ public UserGivenName(string? value) UserGivenNameVariant1 = value; } + /// + /// + /// + public static UserGivenName FromUserGivenNameVariant1(string? value) => new UserGivenName(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.Models.ViewOptions.g.cs b/src/libs/Braintrust/Generated/Braintrust.Models.ViewOptions.g.cs index ece6f25..2a3e0e2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Models.ViewOptions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.Models.ViewOptions.g.cs @@ -116,6 +116,11 @@ public ViewOptions(global::Braintrust.ViewOptionsMonitorViewOptions? value) MonitorViewOptions = value; } + /// + /// + /// + public static ViewOptions FromMonitorViewOptions(global::Braintrust.ViewOptionsMonitorViewOptions? value) => new ViewOptions(value); + /// /// /// @@ -134,6 +139,11 @@ public ViewOptions(global::Braintrust.ViewOptionsTableViewOptions? value) TableViewOptions = value; } + /// + /// + /// + public static ViewOptions FromTableViewOptions(global::Braintrust.ViewOptionsTableViewOptions? value) => new ViewOptions(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.OneOf.2.g.cs b/src/libs/Braintrust/Generated/Braintrust.OneOf.2.g.cs index 967b849..aab482b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OneOf.2.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OneOf.2.g.cs @@ -85,6 +85,11 @@ public OneOf(T1? value) Value1 = value; } + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + /// /// /// @@ -103,6 +108,11 @@ public OneOf(T2? value) Value2 = value; } + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.OneOf.3.g.cs b/src/libs/Braintrust/Generated/Braintrust.OneOf.3.g.cs index d9ecc3f..81eaf16 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OneOf.3.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OneOf.3.g.cs @@ -115,6 +115,11 @@ public OneOf(T1? value) Value1 = value; } + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + /// /// /// @@ -133,6 +138,11 @@ public OneOf(T2? value) Value2 = value; } + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + /// /// /// @@ -151,6 +161,11 @@ public OneOf(T3? value) Value3 = value; } + /// + /// + /// + public static OneOf FromValue3(T3? value) => new OneOf(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.OneOf.5.g.cs b/src/libs/Braintrust/Generated/Braintrust.OneOf.5.g.cs index 6ed67d9..e5fd9c5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OneOf.5.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OneOf.5.g.cs @@ -175,6 +175,11 @@ public OneOf(T1? value) Value1 = value; } + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + /// /// /// @@ -193,6 +198,11 @@ public OneOf(T2? value) Value2 = value; } + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + /// /// /// @@ -211,6 +221,11 @@ public OneOf(T3? value) Value3 = value; } + /// + /// + /// + public static OneOf FromValue3(T3? value) => new OneOf(value); + /// /// /// @@ -229,6 +244,11 @@ public OneOf(T4? value) Value4 = value; } + /// + /// + /// + public static OneOf FromValue4(T4? value) => new OneOf(value); + /// /// /// @@ -247,6 +267,11 @@ public OneOf(T5? value) Value5 = value; } + /// + /// + /// + public static OneOf FromValue5(T5? value) => new OneOf(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.OneOf.6.g.cs b/src/libs/Braintrust/Generated/Braintrust.OneOf.6.g.cs index f94abba..9e38f55 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OneOf.6.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OneOf.6.g.cs @@ -205,6 +205,11 @@ public OneOf(T1? value) Value1 = value; } + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + /// /// /// @@ -223,6 +228,11 @@ public OneOf(T2? value) Value2 = value; } + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + /// /// /// @@ -241,6 +251,11 @@ public OneOf(T3? value) Value3 = value; } + /// + /// + /// + public static OneOf FromValue3(T3? value) => new OneOf(value); + /// /// /// @@ -259,6 +274,11 @@ public OneOf(T4? value) Value4 = value; } + /// + /// + /// + public static OneOf FromValue4(T4? value) => new OneOf(value); + /// /// /// @@ -277,6 +297,11 @@ public OneOf(T5? value) Value5 = value; } + /// + /// + /// + public static OneOf FromValue5(T5? value) => new OneOf(value); + /// /// /// @@ -295,6 +320,11 @@ public OneOf(T6? value) Value6 = value; } + /// + /// + /// + public static OneOf FromValue6(T6? value) => new OneOf(value); + /// /// /// diff --git a/src/libs/Braintrust/Generated/Braintrust.OptionsSupport.g.cs b/src/libs/Braintrust/Generated/Braintrust.OptionsSupport.g.cs index 735c83c..1defcbf 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OptionsSupport.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OptionsSupport.g.cs @@ -54,6 +54,156 @@ 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::Braintrust.IAutoSDKAuthorizationProvider? AuthorizationProvider { get; set; } + + /// + /// Convenience helper that registers + /// using so request-level auth is resolved without + /// touching shared client state. + /// + /// + public global::Braintrust.AutoSDKClientOptions UseAuthorizationProvider( + global::Braintrust.IAutoSDKAuthorizationProvider provider) + { + AuthorizationProvider = provider ?? throw new global::System.ArgumentNullException(nameof(provider)); + if (Hooks.Find(static x => x is global::Braintrust.AutoSDKAuthorizationProviderHook) == null) + { + Hooks.Add(new global::Braintrust.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::Braintrust.AutoSDKAuthorizationValue Bearer(string token) => new(value: token, scheme: "Bearer"); + + /// Convenience factory for an API-key header. + public static global::Braintrust.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::Braintrust.AutoSDKHookContext context); + } + + /// + /// Built-in that consults + /// before every outgoing + /// request and stamps the resolved values onto the . + /// + public sealed class AutoSDKAuthorizationProviderHook : global::Braintrust.AutoSDKHook + { + /// + public override async global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::Braintrust.AutoSDKHookContext context) + { + context = context ?? throw new global::System.ArgumentNullException(nameof(context)); + + var provider = context.ClientOptions?.AuthorizationProvider; + if (provider == null || context.Request == 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::Braintrust.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; + } + } } ///