braintrust 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.d.ts CHANGED
@@ -1,18 +1,5 @@
1
1
  import { z } from 'zod/v3';
2
2
 
3
- declare class LazyValue<T> {
4
- private callable;
5
- private resolvedValue;
6
- private value;
7
- constructor(callable: () => Promise<T>);
8
- get(): Promise<T>;
9
- getSync(): {
10
- resolved: boolean;
11
- value: T | undefined;
12
- };
13
- get hasSucceeded(): boolean;
14
- }
15
-
16
3
  /**
17
4
  * Abstract base class for ID generators
18
5
  */
@@ -15464,6 +15451,19 @@ declare class PromptCache {
15464
15451
  set(key: PromptKey, value: Prompt): Promise<void>;
15465
15452
  }
15466
15453
 
15454
+ declare class LazyValue<T> {
15455
+ private callable;
15456
+ private resolvedValue;
15457
+ private value;
15458
+ constructor(callable: () => Promise<T>);
15459
+ get(): Promise<T>;
15460
+ getSync(): {
15461
+ resolved: boolean;
15462
+ value: T | undefined;
15463
+ };
15464
+ get hasSucceeded(): boolean;
15465
+ }
15466
+
15467
15467
  /// <reference lib="dom" />
15468
15468
 
15469
15469
  interface ContextParentSpanIds {
@@ -17597,6 +17597,16 @@ interface WrapAISDKOptions {
17597
17597
  */
17598
17598
  declare function wrapAISDK<T>(aiSDK: T, options?: WrapAISDKOptions): T;
17599
17599
 
17600
+ /**
17601
+ * Wrap an ai-sdk model (created with `.chat()`, `.completion()`, etc.) to add tracing. If Braintrust is
17602
+ * not configured, this is a no-op
17603
+ *
17604
+ * @param model
17605
+ * @deprecated You should use the new `wrapAISDK`.
17606
+ * @returns The wrapped object.
17607
+ */
17608
+ declare function wrapAISDKModel<T extends object>(model: T): T;
17609
+
17600
17610
  interface LanguageModelV2Middleware<TModel = any, TCallOptions = any> {
17601
17611
  wrapGenerate?: (options: {
17602
17612
  doGenerate: () => any;
@@ -17858,6 +17868,10 @@ type NameOrId = {
17858
17868
  id: string;
17859
17869
  };
17860
17870
  type CreateProjectOpts = NameOrId;
17871
+ declare class ProjectBuilder {
17872
+ create(opts: CreateProjectOpts): Project;
17873
+ }
17874
+ declare const projects: ProjectBuilder;
17861
17875
  declare class Project {
17862
17876
  readonly name?: string;
17863
17877
  readonly id?: string;
@@ -17972,7 +17986,7 @@ interface PromptTools {
17972
17986
  interface PromptNoTrace {
17973
17987
  noTrace: boolean;
17974
17988
  }
17975
- declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
17989
+ declare const promptContentsSchema: z.ZodUnion<[z.ZodObject<{
17976
17990
  prompt: z.ZodString;
17977
17991
  }, "strip", z.ZodTypeAny, {
17978
17992
  prompt: string;
@@ -18566,148 +18580,1929 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
18566
18580
  role: "model";
18567
18581
  content?: string | null | undefined;
18568
18582
  })[];
18569
- }>]>, z.ZodObject<{
18570
- model: z.ZodString;
18571
- params: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
18572
- use_cache: z.ZodOptional<z.ZodBoolean>;
18573
- reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
18574
- reasoning_budget: z.ZodOptional<z.ZodNumber>;
18575
- temperature: z.ZodOptional<z.ZodNumber>;
18576
- top_p: z.ZodOptional<z.ZodNumber>;
18577
- max_tokens: z.ZodOptional<z.ZodNumber>;
18578
- max_completion_tokens: z.ZodOptional<z.ZodNumber>;
18579
- frequency_penalty: z.ZodOptional<z.ZodNumber>;
18580
- presence_penalty: z.ZodOptional<z.ZodNumber>;
18581
- response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
18582
- type: z.ZodLiteral<"json_object">;
18583
- }, "strip", z.ZodTypeAny, {
18584
- type: "json_object";
18585
- }, {
18586
- type: "json_object";
18587
- }>, z.ZodObject<{
18588
- type: z.ZodLiteral<"json_schema">;
18589
- json_schema: z.ZodObject<{
18590
- name: z.ZodString;
18591
- description: z.ZodOptional<z.ZodString>;
18592
- schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
18593
- strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
18583
+ }>]>;
18584
+ type PromptContents = z.infer<typeof promptContentsSchema>;
18585
+ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
18586
+ prompt: z.ZodString;
18587
+ }, "strip", z.ZodTypeAny, {
18588
+ prompt: string;
18589
+ }, {
18590
+ prompt: string;
18591
+ }>, z.ZodObject<{
18592
+ messages: z.ZodArray<z.ZodUnion<[z.ZodObject<{
18593
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
18594
+ text: z.ZodDefault<z.ZodString>;
18595
+ type: z.ZodLiteral<"text">;
18596
+ cache_control: z.ZodOptional<z.ZodObject<{
18597
+ type: z.ZodLiteral<"ephemeral">;
18594
18598
  }, "strip", z.ZodTypeAny, {
18595
- name: string;
18596
- description?: string | undefined;
18597
- schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
18598
- strict?: boolean | null | undefined;
18599
+ type: "ephemeral";
18599
18600
  }, {
18600
- name: string;
18601
- description?: string | undefined;
18602
- schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
18603
- strict?: boolean | null | undefined;
18604
- }>;
18601
+ type: "ephemeral";
18602
+ }>>;
18605
18603
  }, "strip", z.ZodTypeAny, {
18606
- type: "json_schema";
18607
- json_schema: {
18608
- name: string;
18609
- description?: string | undefined;
18610
- schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
18611
- strict?: boolean | null | undefined;
18612
- };
18604
+ type: "text";
18605
+ text: string;
18606
+ cache_control?: {
18607
+ type: "ephemeral";
18608
+ } | undefined;
18613
18609
  }, {
18614
- type: "json_schema";
18615
- json_schema: {
18616
- name: string;
18617
- description?: string | undefined;
18618
- schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
18619
- strict?: boolean | null | undefined;
18620
- };
18621
- }>, z.ZodObject<{
18610
+ type: "text";
18611
+ text?: string | undefined;
18612
+ cache_control?: {
18613
+ type: "ephemeral";
18614
+ } | undefined;
18615
+ }>, "many">]>;
18616
+ role: z.ZodLiteral<"system">;
18617
+ name: z.ZodOptional<z.ZodString>;
18618
+ }, "strip", z.ZodTypeAny, {
18619
+ role: "system";
18620
+ content: string | {
18621
+ type: "text";
18622
+ text: string;
18623
+ cache_control?: {
18624
+ type: "ephemeral";
18625
+ } | undefined;
18626
+ }[];
18627
+ name?: string | undefined;
18628
+ }, {
18629
+ role: "system";
18630
+ content: string | {
18631
+ type: "text";
18632
+ text?: string | undefined;
18633
+ cache_control?: {
18634
+ type: "ephemeral";
18635
+ } | undefined;
18636
+ }[];
18637
+ name?: string | undefined;
18638
+ }>, z.ZodObject<{
18639
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
18640
+ text: z.ZodDefault<z.ZodString>;
18622
18641
  type: z.ZodLiteral<"text">;
18642
+ cache_control: z.ZodOptional<z.ZodObject<{
18643
+ type: z.ZodLiteral<"ephemeral">;
18644
+ }, "strip", z.ZodTypeAny, {
18645
+ type: "ephemeral";
18646
+ }, {
18647
+ type: "ephemeral";
18648
+ }>>;
18623
18649
  }, "strip", z.ZodTypeAny, {
18624
18650
  type: "text";
18651
+ text: string;
18652
+ cache_control?: {
18653
+ type: "ephemeral";
18654
+ } | undefined;
18625
18655
  }, {
18626
18656
  type: "text";
18627
- }>, z.ZodNull]>>;
18628
- tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
18629
- type: z.ZodLiteral<"function">;
18630
- function: z.ZodObject<{
18631
- name: z.ZodString;
18657
+ text?: string | undefined;
18658
+ cache_control?: {
18659
+ type: "ephemeral";
18660
+ } | undefined;
18661
+ }>, z.ZodObject<{
18662
+ image_url: z.ZodObject<{
18663
+ url: z.ZodString;
18664
+ detail: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"low">, z.ZodLiteral<"high">]>>;
18632
18665
  }, "strip", z.ZodTypeAny, {
18633
- name: string;
18666
+ url: string;
18667
+ detail?: "auto" | "low" | "high" | undefined;
18634
18668
  }, {
18635
- name: string;
18669
+ url: string;
18670
+ detail?: "auto" | "low" | "high" | undefined;
18636
18671
  }>;
18672
+ type: z.ZodLiteral<"image_url">;
18637
18673
  }, "strip", z.ZodTypeAny, {
18638
- function: {
18639
- name: string;
18674
+ type: "image_url";
18675
+ image_url: {
18676
+ url: string;
18677
+ detail?: "auto" | "low" | "high" | undefined;
18640
18678
  };
18641
- type: "function";
18642
18679
  }, {
18643
- function: {
18644
- name: string;
18680
+ type: "image_url";
18681
+ image_url: {
18682
+ url: string;
18683
+ detail?: "auto" | "low" | "high" | undefined;
18645
18684
  };
18646
- type: "function";
18647
- }>]>>;
18648
- function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
18649
- name: z.ZodString;
18650
- }, "strip", z.ZodTypeAny, {
18651
- name: string;
18652
- }, {
18653
- name: string;
18654
- }>]>>;
18655
- n: z.ZodOptional<z.ZodNumber>;
18656
- stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
18657
- reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
18658
- verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
18659
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
18660
- use_cache: z.ZodOptional<z.ZodBoolean>;
18661
- reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
18662
- reasoning_budget: z.ZodOptional<z.ZodNumber>;
18663
- temperature: z.ZodOptional<z.ZodNumber>;
18664
- top_p: z.ZodOptional<z.ZodNumber>;
18665
- max_tokens: z.ZodOptional<z.ZodNumber>;
18666
- max_completion_tokens: z.ZodOptional<z.ZodNumber>;
18667
- frequency_penalty: z.ZodOptional<z.ZodNumber>;
18668
- presence_penalty: z.ZodOptional<z.ZodNumber>;
18669
- response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
18670
- type: z.ZodLiteral<"json_object">;
18671
- }, "strip", z.ZodTypeAny, {
18672
- type: "json_object";
18673
- }, {
18674
- type: "json_object";
18675
18685
  }>, z.ZodObject<{
18676
- type: z.ZodLiteral<"json_schema">;
18677
- json_schema: z.ZodObject<{
18678
- name: z.ZodString;
18679
- description: z.ZodOptional<z.ZodString>;
18680
- schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
18681
- strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
18686
+ file: z.ZodObject<{
18687
+ file_data: z.ZodOptional<z.ZodString>;
18688
+ filename: z.ZodOptional<z.ZodString>;
18689
+ file_id: z.ZodOptional<z.ZodString>;
18682
18690
  }, "strip", z.ZodTypeAny, {
18683
- name: string;
18684
- description?: string | undefined;
18685
- schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
18686
- strict?: boolean | null | undefined;
18691
+ filename?: string | undefined;
18692
+ file_data?: string | undefined;
18693
+ file_id?: string | undefined;
18687
18694
  }, {
18688
- name: string;
18689
- description?: string | undefined;
18690
- schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
18691
- strict?: boolean | null | undefined;
18695
+ filename?: string | undefined;
18696
+ file_data?: string | undefined;
18697
+ file_id?: string | undefined;
18692
18698
  }>;
18699
+ type: z.ZodLiteral<"file">;
18693
18700
  }, "strip", z.ZodTypeAny, {
18694
- type: "json_schema";
18695
- json_schema: {
18696
- name: string;
18697
- description?: string | undefined;
18698
- schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
18699
- strict?: boolean | null | undefined;
18701
+ type: "file";
18702
+ file: {
18703
+ filename?: string | undefined;
18704
+ file_data?: string | undefined;
18705
+ file_id?: string | undefined;
18700
18706
  };
18701
18707
  }, {
18702
- type: "json_schema";
18703
- json_schema: {
18704
- name: string;
18705
- description?: string | undefined;
18706
- schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
18707
- strict?: boolean | null | undefined;
18708
+ type: "file";
18709
+ file: {
18710
+ filename?: string | undefined;
18711
+ file_data?: string | undefined;
18712
+ file_id?: string | undefined;
18708
18713
  };
18709
- }>, z.ZodObject<{
18710
- type: z.ZodLiteral<"text">;
18714
+ }>]>, "many">]>;
18715
+ role: z.ZodLiteral<"user">;
18716
+ name: z.ZodOptional<z.ZodString>;
18717
+ }, "strip", z.ZodTypeAny, {
18718
+ role: "user";
18719
+ content: string | ({
18720
+ type: "text";
18721
+ text: string;
18722
+ cache_control?: {
18723
+ type: "ephemeral";
18724
+ } | undefined;
18725
+ } | {
18726
+ type: "image_url";
18727
+ image_url: {
18728
+ url: string;
18729
+ detail?: "auto" | "low" | "high" | undefined;
18730
+ };
18731
+ } | {
18732
+ type: "file";
18733
+ file: {
18734
+ filename?: string | undefined;
18735
+ file_data?: string | undefined;
18736
+ file_id?: string | undefined;
18737
+ };
18738
+ })[];
18739
+ name?: string | undefined;
18740
+ }, {
18741
+ role: "user";
18742
+ content: string | ({
18743
+ type: "text";
18744
+ text?: string | undefined;
18745
+ cache_control?: {
18746
+ type: "ephemeral";
18747
+ } | undefined;
18748
+ } | {
18749
+ type: "image_url";
18750
+ image_url: {
18751
+ url: string;
18752
+ detail?: "auto" | "low" | "high" | undefined;
18753
+ };
18754
+ } | {
18755
+ type: "file";
18756
+ file: {
18757
+ filename?: string | undefined;
18758
+ file_data?: string | undefined;
18759
+ file_id?: string | undefined;
18760
+ };
18761
+ })[];
18762
+ name?: string | undefined;
18763
+ }>, z.ZodObject<{
18764
+ role: z.ZodLiteral<"assistant">;
18765
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
18766
+ text: z.ZodDefault<z.ZodString>;
18767
+ type: z.ZodLiteral<"text">;
18768
+ cache_control: z.ZodOptional<z.ZodObject<{
18769
+ type: z.ZodLiteral<"ephemeral">;
18770
+ }, "strip", z.ZodTypeAny, {
18771
+ type: "ephemeral";
18772
+ }, {
18773
+ type: "ephemeral";
18774
+ }>>;
18775
+ }, "strip", z.ZodTypeAny, {
18776
+ type: "text";
18777
+ text: string;
18778
+ cache_control?: {
18779
+ type: "ephemeral";
18780
+ } | undefined;
18781
+ }, {
18782
+ type: "text";
18783
+ text?: string | undefined;
18784
+ cache_control?: {
18785
+ type: "ephemeral";
18786
+ } | undefined;
18787
+ }>, "many">, z.ZodNull]>>;
18788
+ function_call: z.ZodOptional<z.ZodObject<{
18789
+ arguments: z.ZodString;
18790
+ name: z.ZodString;
18791
+ }, "strip", z.ZodTypeAny, {
18792
+ name: string;
18793
+ arguments: string;
18794
+ }, {
18795
+ name: string;
18796
+ arguments: string;
18797
+ }>>;
18798
+ name: z.ZodOptional<z.ZodString>;
18799
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
18800
+ id: z.ZodString;
18801
+ function: z.ZodObject<{
18802
+ arguments: z.ZodString;
18803
+ name: z.ZodString;
18804
+ }, "strip", z.ZodTypeAny, {
18805
+ name: string;
18806
+ arguments: string;
18807
+ }, {
18808
+ name: string;
18809
+ arguments: string;
18810
+ }>;
18811
+ type: z.ZodLiteral<"function">;
18812
+ }, "strip", z.ZodTypeAny, {
18813
+ function: {
18814
+ name: string;
18815
+ arguments: string;
18816
+ };
18817
+ type: "function";
18818
+ id: string;
18819
+ }, {
18820
+ function: {
18821
+ name: string;
18822
+ arguments: string;
18823
+ };
18824
+ type: "function";
18825
+ id: string;
18826
+ }>, "many">>;
18827
+ reasoning: z.ZodOptional<z.ZodArray<z.ZodObject<{
18828
+ id: z.ZodOptional<z.ZodString>;
18829
+ content: z.ZodOptional<z.ZodString>;
18830
+ }, "strip", z.ZodTypeAny, {
18831
+ id?: string | undefined;
18832
+ content?: string | undefined;
18833
+ }, {
18834
+ id?: string | undefined;
18835
+ content?: string | undefined;
18836
+ }>, "many">>;
18837
+ }, "strip", z.ZodTypeAny, {
18838
+ role: "assistant";
18839
+ name?: string | undefined;
18840
+ function_call?: {
18841
+ name: string;
18842
+ arguments: string;
18843
+ } | undefined;
18844
+ content?: string | {
18845
+ type: "text";
18846
+ text: string;
18847
+ cache_control?: {
18848
+ type: "ephemeral";
18849
+ } | undefined;
18850
+ }[] | null | undefined;
18851
+ tool_calls?: {
18852
+ function: {
18853
+ name: string;
18854
+ arguments: string;
18855
+ };
18856
+ type: "function";
18857
+ id: string;
18858
+ }[] | undefined;
18859
+ reasoning?: {
18860
+ id?: string | undefined;
18861
+ content?: string | undefined;
18862
+ }[] | undefined;
18863
+ }, {
18864
+ role: "assistant";
18865
+ name?: string | undefined;
18866
+ function_call?: {
18867
+ name: string;
18868
+ arguments: string;
18869
+ } | undefined;
18870
+ content?: string | {
18871
+ type: "text";
18872
+ text?: string | undefined;
18873
+ cache_control?: {
18874
+ type: "ephemeral";
18875
+ } | undefined;
18876
+ }[] | null | undefined;
18877
+ tool_calls?: {
18878
+ function: {
18879
+ name: string;
18880
+ arguments: string;
18881
+ };
18882
+ type: "function";
18883
+ id: string;
18884
+ }[] | undefined;
18885
+ reasoning?: {
18886
+ id?: string | undefined;
18887
+ content?: string | undefined;
18888
+ }[] | undefined;
18889
+ }>, z.ZodObject<{
18890
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
18891
+ text: z.ZodDefault<z.ZodString>;
18892
+ type: z.ZodLiteral<"text">;
18893
+ cache_control: z.ZodOptional<z.ZodObject<{
18894
+ type: z.ZodLiteral<"ephemeral">;
18895
+ }, "strip", z.ZodTypeAny, {
18896
+ type: "ephemeral";
18897
+ }, {
18898
+ type: "ephemeral";
18899
+ }>>;
18900
+ }, "strip", z.ZodTypeAny, {
18901
+ type: "text";
18902
+ text: string;
18903
+ cache_control?: {
18904
+ type: "ephemeral";
18905
+ } | undefined;
18906
+ }, {
18907
+ type: "text";
18908
+ text?: string | undefined;
18909
+ cache_control?: {
18910
+ type: "ephemeral";
18911
+ } | undefined;
18912
+ }>, "many">]>;
18913
+ role: z.ZodLiteral<"tool">;
18914
+ tool_call_id: z.ZodDefault<z.ZodString>;
18915
+ }, "strip", z.ZodTypeAny, {
18916
+ role: "tool";
18917
+ content: string | {
18918
+ type: "text";
18919
+ text: string;
18920
+ cache_control?: {
18921
+ type: "ephemeral";
18922
+ } | undefined;
18923
+ }[];
18924
+ tool_call_id: string;
18925
+ }, {
18926
+ role: "tool";
18927
+ content: string | {
18928
+ type: "text";
18929
+ text?: string | undefined;
18930
+ cache_control?: {
18931
+ type: "ephemeral";
18932
+ } | undefined;
18933
+ }[];
18934
+ tool_call_id?: string | undefined;
18935
+ }>, z.ZodObject<{
18936
+ content: z.ZodUnion<[z.ZodString, z.ZodNull]>;
18937
+ name: z.ZodString;
18938
+ role: z.ZodLiteral<"function">;
18939
+ }, "strip", z.ZodTypeAny, {
18940
+ role: "function";
18941
+ name: string;
18942
+ content: string | null;
18943
+ }, {
18944
+ role: "function";
18945
+ name: string;
18946
+ content: string | null;
18947
+ }>, z.ZodObject<{
18948
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
18949
+ text: z.ZodDefault<z.ZodString>;
18950
+ type: z.ZodLiteral<"text">;
18951
+ cache_control: z.ZodOptional<z.ZodObject<{
18952
+ type: z.ZodLiteral<"ephemeral">;
18953
+ }, "strip", z.ZodTypeAny, {
18954
+ type: "ephemeral";
18955
+ }, {
18956
+ type: "ephemeral";
18957
+ }>>;
18958
+ }, "strip", z.ZodTypeAny, {
18959
+ type: "text";
18960
+ text: string;
18961
+ cache_control?: {
18962
+ type: "ephemeral";
18963
+ } | undefined;
18964
+ }, {
18965
+ type: "text";
18966
+ text?: string | undefined;
18967
+ cache_control?: {
18968
+ type: "ephemeral";
18969
+ } | undefined;
18970
+ }>, "many">]>;
18971
+ role: z.ZodLiteral<"developer">;
18972
+ name: z.ZodOptional<z.ZodString>;
18973
+ }, "strip", z.ZodTypeAny, {
18974
+ role: "developer";
18975
+ content: string | {
18976
+ type: "text";
18977
+ text: string;
18978
+ cache_control?: {
18979
+ type: "ephemeral";
18980
+ } | undefined;
18981
+ }[];
18982
+ name?: string | undefined;
18983
+ }, {
18984
+ role: "developer";
18985
+ content: string | {
18986
+ type: "text";
18987
+ text?: string | undefined;
18988
+ cache_control?: {
18989
+ type: "ephemeral";
18990
+ } | undefined;
18991
+ }[];
18992
+ name?: string | undefined;
18993
+ }>, z.ZodObject<{
18994
+ role: z.ZodLiteral<"model">;
18995
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
18996
+ }, "strip", z.ZodTypeAny, {
18997
+ role: "model";
18998
+ content?: string | null | undefined;
18999
+ }, {
19000
+ role: "model";
19001
+ content?: string | null | undefined;
19002
+ }>]>, "many">;
19003
+ }, "strip", z.ZodTypeAny, {
19004
+ messages: ({
19005
+ role: "system";
19006
+ content: string | {
19007
+ type: "text";
19008
+ text: string;
19009
+ cache_control?: {
19010
+ type: "ephemeral";
19011
+ } | undefined;
19012
+ }[];
19013
+ name?: string | undefined;
19014
+ } | {
19015
+ role: "user";
19016
+ content: string | ({
19017
+ type: "text";
19018
+ text: string;
19019
+ cache_control?: {
19020
+ type: "ephemeral";
19021
+ } | undefined;
19022
+ } | {
19023
+ type: "image_url";
19024
+ image_url: {
19025
+ url: string;
19026
+ detail?: "auto" | "low" | "high" | undefined;
19027
+ };
19028
+ } | {
19029
+ type: "file";
19030
+ file: {
19031
+ filename?: string | undefined;
19032
+ file_data?: string | undefined;
19033
+ file_id?: string | undefined;
19034
+ };
19035
+ })[];
19036
+ name?: string | undefined;
19037
+ } | {
19038
+ role: "assistant";
19039
+ name?: string | undefined;
19040
+ function_call?: {
19041
+ name: string;
19042
+ arguments: string;
19043
+ } | undefined;
19044
+ content?: string | {
19045
+ type: "text";
19046
+ text: string;
19047
+ cache_control?: {
19048
+ type: "ephemeral";
19049
+ } | undefined;
19050
+ }[] | null | undefined;
19051
+ tool_calls?: {
19052
+ function: {
19053
+ name: string;
19054
+ arguments: string;
19055
+ };
19056
+ type: "function";
19057
+ id: string;
19058
+ }[] | undefined;
19059
+ reasoning?: {
19060
+ id?: string | undefined;
19061
+ content?: string | undefined;
19062
+ }[] | undefined;
19063
+ } | {
19064
+ role: "tool";
19065
+ content: string | {
19066
+ type: "text";
19067
+ text: string;
19068
+ cache_control?: {
19069
+ type: "ephemeral";
19070
+ } | undefined;
19071
+ }[];
19072
+ tool_call_id: string;
19073
+ } | {
19074
+ role: "function";
19075
+ name: string;
19076
+ content: string | null;
19077
+ } | {
19078
+ role: "developer";
19079
+ content: string | {
19080
+ type: "text";
19081
+ text: string;
19082
+ cache_control?: {
19083
+ type: "ephemeral";
19084
+ } | undefined;
19085
+ }[];
19086
+ name?: string | undefined;
19087
+ } | {
19088
+ role: "model";
19089
+ content?: string | null | undefined;
19090
+ })[];
19091
+ }, {
19092
+ messages: ({
19093
+ role: "system";
19094
+ content: string | {
19095
+ type: "text";
19096
+ text?: string | undefined;
19097
+ cache_control?: {
19098
+ type: "ephemeral";
19099
+ } | undefined;
19100
+ }[];
19101
+ name?: string | undefined;
19102
+ } | {
19103
+ role: "user";
19104
+ content: string | ({
19105
+ type: "text";
19106
+ text?: string | undefined;
19107
+ cache_control?: {
19108
+ type: "ephemeral";
19109
+ } | undefined;
19110
+ } | {
19111
+ type: "image_url";
19112
+ image_url: {
19113
+ url: string;
19114
+ detail?: "auto" | "low" | "high" | undefined;
19115
+ };
19116
+ } | {
19117
+ type: "file";
19118
+ file: {
19119
+ filename?: string | undefined;
19120
+ file_data?: string | undefined;
19121
+ file_id?: string | undefined;
19122
+ };
19123
+ })[];
19124
+ name?: string | undefined;
19125
+ } | {
19126
+ role: "assistant";
19127
+ name?: string | undefined;
19128
+ function_call?: {
19129
+ name: string;
19130
+ arguments: string;
19131
+ } | undefined;
19132
+ content?: string | {
19133
+ type: "text";
19134
+ text?: string | undefined;
19135
+ cache_control?: {
19136
+ type: "ephemeral";
19137
+ } | undefined;
19138
+ }[] | null | undefined;
19139
+ tool_calls?: {
19140
+ function: {
19141
+ name: string;
19142
+ arguments: string;
19143
+ };
19144
+ type: "function";
19145
+ id: string;
19146
+ }[] | undefined;
19147
+ reasoning?: {
19148
+ id?: string | undefined;
19149
+ content?: string | undefined;
19150
+ }[] | undefined;
19151
+ } | {
19152
+ role: "tool";
19153
+ content: string | {
19154
+ type: "text";
19155
+ text?: string | undefined;
19156
+ cache_control?: {
19157
+ type: "ephemeral";
19158
+ } | undefined;
19159
+ }[];
19160
+ tool_call_id?: string | undefined;
19161
+ } | {
19162
+ role: "function";
19163
+ name: string;
19164
+ content: string | null;
19165
+ } | {
19166
+ role: "developer";
19167
+ content: string | {
19168
+ type: "text";
19169
+ text?: string | undefined;
19170
+ cache_control?: {
19171
+ type: "ephemeral";
19172
+ } | undefined;
19173
+ }[];
19174
+ name?: string | undefined;
19175
+ } | {
19176
+ role: "model";
19177
+ content?: string | null | undefined;
19178
+ })[];
19179
+ }>]>, z.ZodObject<{
19180
+ model: z.ZodString;
19181
+ params: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
19182
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19183
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19184
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19185
+ temperature: z.ZodOptional<z.ZodNumber>;
19186
+ top_p: z.ZodOptional<z.ZodNumber>;
19187
+ max_tokens: z.ZodOptional<z.ZodNumber>;
19188
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
19189
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
19190
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
19191
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
19192
+ type: z.ZodLiteral<"json_object">;
19193
+ }, "strip", z.ZodTypeAny, {
19194
+ type: "json_object";
19195
+ }, {
19196
+ type: "json_object";
19197
+ }>, z.ZodObject<{
19198
+ type: z.ZodLiteral<"json_schema">;
19199
+ json_schema: z.ZodObject<{
19200
+ name: z.ZodString;
19201
+ description: z.ZodOptional<z.ZodString>;
19202
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
19203
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
19204
+ }, "strip", z.ZodTypeAny, {
19205
+ name: string;
19206
+ description?: string | undefined;
19207
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19208
+ strict?: boolean | null | undefined;
19209
+ }, {
19210
+ name: string;
19211
+ description?: string | undefined;
19212
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19213
+ strict?: boolean | null | undefined;
19214
+ }>;
19215
+ }, "strip", z.ZodTypeAny, {
19216
+ type: "json_schema";
19217
+ json_schema: {
19218
+ name: string;
19219
+ description?: string | undefined;
19220
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19221
+ strict?: boolean | null | undefined;
19222
+ };
19223
+ }, {
19224
+ type: "json_schema";
19225
+ json_schema: {
19226
+ name: string;
19227
+ description?: string | undefined;
19228
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19229
+ strict?: boolean | null | undefined;
19230
+ };
19231
+ }>, z.ZodObject<{
19232
+ type: z.ZodLiteral<"text">;
19233
+ }, "strip", z.ZodTypeAny, {
19234
+ type: "text";
19235
+ }, {
19236
+ type: "text";
19237
+ }>, z.ZodNull]>>;
19238
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
19239
+ type: z.ZodLiteral<"function">;
19240
+ function: z.ZodObject<{
19241
+ name: z.ZodString;
19242
+ }, "strip", z.ZodTypeAny, {
19243
+ name: string;
19244
+ }, {
19245
+ name: string;
19246
+ }>;
19247
+ }, "strip", z.ZodTypeAny, {
19248
+ function: {
19249
+ name: string;
19250
+ };
19251
+ type: "function";
19252
+ }, {
19253
+ function: {
19254
+ name: string;
19255
+ };
19256
+ type: "function";
19257
+ }>]>>;
19258
+ function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
19259
+ name: z.ZodString;
19260
+ }, "strip", z.ZodTypeAny, {
19261
+ name: string;
19262
+ }, {
19263
+ name: string;
19264
+ }>]>>;
19265
+ n: z.ZodOptional<z.ZodNumber>;
19266
+ stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19267
+ reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
19268
+ verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
19269
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
19270
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19271
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19272
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19273
+ temperature: z.ZodOptional<z.ZodNumber>;
19274
+ top_p: z.ZodOptional<z.ZodNumber>;
19275
+ max_tokens: z.ZodOptional<z.ZodNumber>;
19276
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
19277
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
19278
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
19279
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
19280
+ type: z.ZodLiteral<"json_object">;
19281
+ }, "strip", z.ZodTypeAny, {
19282
+ type: "json_object";
19283
+ }, {
19284
+ type: "json_object";
19285
+ }>, z.ZodObject<{
19286
+ type: z.ZodLiteral<"json_schema">;
19287
+ json_schema: z.ZodObject<{
19288
+ name: z.ZodString;
19289
+ description: z.ZodOptional<z.ZodString>;
19290
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
19291
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
19292
+ }, "strip", z.ZodTypeAny, {
19293
+ name: string;
19294
+ description?: string | undefined;
19295
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19296
+ strict?: boolean | null | undefined;
19297
+ }, {
19298
+ name: string;
19299
+ description?: string | undefined;
19300
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19301
+ strict?: boolean | null | undefined;
19302
+ }>;
19303
+ }, "strip", z.ZodTypeAny, {
19304
+ type: "json_schema";
19305
+ json_schema: {
19306
+ name: string;
19307
+ description?: string | undefined;
19308
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19309
+ strict?: boolean | null | undefined;
19310
+ };
19311
+ }, {
19312
+ type: "json_schema";
19313
+ json_schema: {
19314
+ name: string;
19315
+ description?: string | undefined;
19316
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19317
+ strict?: boolean | null | undefined;
19318
+ };
19319
+ }>, z.ZodObject<{
19320
+ type: z.ZodLiteral<"text">;
19321
+ }, "strip", z.ZodTypeAny, {
19322
+ type: "text";
19323
+ }, {
19324
+ type: "text";
19325
+ }>, z.ZodNull]>>;
19326
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
19327
+ type: z.ZodLiteral<"function">;
19328
+ function: z.ZodObject<{
19329
+ name: z.ZodString;
19330
+ }, "strip", z.ZodTypeAny, {
19331
+ name: string;
19332
+ }, {
19333
+ name: string;
19334
+ }>;
19335
+ }, "strip", z.ZodTypeAny, {
19336
+ function: {
19337
+ name: string;
19338
+ };
19339
+ type: "function";
19340
+ }, {
19341
+ function: {
19342
+ name: string;
19343
+ };
19344
+ type: "function";
19345
+ }>]>>;
19346
+ function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
19347
+ name: z.ZodString;
19348
+ }, "strip", z.ZodTypeAny, {
19349
+ name: string;
19350
+ }, {
19351
+ name: string;
19352
+ }>]>>;
19353
+ n: z.ZodOptional<z.ZodNumber>;
19354
+ stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19355
+ reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
19356
+ verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
19357
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
19358
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19359
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19360
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19361
+ temperature: z.ZodOptional<z.ZodNumber>;
19362
+ top_p: z.ZodOptional<z.ZodNumber>;
19363
+ max_tokens: z.ZodOptional<z.ZodNumber>;
19364
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
19365
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
19366
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
19367
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
19368
+ type: z.ZodLiteral<"json_object">;
19369
+ }, "strip", z.ZodTypeAny, {
19370
+ type: "json_object";
19371
+ }, {
19372
+ type: "json_object";
19373
+ }>, z.ZodObject<{
19374
+ type: z.ZodLiteral<"json_schema">;
19375
+ json_schema: z.ZodObject<{
19376
+ name: z.ZodString;
19377
+ description: z.ZodOptional<z.ZodString>;
19378
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
19379
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
19380
+ }, "strip", z.ZodTypeAny, {
19381
+ name: string;
19382
+ description?: string | undefined;
19383
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19384
+ strict?: boolean | null | undefined;
19385
+ }, {
19386
+ name: string;
19387
+ description?: string | undefined;
19388
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19389
+ strict?: boolean | null | undefined;
19390
+ }>;
19391
+ }, "strip", z.ZodTypeAny, {
19392
+ type: "json_schema";
19393
+ json_schema: {
19394
+ name: string;
19395
+ description?: string | undefined;
19396
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19397
+ strict?: boolean | null | undefined;
19398
+ };
19399
+ }, {
19400
+ type: "json_schema";
19401
+ json_schema: {
19402
+ name: string;
19403
+ description?: string | undefined;
19404
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19405
+ strict?: boolean | null | undefined;
19406
+ };
19407
+ }>, z.ZodObject<{
19408
+ type: z.ZodLiteral<"text">;
19409
+ }, "strip", z.ZodTypeAny, {
19410
+ type: "text";
19411
+ }, {
19412
+ type: "text";
19413
+ }>, z.ZodNull]>>;
19414
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
19415
+ type: z.ZodLiteral<"function">;
19416
+ function: z.ZodObject<{
19417
+ name: z.ZodString;
19418
+ }, "strip", z.ZodTypeAny, {
19419
+ name: string;
19420
+ }, {
19421
+ name: string;
19422
+ }>;
19423
+ }, "strip", z.ZodTypeAny, {
19424
+ function: {
19425
+ name: string;
19426
+ };
19427
+ type: "function";
19428
+ }, {
19429
+ function: {
19430
+ name: string;
19431
+ };
19432
+ type: "function";
19433
+ }>]>>;
19434
+ function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
19435
+ name: z.ZodString;
19436
+ }, "strip", z.ZodTypeAny, {
19437
+ name: string;
19438
+ }, {
19439
+ name: string;
19440
+ }>]>>;
19441
+ n: z.ZodOptional<z.ZodNumber>;
19442
+ stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19443
+ reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
19444
+ verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
19445
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
19446
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19447
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19448
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19449
+ max_tokens: z.ZodNumber;
19450
+ temperature: z.ZodNumber;
19451
+ top_p: z.ZodOptional<z.ZodNumber>;
19452
+ top_k: z.ZodOptional<z.ZodNumber>;
19453
+ stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19454
+ max_tokens_to_sample: z.ZodOptional<z.ZodNumber>;
19455
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
19456
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19457
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19458
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19459
+ max_tokens: z.ZodNumber;
19460
+ temperature: z.ZodNumber;
19461
+ top_p: z.ZodOptional<z.ZodNumber>;
19462
+ top_k: z.ZodOptional<z.ZodNumber>;
19463
+ stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19464
+ max_tokens_to_sample: z.ZodOptional<z.ZodNumber>;
19465
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
19466
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19467
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19468
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19469
+ max_tokens: z.ZodNumber;
19470
+ temperature: z.ZodNumber;
19471
+ top_p: z.ZodOptional<z.ZodNumber>;
19472
+ top_k: z.ZodOptional<z.ZodNumber>;
19473
+ stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19474
+ max_tokens_to_sample: z.ZodOptional<z.ZodNumber>;
19475
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
19476
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19477
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19478
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19479
+ temperature: z.ZodOptional<z.ZodNumber>;
19480
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
19481
+ topP: z.ZodOptional<z.ZodNumber>;
19482
+ topK: z.ZodOptional<z.ZodNumber>;
19483
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
19484
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19485
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19486
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19487
+ temperature: z.ZodOptional<z.ZodNumber>;
19488
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
19489
+ topP: z.ZodOptional<z.ZodNumber>;
19490
+ topK: z.ZodOptional<z.ZodNumber>;
19491
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
19492
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19493
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19494
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19495
+ temperature: z.ZodOptional<z.ZodNumber>;
19496
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
19497
+ topP: z.ZodOptional<z.ZodNumber>;
19498
+ topK: z.ZodOptional<z.ZodNumber>;
19499
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
19500
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19501
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19502
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19503
+ temperature: z.ZodOptional<z.ZodNumber>;
19504
+ topK: z.ZodOptional<z.ZodNumber>;
19505
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
19506
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19507
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19508
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19509
+ temperature: z.ZodOptional<z.ZodNumber>;
19510
+ topK: z.ZodOptional<z.ZodNumber>;
19511
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
19512
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19513
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19514
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19515
+ temperature: z.ZodOptional<z.ZodNumber>;
19516
+ topK: z.ZodOptional<z.ZodNumber>;
19517
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
19518
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19519
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19520
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19521
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
19522
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19523
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19524
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19525
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
19526
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19527
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19528
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19529
+ }, z.ZodTypeAny, "passthrough">>]>>;
19530
+ }, "strip", z.ZodTypeAny, {
19531
+ model: string;
19532
+ params?: z.objectOutputType<{
19533
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19534
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19535
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19536
+ temperature: z.ZodOptional<z.ZodNumber>;
19537
+ top_p: z.ZodOptional<z.ZodNumber>;
19538
+ max_tokens: z.ZodOptional<z.ZodNumber>;
19539
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
19540
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
19541
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
19542
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
19543
+ type: z.ZodLiteral<"json_object">;
19544
+ }, "strip", z.ZodTypeAny, {
19545
+ type: "json_object";
19546
+ }, {
19547
+ type: "json_object";
19548
+ }>, z.ZodObject<{
19549
+ type: z.ZodLiteral<"json_schema">;
19550
+ json_schema: z.ZodObject<{
19551
+ name: z.ZodString;
19552
+ description: z.ZodOptional<z.ZodString>;
19553
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
19554
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
19555
+ }, "strip", z.ZodTypeAny, {
19556
+ name: string;
19557
+ description?: string | undefined;
19558
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19559
+ strict?: boolean | null | undefined;
19560
+ }, {
19561
+ name: string;
19562
+ description?: string | undefined;
19563
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19564
+ strict?: boolean | null | undefined;
19565
+ }>;
19566
+ }, "strip", z.ZodTypeAny, {
19567
+ type: "json_schema";
19568
+ json_schema: {
19569
+ name: string;
19570
+ description?: string | undefined;
19571
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19572
+ strict?: boolean | null | undefined;
19573
+ };
19574
+ }, {
19575
+ type: "json_schema";
19576
+ json_schema: {
19577
+ name: string;
19578
+ description?: string | undefined;
19579
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19580
+ strict?: boolean | null | undefined;
19581
+ };
19582
+ }>, z.ZodObject<{
19583
+ type: z.ZodLiteral<"text">;
19584
+ }, "strip", z.ZodTypeAny, {
19585
+ type: "text";
19586
+ }, {
19587
+ type: "text";
19588
+ }>, z.ZodNull]>>;
19589
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
19590
+ type: z.ZodLiteral<"function">;
19591
+ function: z.ZodObject<{
19592
+ name: z.ZodString;
19593
+ }, "strip", z.ZodTypeAny, {
19594
+ name: string;
19595
+ }, {
19596
+ name: string;
19597
+ }>;
19598
+ }, "strip", z.ZodTypeAny, {
19599
+ function: {
19600
+ name: string;
19601
+ };
19602
+ type: "function";
19603
+ }, {
19604
+ function: {
19605
+ name: string;
19606
+ };
19607
+ type: "function";
19608
+ }>]>>;
19609
+ function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
19610
+ name: z.ZodString;
19611
+ }, "strip", z.ZodTypeAny, {
19612
+ name: string;
19613
+ }, {
19614
+ name: string;
19615
+ }>]>>;
19616
+ n: z.ZodOptional<z.ZodNumber>;
19617
+ stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19618
+ reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
19619
+ verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
19620
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
19621
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19622
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19623
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19624
+ max_tokens: z.ZodNumber;
19625
+ temperature: z.ZodNumber;
19626
+ top_p: z.ZodOptional<z.ZodNumber>;
19627
+ top_k: z.ZodOptional<z.ZodNumber>;
19628
+ stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19629
+ max_tokens_to_sample: z.ZodOptional<z.ZodNumber>;
19630
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
19631
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19632
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19633
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19634
+ temperature: z.ZodOptional<z.ZodNumber>;
19635
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
19636
+ topP: z.ZodOptional<z.ZodNumber>;
19637
+ topK: z.ZodOptional<z.ZodNumber>;
19638
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
19639
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19640
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19641
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19642
+ temperature: z.ZodOptional<z.ZodNumber>;
19643
+ topK: z.ZodOptional<z.ZodNumber>;
19644
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
19645
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19646
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19647
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19648
+ }, z.ZodTypeAny, "passthrough"> | undefined;
19649
+ }, {
19650
+ model: string;
19651
+ params?: z.objectInputType<{
19652
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19653
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19654
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19655
+ temperature: z.ZodOptional<z.ZodNumber>;
19656
+ top_p: z.ZodOptional<z.ZodNumber>;
19657
+ max_tokens: z.ZodOptional<z.ZodNumber>;
19658
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
19659
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
19660
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
19661
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
19662
+ type: z.ZodLiteral<"json_object">;
19663
+ }, "strip", z.ZodTypeAny, {
19664
+ type: "json_object";
19665
+ }, {
19666
+ type: "json_object";
19667
+ }>, z.ZodObject<{
19668
+ type: z.ZodLiteral<"json_schema">;
19669
+ json_schema: z.ZodObject<{
19670
+ name: z.ZodString;
19671
+ description: z.ZodOptional<z.ZodString>;
19672
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
19673
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
19674
+ }, "strip", z.ZodTypeAny, {
19675
+ name: string;
19676
+ description?: string | undefined;
19677
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19678
+ strict?: boolean | null | undefined;
19679
+ }, {
19680
+ name: string;
19681
+ description?: string | undefined;
19682
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19683
+ strict?: boolean | null | undefined;
19684
+ }>;
19685
+ }, "strip", z.ZodTypeAny, {
19686
+ type: "json_schema";
19687
+ json_schema: {
19688
+ name: string;
19689
+ description?: string | undefined;
19690
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19691
+ strict?: boolean | null | undefined;
19692
+ };
19693
+ }, {
19694
+ type: "json_schema";
19695
+ json_schema: {
19696
+ name: string;
19697
+ description?: string | undefined;
19698
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
19699
+ strict?: boolean | null | undefined;
19700
+ };
19701
+ }>, z.ZodObject<{
19702
+ type: z.ZodLiteral<"text">;
19703
+ }, "strip", z.ZodTypeAny, {
19704
+ type: "text";
19705
+ }, {
19706
+ type: "text";
19707
+ }>, z.ZodNull]>>;
19708
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
19709
+ type: z.ZodLiteral<"function">;
19710
+ function: z.ZodObject<{
19711
+ name: z.ZodString;
19712
+ }, "strip", z.ZodTypeAny, {
19713
+ name: string;
19714
+ }, {
19715
+ name: string;
19716
+ }>;
19717
+ }, "strip", z.ZodTypeAny, {
19718
+ function: {
19719
+ name: string;
19720
+ };
19721
+ type: "function";
19722
+ }, {
19723
+ function: {
19724
+ name: string;
19725
+ };
19726
+ type: "function";
19727
+ }>]>>;
19728
+ function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
19729
+ name: z.ZodString;
19730
+ }, "strip", z.ZodTypeAny, {
19731
+ name: string;
19732
+ }, {
19733
+ name: string;
19734
+ }>]>>;
19735
+ n: z.ZodOptional<z.ZodNumber>;
19736
+ stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19737
+ reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
19738
+ verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
19739
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
19740
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19741
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19742
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19743
+ max_tokens: z.ZodNumber;
19744
+ temperature: z.ZodNumber;
19745
+ top_p: z.ZodOptional<z.ZodNumber>;
19746
+ top_k: z.ZodOptional<z.ZodNumber>;
19747
+ stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19748
+ max_tokens_to_sample: z.ZodOptional<z.ZodNumber>;
19749
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
19750
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19751
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19752
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19753
+ temperature: z.ZodOptional<z.ZodNumber>;
19754
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
19755
+ topP: z.ZodOptional<z.ZodNumber>;
19756
+ topK: z.ZodOptional<z.ZodNumber>;
19757
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
19758
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19759
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19760
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19761
+ temperature: z.ZodOptional<z.ZodNumber>;
19762
+ topK: z.ZodOptional<z.ZodNumber>;
19763
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
19764
+ use_cache: z.ZodOptional<z.ZodBoolean>;
19765
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19766
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
19767
+ }, z.ZodTypeAny, "passthrough"> | undefined;
19768
+ }>>;
19769
+ type PromptDefinition = z.infer<typeof promptDefinitionSchema>;
19770
+ declare const promptDefinitionWithToolsSchema: z.ZodIntersection<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
19771
+ prompt: z.ZodString;
19772
+ }, "strip", z.ZodTypeAny, {
19773
+ prompt: string;
19774
+ }, {
19775
+ prompt: string;
19776
+ }>, z.ZodObject<{
19777
+ messages: z.ZodArray<z.ZodUnion<[z.ZodObject<{
19778
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
19779
+ text: z.ZodDefault<z.ZodString>;
19780
+ type: z.ZodLiteral<"text">;
19781
+ cache_control: z.ZodOptional<z.ZodObject<{
19782
+ type: z.ZodLiteral<"ephemeral">;
19783
+ }, "strip", z.ZodTypeAny, {
19784
+ type: "ephemeral";
19785
+ }, {
19786
+ type: "ephemeral";
19787
+ }>>;
19788
+ }, "strip", z.ZodTypeAny, {
19789
+ type: "text";
19790
+ text: string;
19791
+ cache_control?: {
19792
+ type: "ephemeral";
19793
+ } | undefined;
19794
+ }, {
19795
+ type: "text";
19796
+ text?: string | undefined;
19797
+ cache_control?: {
19798
+ type: "ephemeral";
19799
+ } | undefined;
19800
+ }>, "many">]>;
19801
+ role: z.ZodLiteral<"system">;
19802
+ name: z.ZodOptional<z.ZodString>;
19803
+ }, "strip", z.ZodTypeAny, {
19804
+ role: "system";
19805
+ content: string | {
19806
+ type: "text";
19807
+ text: string;
19808
+ cache_control?: {
19809
+ type: "ephemeral";
19810
+ } | undefined;
19811
+ }[];
19812
+ name?: string | undefined;
19813
+ }, {
19814
+ role: "system";
19815
+ content: string | {
19816
+ type: "text";
19817
+ text?: string | undefined;
19818
+ cache_control?: {
19819
+ type: "ephemeral";
19820
+ } | undefined;
19821
+ }[];
19822
+ name?: string | undefined;
19823
+ }>, z.ZodObject<{
19824
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
19825
+ text: z.ZodDefault<z.ZodString>;
19826
+ type: z.ZodLiteral<"text">;
19827
+ cache_control: z.ZodOptional<z.ZodObject<{
19828
+ type: z.ZodLiteral<"ephemeral">;
19829
+ }, "strip", z.ZodTypeAny, {
19830
+ type: "ephemeral";
19831
+ }, {
19832
+ type: "ephemeral";
19833
+ }>>;
19834
+ }, "strip", z.ZodTypeAny, {
19835
+ type: "text";
19836
+ text: string;
19837
+ cache_control?: {
19838
+ type: "ephemeral";
19839
+ } | undefined;
19840
+ }, {
19841
+ type: "text";
19842
+ text?: string | undefined;
19843
+ cache_control?: {
19844
+ type: "ephemeral";
19845
+ } | undefined;
19846
+ }>, z.ZodObject<{
19847
+ image_url: z.ZodObject<{
19848
+ url: z.ZodString;
19849
+ detail: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"low">, z.ZodLiteral<"high">]>>;
19850
+ }, "strip", z.ZodTypeAny, {
19851
+ url: string;
19852
+ detail?: "auto" | "low" | "high" | undefined;
19853
+ }, {
19854
+ url: string;
19855
+ detail?: "auto" | "low" | "high" | undefined;
19856
+ }>;
19857
+ type: z.ZodLiteral<"image_url">;
19858
+ }, "strip", z.ZodTypeAny, {
19859
+ type: "image_url";
19860
+ image_url: {
19861
+ url: string;
19862
+ detail?: "auto" | "low" | "high" | undefined;
19863
+ };
19864
+ }, {
19865
+ type: "image_url";
19866
+ image_url: {
19867
+ url: string;
19868
+ detail?: "auto" | "low" | "high" | undefined;
19869
+ };
19870
+ }>, z.ZodObject<{
19871
+ file: z.ZodObject<{
19872
+ file_data: z.ZodOptional<z.ZodString>;
19873
+ filename: z.ZodOptional<z.ZodString>;
19874
+ file_id: z.ZodOptional<z.ZodString>;
19875
+ }, "strip", z.ZodTypeAny, {
19876
+ filename?: string | undefined;
19877
+ file_data?: string | undefined;
19878
+ file_id?: string | undefined;
19879
+ }, {
19880
+ filename?: string | undefined;
19881
+ file_data?: string | undefined;
19882
+ file_id?: string | undefined;
19883
+ }>;
19884
+ type: z.ZodLiteral<"file">;
19885
+ }, "strip", z.ZodTypeAny, {
19886
+ type: "file";
19887
+ file: {
19888
+ filename?: string | undefined;
19889
+ file_data?: string | undefined;
19890
+ file_id?: string | undefined;
19891
+ };
19892
+ }, {
19893
+ type: "file";
19894
+ file: {
19895
+ filename?: string | undefined;
19896
+ file_data?: string | undefined;
19897
+ file_id?: string | undefined;
19898
+ };
19899
+ }>]>, "many">]>;
19900
+ role: z.ZodLiteral<"user">;
19901
+ name: z.ZodOptional<z.ZodString>;
19902
+ }, "strip", z.ZodTypeAny, {
19903
+ role: "user";
19904
+ content: string | ({
19905
+ type: "text";
19906
+ text: string;
19907
+ cache_control?: {
19908
+ type: "ephemeral";
19909
+ } | undefined;
19910
+ } | {
19911
+ type: "image_url";
19912
+ image_url: {
19913
+ url: string;
19914
+ detail?: "auto" | "low" | "high" | undefined;
19915
+ };
19916
+ } | {
19917
+ type: "file";
19918
+ file: {
19919
+ filename?: string | undefined;
19920
+ file_data?: string | undefined;
19921
+ file_id?: string | undefined;
19922
+ };
19923
+ })[];
19924
+ name?: string | undefined;
19925
+ }, {
19926
+ role: "user";
19927
+ content: string | ({
19928
+ type: "text";
19929
+ text?: string | undefined;
19930
+ cache_control?: {
19931
+ type: "ephemeral";
19932
+ } | undefined;
19933
+ } | {
19934
+ type: "image_url";
19935
+ image_url: {
19936
+ url: string;
19937
+ detail?: "auto" | "low" | "high" | undefined;
19938
+ };
19939
+ } | {
19940
+ type: "file";
19941
+ file: {
19942
+ filename?: string | undefined;
19943
+ file_data?: string | undefined;
19944
+ file_id?: string | undefined;
19945
+ };
19946
+ })[];
19947
+ name?: string | undefined;
19948
+ }>, z.ZodObject<{
19949
+ role: z.ZodLiteral<"assistant">;
19950
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
19951
+ text: z.ZodDefault<z.ZodString>;
19952
+ type: z.ZodLiteral<"text">;
19953
+ cache_control: z.ZodOptional<z.ZodObject<{
19954
+ type: z.ZodLiteral<"ephemeral">;
19955
+ }, "strip", z.ZodTypeAny, {
19956
+ type: "ephemeral";
19957
+ }, {
19958
+ type: "ephemeral";
19959
+ }>>;
19960
+ }, "strip", z.ZodTypeAny, {
19961
+ type: "text";
19962
+ text: string;
19963
+ cache_control?: {
19964
+ type: "ephemeral";
19965
+ } | undefined;
19966
+ }, {
19967
+ type: "text";
19968
+ text?: string | undefined;
19969
+ cache_control?: {
19970
+ type: "ephemeral";
19971
+ } | undefined;
19972
+ }>, "many">, z.ZodNull]>>;
19973
+ function_call: z.ZodOptional<z.ZodObject<{
19974
+ arguments: z.ZodString;
19975
+ name: z.ZodString;
19976
+ }, "strip", z.ZodTypeAny, {
19977
+ name: string;
19978
+ arguments: string;
19979
+ }, {
19980
+ name: string;
19981
+ arguments: string;
19982
+ }>>;
19983
+ name: z.ZodOptional<z.ZodString>;
19984
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
19985
+ id: z.ZodString;
19986
+ function: z.ZodObject<{
19987
+ arguments: z.ZodString;
19988
+ name: z.ZodString;
19989
+ }, "strip", z.ZodTypeAny, {
19990
+ name: string;
19991
+ arguments: string;
19992
+ }, {
19993
+ name: string;
19994
+ arguments: string;
19995
+ }>;
19996
+ type: z.ZodLiteral<"function">;
19997
+ }, "strip", z.ZodTypeAny, {
19998
+ function: {
19999
+ name: string;
20000
+ arguments: string;
20001
+ };
20002
+ type: "function";
20003
+ id: string;
20004
+ }, {
20005
+ function: {
20006
+ name: string;
20007
+ arguments: string;
20008
+ };
20009
+ type: "function";
20010
+ id: string;
20011
+ }>, "many">>;
20012
+ reasoning: z.ZodOptional<z.ZodArray<z.ZodObject<{
20013
+ id: z.ZodOptional<z.ZodString>;
20014
+ content: z.ZodOptional<z.ZodString>;
20015
+ }, "strip", z.ZodTypeAny, {
20016
+ id?: string | undefined;
20017
+ content?: string | undefined;
20018
+ }, {
20019
+ id?: string | undefined;
20020
+ content?: string | undefined;
20021
+ }>, "many">>;
20022
+ }, "strip", z.ZodTypeAny, {
20023
+ role: "assistant";
20024
+ name?: string | undefined;
20025
+ function_call?: {
20026
+ name: string;
20027
+ arguments: string;
20028
+ } | undefined;
20029
+ content?: string | {
20030
+ type: "text";
20031
+ text: string;
20032
+ cache_control?: {
20033
+ type: "ephemeral";
20034
+ } | undefined;
20035
+ }[] | null | undefined;
20036
+ tool_calls?: {
20037
+ function: {
20038
+ name: string;
20039
+ arguments: string;
20040
+ };
20041
+ type: "function";
20042
+ id: string;
20043
+ }[] | undefined;
20044
+ reasoning?: {
20045
+ id?: string | undefined;
20046
+ content?: string | undefined;
20047
+ }[] | undefined;
20048
+ }, {
20049
+ role: "assistant";
20050
+ name?: string | undefined;
20051
+ function_call?: {
20052
+ name: string;
20053
+ arguments: string;
20054
+ } | undefined;
20055
+ content?: string | {
20056
+ type: "text";
20057
+ text?: string | undefined;
20058
+ cache_control?: {
20059
+ type: "ephemeral";
20060
+ } | undefined;
20061
+ }[] | null | undefined;
20062
+ tool_calls?: {
20063
+ function: {
20064
+ name: string;
20065
+ arguments: string;
20066
+ };
20067
+ type: "function";
20068
+ id: string;
20069
+ }[] | undefined;
20070
+ reasoning?: {
20071
+ id?: string | undefined;
20072
+ content?: string | undefined;
20073
+ }[] | undefined;
20074
+ }>, z.ZodObject<{
20075
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
20076
+ text: z.ZodDefault<z.ZodString>;
20077
+ type: z.ZodLiteral<"text">;
20078
+ cache_control: z.ZodOptional<z.ZodObject<{
20079
+ type: z.ZodLiteral<"ephemeral">;
20080
+ }, "strip", z.ZodTypeAny, {
20081
+ type: "ephemeral";
20082
+ }, {
20083
+ type: "ephemeral";
20084
+ }>>;
20085
+ }, "strip", z.ZodTypeAny, {
20086
+ type: "text";
20087
+ text: string;
20088
+ cache_control?: {
20089
+ type: "ephemeral";
20090
+ } | undefined;
20091
+ }, {
20092
+ type: "text";
20093
+ text?: string | undefined;
20094
+ cache_control?: {
20095
+ type: "ephemeral";
20096
+ } | undefined;
20097
+ }>, "many">]>;
20098
+ role: z.ZodLiteral<"tool">;
20099
+ tool_call_id: z.ZodDefault<z.ZodString>;
20100
+ }, "strip", z.ZodTypeAny, {
20101
+ role: "tool";
20102
+ content: string | {
20103
+ type: "text";
20104
+ text: string;
20105
+ cache_control?: {
20106
+ type: "ephemeral";
20107
+ } | undefined;
20108
+ }[];
20109
+ tool_call_id: string;
20110
+ }, {
20111
+ role: "tool";
20112
+ content: string | {
20113
+ type: "text";
20114
+ text?: string | undefined;
20115
+ cache_control?: {
20116
+ type: "ephemeral";
20117
+ } | undefined;
20118
+ }[];
20119
+ tool_call_id?: string | undefined;
20120
+ }>, z.ZodObject<{
20121
+ content: z.ZodUnion<[z.ZodString, z.ZodNull]>;
20122
+ name: z.ZodString;
20123
+ role: z.ZodLiteral<"function">;
20124
+ }, "strip", z.ZodTypeAny, {
20125
+ role: "function";
20126
+ name: string;
20127
+ content: string | null;
20128
+ }, {
20129
+ role: "function";
20130
+ name: string;
20131
+ content: string | null;
20132
+ }>, z.ZodObject<{
20133
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
20134
+ text: z.ZodDefault<z.ZodString>;
20135
+ type: z.ZodLiteral<"text">;
20136
+ cache_control: z.ZodOptional<z.ZodObject<{
20137
+ type: z.ZodLiteral<"ephemeral">;
20138
+ }, "strip", z.ZodTypeAny, {
20139
+ type: "ephemeral";
20140
+ }, {
20141
+ type: "ephemeral";
20142
+ }>>;
20143
+ }, "strip", z.ZodTypeAny, {
20144
+ type: "text";
20145
+ text: string;
20146
+ cache_control?: {
20147
+ type: "ephemeral";
20148
+ } | undefined;
20149
+ }, {
20150
+ type: "text";
20151
+ text?: string | undefined;
20152
+ cache_control?: {
20153
+ type: "ephemeral";
20154
+ } | undefined;
20155
+ }>, "many">]>;
20156
+ role: z.ZodLiteral<"developer">;
20157
+ name: z.ZodOptional<z.ZodString>;
20158
+ }, "strip", z.ZodTypeAny, {
20159
+ role: "developer";
20160
+ content: string | {
20161
+ type: "text";
20162
+ text: string;
20163
+ cache_control?: {
20164
+ type: "ephemeral";
20165
+ } | undefined;
20166
+ }[];
20167
+ name?: string | undefined;
20168
+ }, {
20169
+ role: "developer";
20170
+ content: string | {
20171
+ type: "text";
20172
+ text?: string | undefined;
20173
+ cache_control?: {
20174
+ type: "ephemeral";
20175
+ } | undefined;
20176
+ }[];
20177
+ name?: string | undefined;
20178
+ }>, z.ZodObject<{
20179
+ role: z.ZodLiteral<"model">;
20180
+ content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
20181
+ }, "strip", z.ZodTypeAny, {
20182
+ role: "model";
20183
+ content?: string | null | undefined;
20184
+ }, {
20185
+ role: "model";
20186
+ content?: string | null | undefined;
20187
+ }>]>, "many">;
20188
+ }, "strip", z.ZodTypeAny, {
20189
+ messages: ({
20190
+ role: "system";
20191
+ content: string | {
20192
+ type: "text";
20193
+ text: string;
20194
+ cache_control?: {
20195
+ type: "ephemeral";
20196
+ } | undefined;
20197
+ }[];
20198
+ name?: string | undefined;
20199
+ } | {
20200
+ role: "user";
20201
+ content: string | ({
20202
+ type: "text";
20203
+ text: string;
20204
+ cache_control?: {
20205
+ type: "ephemeral";
20206
+ } | undefined;
20207
+ } | {
20208
+ type: "image_url";
20209
+ image_url: {
20210
+ url: string;
20211
+ detail?: "auto" | "low" | "high" | undefined;
20212
+ };
20213
+ } | {
20214
+ type: "file";
20215
+ file: {
20216
+ filename?: string | undefined;
20217
+ file_data?: string | undefined;
20218
+ file_id?: string | undefined;
20219
+ };
20220
+ })[];
20221
+ name?: string | undefined;
20222
+ } | {
20223
+ role: "assistant";
20224
+ name?: string | undefined;
20225
+ function_call?: {
20226
+ name: string;
20227
+ arguments: string;
20228
+ } | undefined;
20229
+ content?: string | {
20230
+ type: "text";
20231
+ text: string;
20232
+ cache_control?: {
20233
+ type: "ephemeral";
20234
+ } | undefined;
20235
+ }[] | null | undefined;
20236
+ tool_calls?: {
20237
+ function: {
20238
+ name: string;
20239
+ arguments: string;
20240
+ };
20241
+ type: "function";
20242
+ id: string;
20243
+ }[] | undefined;
20244
+ reasoning?: {
20245
+ id?: string | undefined;
20246
+ content?: string | undefined;
20247
+ }[] | undefined;
20248
+ } | {
20249
+ role: "tool";
20250
+ content: string | {
20251
+ type: "text";
20252
+ text: string;
20253
+ cache_control?: {
20254
+ type: "ephemeral";
20255
+ } | undefined;
20256
+ }[];
20257
+ tool_call_id: string;
20258
+ } | {
20259
+ role: "function";
20260
+ name: string;
20261
+ content: string | null;
20262
+ } | {
20263
+ role: "developer";
20264
+ content: string | {
20265
+ type: "text";
20266
+ text: string;
20267
+ cache_control?: {
20268
+ type: "ephemeral";
20269
+ } | undefined;
20270
+ }[];
20271
+ name?: string | undefined;
20272
+ } | {
20273
+ role: "model";
20274
+ content?: string | null | undefined;
20275
+ })[];
20276
+ }, {
20277
+ messages: ({
20278
+ role: "system";
20279
+ content: string | {
20280
+ type: "text";
20281
+ text?: string | undefined;
20282
+ cache_control?: {
20283
+ type: "ephemeral";
20284
+ } | undefined;
20285
+ }[];
20286
+ name?: string | undefined;
20287
+ } | {
20288
+ role: "user";
20289
+ content: string | ({
20290
+ type: "text";
20291
+ text?: string | undefined;
20292
+ cache_control?: {
20293
+ type: "ephemeral";
20294
+ } | undefined;
20295
+ } | {
20296
+ type: "image_url";
20297
+ image_url: {
20298
+ url: string;
20299
+ detail?: "auto" | "low" | "high" | undefined;
20300
+ };
20301
+ } | {
20302
+ type: "file";
20303
+ file: {
20304
+ filename?: string | undefined;
20305
+ file_data?: string | undefined;
20306
+ file_id?: string | undefined;
20307
+ };
20308
+ })[];
20309
+ name?: string | undefined;
20310
+ } | {
20311
+ role: "assistant";
20312
+ name?: string | undefined;
20313
+ function_call?: {
20314
+ name: string;
20315
+ arguments: string;
20316
+ } | undefined;
20317
+ content?: string | {
20318
+ type: "text";
20319
+ text?: string | undefined;
20320
+ cache_control?: {
20321
+ type: "ephemeral";
20322
+ } | undefined;
20323
+ }[] | null | undefined;
20324
+ tool_calls?: {
20325
+ function: {
20326
+ name: string;
20327
+ arguments: string;
20328
+ };
20329
+ type: "function";
20330
+ id: string;
20331
+ }[] | undefined;
20332
+ reasoning?: {
20333
+ id?: string | undefined;
20334
+ content?: string | undefined;
20335
+ }[] | undefined;
20336
+ } | {
20337
+ role: "tool";
20338
+ content: string | {
20339
+ type: "text";
20340
+ text?: string | undefined;
20341
+ cache_control?: {
20342
+ type: "ephemeral";
20343
+ } | undefined;
20344
+ }[];
20345
+ tool_call_id?: string | undefined;
20346
+ } | {
20347
+ role: "function";
20348
+ name: string;
20349
+ content: string | null;
20350
+ } | {
20351
+ role: "developer";
20352
+ content: string | {
20353
+ type: "text";
20354
+ text?: string | undefined;
20355
+ cache_control?: {
20356
+ type: "ephemeral";
20357
+ } | undefined;
20358
+ }[];
20359
+ name?: string | undefined;
20360
+ } | {
20361
+ role: "model";
20362
+ content?: string | null | undefined;
20363
+ })[];
20364
+ }>]>, z.ZodObject<{
20365
+ model: z.ZodString;
20366
+ params: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
20367
+ use_cache: z.ZodOptional<z.ZodBoolean>;
20368
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
20369
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
20370
+ temperature: z.ZodOptional<z.ZodNumber>;
20371
+ top_p: z.ZodOptional<z.ZodNumber>;
20372
+ max_tokens: z.ZodOptional<z.ZodNumber>;
20373
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
20374
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
20375
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
20376
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
20377
+ type: z.ZodLiteral<"json_object">;
20378
+ }, "strip", z.ZodTypeAny, {
20379
+ type: "json_object";
20380
+ }, {
20381
+ type: "json_object";
20382
+ }>, z.ZodObject<{
20383
+ type: z.ZodLiteral<"json_schema">;
20384
+ json_schema: z.ZodObject<{
20385
+ name: z.ZodString;
20386
+ description: z.ZodOptional<z.ZodString>;
20387
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
20388
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
20389
+ }, "strip", z.ZodTypeAny, {
20390
+ name: string;
20391
+ description?: string | undefined;
20392
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20393
+ strict?: boolean | null | undefined;
20394
+ }, {
20395
+ name: string;
20396
+ description?: string | undefined;
20397
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20398
+ strict?: boolean | null | undefined;
20399
+ }>;
20400
+ }, "strip", z.ZodTypeAny, {
20401
+ type: "json_schema";
20402
+ json_schema: {
20403
+ name: string;
20404
+ description?: string | undefined;
20405
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20406
+ strict?: boolean | null | undefined;
20407
+ };
20408
+ }, {
20409
+ type: "json_schema";
20410
+ json_schema: {
20411
+ name: string;
20412
+ description?: string | undefined;
20413
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20414
+ strict?: boolean | null | undefined;
20415
+ };
20416
+ }>, z.ZodObject<{
20417
+ type: z.ZodLiteral<"text">;
20418
+ }, "strip", z.ZodTypeAny, {
20419
+ type: "text";
20420
+ }, {
20421
+ type: "text";
20422
+ }>, z.ZodNull]>>;
20423
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
20424
+ type: z.ZodLiteral<"function">;
20425
+ function: z.ZodObject<{
20426
+ name: z.ZodString;
20427
+ }, "strip", z.ZodTypeAny, {
20428
+ name: string;
20429
+ }, {
20430
+ name: string;
20431
+ }>;
20432
+ }, "strip", z.ZodTypeAny, {
20433
+ function: {
20434
+ name: string;
20435
+ };
20436
+ type: "function";
20437
+ }, {
20438
+ function: {
20439
+ name: string;
20440
+ };
20441
+ type: "function";
20442
+ }>]>>;
20443
+ function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
20444
+ name: z.ZodString;
20445
+ }, "strip", z.ZodTypeAny, {
20446
+ name: string;
20447
+ }, {
20448
+ name: string;
20449
+ }>]>>;
20450
+ n: z.ZodOptional<z.ZodNumber>;
20451
+ stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
20452
+ reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
20453
+ verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
20454
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
20455
+ use_cache: z.ZodOptional<z.ZodBoolean>;
20456
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
20457
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
20458
+ temperature: z.ZodOptional<z.ZodNumber>;
20459
+ top_p: z.ZodOptional<z.ZodNumber>;
20460
+ max_tokens: z.ZodOptional<z.ZodNumber>;
20461
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
20462
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
20463
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
20464
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
20465
+ type: z.ZodLiteral<"json_object">;
20466
+ }, "strip", z.ZodTypeAny, {
20467
+ type: "json_object";
20468
+ }, {
20469
+ type: "json_object";
20470
+ }>, z.ZodObject<{
20471
+ type: z.ZodLiteral<"json_schema">;
20472
+ json_schema: z.ZodObject<{
20473
+ name: z.ZodString;
20474
+ description: z.ZodOptional<z.ZodString>;
20475
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
20476
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
20477
+ }, "strip", z.ZodTypeAny, {
20478
+ name: string;
20479
+ description?: string | undefined;
20480
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20481
+ strict?: boolean | null | undefined;
20482
+ }, {
20483
+ name: string;
20484
+ description?: string | undefined;
20485
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20486
+ strict?: boolean | null | undefined;
20487
+ }>;
20488
+ }, "strip", z.ZodTypeAny, {
20489
+ type: "json_schema";
20490
+ json_schema: {
20491
+ name: string;
20492
+ description?: string | undefined;
20493
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20494
+ strict?: boolean | null | undefined;
20495
+ };
20496
+ }, {
20497
+ type: "json_schema";
20498
+ json_schema: {
20499
+ name: string;
20500
+ description?: string | undefined;
20501
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20502
+ strict?: boolean | null | undefined;
20503
+ };
20504
+ }>, z.ZodObject<{
20505
+ type: z.ZodLiteral<"text">;
18711
20506
  }, "strip", z.ZodTypeAny, {
18712
20507
  type: "text";
18713
20508
  }, {
@@ -19155,8 +20950,64 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
19155
20950
  reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
19156
20951
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
19157
20952
  }, z.ZodTypeAny, "passthrough"> | undefined;
20953
+ }>>, z.ZodObject<{
20954
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
20955
+ type: z.ZodLiteral<"function">;
20956
+ function: z.ZodObject<{
20957
+ name: z.ZodString;
20958
+ description: z.ZodOptional<z.ZodString>;
20959
+ parameters: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
20960
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
20961
+ }, "strip", z.ZodTypeAny, {
20962
+ name: string;
20963
+ description?: string | undefined;
20964
+ strict?: boolean | null | undefined;
20965
+ parameters?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20966
+ }, {
20967
+ name: string;
20968
+ description?: string | undefined;
20969
+ strict?: boolean | null | undefined;
20970
+ parameters?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20971
+ }>;
20972
+ }, "strip", z.ZodTypeAny, {
20973
+ function: {
20974
+ name: string;
20975
+ description?: string | undefined;
20976
+ strict?: boolean | null | undefined;
20977
+ parameters?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20978
+ };
20979
+ type: "function";
20980
+ }, {
20981
+ function: {
20982
+ name: string;
20983
+ description?: string | undefined;
20984
+ strict?: boolean | null | undefined;
20985
+ parameters?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20986
+ };
20987
+ type: "function";
20988
+ }>, "many">>;
20989
+ }, "strip", z.ZodTypeAny, {
20990
+ tools?: {
20991
+ function: {
20992
+ name: string;
20993
+ description?: string | undefined;
20994
+ strict?: boolean | null | undefined;
20995
+ parameters?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
20996
+ };
20997
+ type: "function";
20998
+ }[] | undefined;
20999
+ }, {
21000
+ tools?: {
21001
+ function: {
21002
+ name: string;
21003
+ description?: string | undefined;
21004
+ strict?: boolean | null | undefined;
21005
+ parameters?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
21006
+ };
21007
+ type: "function";
21008
+ }[] | undefined;
19158
21009
  }>>;
19159
- type PromptDefinition = z.infer<typeof promptDefinitionSchema>;
21010
+ type PromptDefinitionWithTools = z.infer<typeof promptDefinitionWithToolsSchema>;
19160
21011
  type PromptOpts<HasId extends boolean, HasVersion extends boolean, HasTools extends boolean = true, HasNoTrace extends boolean = true> = (Partial<Omit<BaseFnOpts, "name">> & {
19161
21012
  name: string;
19162
21013
  }) & (HasId extends true ? PromptId : Partial<PromptId>) & (HasVersion extends true ? PromptVersion : Partial<PromptVersion>) & (HasTools extends true ? Partial<PromptTools> : {}) & (HasNoTrace extends true ? Partial<PromptNoTrace> : {}) & PromptDefinition;
@@ -19165,6 +21016,7 @@ declare class PromptBuilder {
19165
21016
  constructor(project: Project);
19166
21017
  create<HasId extends boolean = false, HasVersion extends boolean = false>(opts: PromptOpts<HasId, HasVersion>): Prompt<HasId, HasVersion>;
19167
21018
  }
21019
+ declare function promptDefinitionToPromptData(promptDefinition: PromptDefinition, rawTools?: ToolFunctionDefinitionType[]): PromptDataType;
19168
21020
  interface FunctionEvent {
19169
21021
  project_id: string;
19170
21022
  slug: string;
@@ -19184,6 +21036,38 @@ declare class ProjectNameIdMap {
19184
21036
  resolve(project: Project): Promise<string>;
19185
21037
  }
19186
21038
 
21039
+ interface ProgressReporter {
21040
+ start: (name: string, total: number) => void;
21041
+ stop: () => void;
21042
+ increment: (name: string) => void;
21043
+ setTotal?: (name: string, total: number) => void;
21044
+ }
21045
+ interface ReporterOpts {
21046
+ verbose: boolean;
21047
+ jsonl: boolean;
21048
+ }
21049
+ interface ReporterBody<EvalReport> {
21050
+ /**
21051
+ * A function that takes an evaluator and its result and returns a report.
21052
+ *
21053
+ * @param evaluator
21054
+ * @param result
21055
+ * @param opts
21056
+ */
21057
+ reportEval(evaluator: EvaluatorDef<any, any, any, any, any>, result: EvalResultWithSummary<any, any, any, any>, opts: ReporterOpts): Promise<EvalReport> | EvalReport;
21058
+ /**
21059
+ * A function that takes all evaluator results and returns a boolean indicating
21060
+ * whether the run was successful. If you return false, the `braintrust eval`
21061
+ * command will exit with a non-zero status code.
21062
+ *
21063
+ * @param reports
21064
+ */
21065
+ reportRun(reports: EvalReport[]): boolean | Promise<boolean>;
21066
+ }
21067
+ type ReporterDef<EvalReport> = {
21068
+ name: string;
21069
+ } & ReporterBody<EvalReport>;
21070
+
19187
21071
  declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
19188
21072
  type: z.ZodLiteral<"prompt">;
19189
21073
  default: z.ZodOptional<z.ZodIntersection<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
@@ -21054,37 +22938,16 @@ declare class EvalResultWithSummary<Input, Output, Expected, Metadata extends Ba
21054
22938
  summary: ExperimentSummary;
21055
22939
  results: EvalResult<Input, Output, Expected, Metadata>[];
21056
22940
  constructor(summary: ExperimentSummary, results: EvalResult<Input, Output, Expected, Metadata>[]);
22941
+ /**
22942
+ * @deprecated Use `summary` instead.
22943
+ */
21057
22944
  toString(): string;
21058
22945
  toJSON(): {
21059
22946
  summary: ExperimentSummary;
21060
22947
  results: EvalResult<Input, Output, Expected, Metadata>[];
21061
22948
  };
21062
22949
  }
21063
- interface ReporterOpts {
21064
- verbose: boolean;
21065
- jsonl: boolean;
21066
- }
21067
- interface ReporterBody<EvalReport> {
21068
- /**
21069
- * A function that takes an evaluator and its result and returns a report.
21070
- *
21071
- * @param evaluator
21072
- * @param result
21073
- * @param opts
21074
- */
21075
- reportEval(evaluator: EvaluatorDef<any, any, any, any, any>, result: EvalResultWithSummary<any, any, any, any>, opts: ReporterOpts): Promise<EvalReport> | EvalReport;
21076
- /**
21077
- * A function that takes all evaluator results and returns a boolean indicating
21078
- * whether the run was successful. If you return false, the `braintrust eval`
21079
- * command will exit with a non-zero status code.
21080
- *
21081
- * @param reports
21082
- */
21083
- reportRun(reports: EvalReport[]): boolean | Promise<boolean>;
21084
- }
21085
- type ReporterDef<EvalReport> = {
21086
- name: string;
21087
- } & ReporterBody<EvalReport>;
22950
+
21088
22951
  type EvaluatorDef<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType, Parameters extends EvalParameters = EvalParameters> = {
21089
22952
  projectName: string;
21090
22953
  evalName: string;
@@ -21113,6 +22976,87 @@ declare global {
21113
22976
  var _spanContext: SpanContext | undefined;
21114
22977
  var _lazy_load: boolean;
21115
22978
  }
22979
+ interface EvalOptions<EvalReport, Parameters extends EvalParameters> {
22980
+ /**
22981
+ * A `Reporter` which you can use to summarize progress after an Eval() runs.
22982
+ */
22983
+ reporter?: ReporterDef<EvalReport> | string;
22984
+ /**
22985
+ * Do not send logs to Braintrust. When true, the evaluation runs locally
22986
+ * and builds a local summary instead of creating an experiment. Defaults to false.
22987
+ */
22988
+ noSendLogs?: boolean;
22989
+ /**
22990
+ * A callback function that will be called when an experiment is started with
22991
+ * information about its project, experiment id, name, and other useful information.
22992
+ * @param metadata
22993
+ */
22994
+ onStart?: (metadata: Omit<ExperimentSummary, "scores" | "metrics">) => void;
22995
+ /**
22996
+ * A function that will be called with progress events, which can be used to
22997
+ * display intermediate progress.
22998
+ *
22999
+ * @param data
23000
+ */
23001
+ stream?: (data: SSEProgressEventDataType) => void;
23002
+ /**
23003
+ * If specified, instead of creating a new experiment object, the Eval() will populate
23004
+ * the object or span specified by this parent.
23005
+ */
23006
+ parent?: string;
23007
+ /**
23008
+ * Specify this to create a custom progress-bar style reporter. Note that this interface
23009
+ * is somewhat outdated, and may be removed in the future.
23010
+ */
23011
+ progress?: ProgressReporter;
23012
+ /**
23013
+ * The parameters to use for the evaluator.
23014
+ */
23015
+ parameters?: InferParameters<Parameters>;
23016
+ /**
23017
+ * Whether to retain the per-example Eval results and return them from Eval().
23018
+ *
23019
+ * When `true` (default): All evaluation results are collected in memory and returned,
23020
+ * allowing inspection of individual test case inputs, outputs, scores, and metadata.
23021
+ * This is convenient for interactive analysis but can consume significant memory for
23022
+ * large datasets (e.g., millions of examples).
23023
+ *
23024
+ * When `false`: Individual results are not retained in memory. Only aggregate score
23025
+ * statistics are computed incrementally. The returned `results` array will be empty,
23026
+ * but the `summary` will still contain accurate score aggregates. This is suitable for:
23027
+ * - Large-scale evaluations (millions of examples)
23028
+ * - Memory-constrained environments
23029
+ * - Scenarios where only aggregate metrics are needed
23030
+ *
23031
+ * Note: When `false`, you cannot access individual test case results after evaluation.
23032
+ * If you need to inspect specific failures or outputs, keep this as `true`.
23033
+ *
23034
+ * Defaults to `true` for backwards compatibility.
23035
+ *
23036
+ * @example
23037
+ * // Memory-efficient evaluation of a large dataset
23038
+ * await Eval("large-eval", evaluator, {
23039
+ * returnResults: false // Only keep aggregate scores
23040
+ * });
23041
+ */
23042
+ returnResults?: boolean;
23043
+ }
23044
+ declare function Eval<Input, Output, Expected = void, Metadata extends BaseMetadata = DefaultMetadataType, EvalReport = boolean, Parameters extends EvalParameters = EvalParameters>(name: string, evaluator: Evaluator<Input, Output, Expected, Metadata, Parameters>, reporterOrOpts?: ReporterDef<EvalReport> | string | EvalOptions<EvalReport, Parameters>): Promise<EvalResultWithSummary<Input, Output, Expected, Metadata>>;
23045
+ declare function Reporter<EvalReport>(name: string, reporter: ReporterBody<EvalReport>): ReporterDef<EvalReport>;
23046
+ interface Filter {
23047
+ path: string[];
23048
+ pattern: RegExp;
23049
+ }
23050
+ declare function runEvaluator(experiment: Experiment | null, evaluator: EvaluatorDef<any, any, any, any, any>, progressReporter: ProgressReporter, filters: Filter[], stream: ((data: SSEProgressEventDataType) => void) | undefined, parameters?: InferParameters<EvalParameters>, collectResults?: boolean): Promise<EvalResultWithSummary<any, any, any, any>>;
23051
+ declare const defaultErrorScoreHandler: ErrorScoreHandler;
23052
+ type ScoreAccumulator = {
23053
+ [name: string]: {
23054
+ total: number;
23055
+ count: number;
23056
+ };
23057
+ };
23058
+ declare function buildLocalSummary(evaluator: EvaluatorDef<any, any, any, any>, results: EvalResult<any, any, any, any>[], precomputedScores?: ScoreAccumulator): ExperimentSummary;
23059
+ declare function reportFailures<Input, Output, Expected, Metadata extends BaseMetadata>(evaluator: EvaluatorDef<Input, Output, Expected, Metadata>, failingResults: EvalResult<Input, Output, Expected, Metadata>[], { verbose, jsonl }: ReporterOpts): void;
21116
23060
 
21117
23061
  type EvaluatorManifest = Record<string, EvaluatorDef<unknown, unknown, unknown, BaseMetadata>>;
21118
23062
  declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
@@ -28708,169 +30652,216 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
28708
30652
  }>>;
28709
30653
  type EvaluatorDefinitions = z.infer<typeof evaluatorDefinitionsSchema>;
28710
30654
 
28711
- type braintrust_AnyDataset = AnyDataset;
28712
- type braintrust_Attachment = Attachment;
28713
- declare const braintrust_Attachment: typeof Attachment;
28714
- type braintrust_AttachmentParams = AttachmentParams;
28715
- declare const braintrust_AttachmentReference: typeof AttachmentReference;
28716
- type braintrust_BackgroundLoggerOpts = BackgroundLoggerOpts;
28717
- type braintrust_BaseAttachment = BaseAttachment;
28718
- declare const braintrust_BaseAttachment: typeof BaseAttachment;
28719
- type braintrust_BaseMetadata = BaseMetadata;
28720
- declare const braintrust_BraintrustMiddleware: typeof BraintrustMiddleware;
28721
- type braintrust_BraintrustState = BraintrustState;
28722
- declare const braintrust_BraintrustState: typeof BraintrustState;
28723
- type braintrust_BraintrustStream = BraintrustStream;
28724
- declare const braintrust_BraintrustStream: typeof BraintrustStream;
28725
- type braintrust_BraintrustStreamChunk = BraintrustStreamChunk;
28726
- type braintrust_ChatPrompt = ChatPrompt;
28727
- type braintrust_CommentEvent = CommentEvent;
28728
- type braintrust_CompiledPrompt<Flavor extends "chat" | "completion"> = CompiledPrompt<Flavor>;
28729
- type braintrust_CompiledPromptParams = CompiledPromptParams;
28730
- type braintrust_CompletionPrompt = CompletionPrompt;
28731
- type braintrust_ContextManager = ContextManager;
28732
- declare const braintrust_ContextManager: typeof ContextManager;
28733
- type braintrust_ContextParentSpanIds = ContextParentSpanIds;
28734
- declare const braintrust_DEFAULT_FETCH_BATCH_SIZE: typeof DEFAULT_FETCH_BATCH_SIZE;
28735
- type braintrust_DataSummary = DataSummary;
28736
- type braintrust_Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY_DATASET> = Dataset<IsLegacyDataset>;
28737
- declare const braintrust_Dataset: typeof Dataset;
28738
- type braintrust_DatasetRecord<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY_DATASET> = DatasetRecord<IsLegacyDataset>;
28739
- type braintrust_DatasetSummary = DatasetSummary;
28740
- type braintrust_DefaultMetadataType = DefaultMetadataType;
28741
- type braintrust_DefaultPromptArgs = DefaultPromptArgs;
28742
- declare const braintrust_ERR_PERMALINK: typeof ERR_PERMALINK;
28743
- type braintrust_EndSpanArgs = EndSpanArgs;
28744
- type braintrust_EvalCase<Input, Expected, Metadata> = EvalCase<Input, Expected, Metadata>;
28745
- type braintrust_EvalParameterSerializedSchema = EvalParameterSerializedSchema;
28746
- type braintrust_EvalParameters = EvalParameters;
28747
- type braintrust_EvaluatorDefinition = EvaluatorDefinition;
28748
- type braintrust_EvaluatorDefinitions = EvaluatorDefinitions;
28749
- type braintrust_EvaluatorManifest = EvaluatorManifest;
28750
- type braintrust_Experiment = Experiment;
28751
- declare const braintrust_Experiment: typeof Experiment;
28752
- type braintrust_ExperimentLogFullArgs = ExperimentLogFullArgs;
28753
- type braintrust_ExperimentLogPartialArgs = ExperimentLogPartialArgs;
28754
- type braintrust_ExperimentSummary = ExperimentSummary;
28755
- type braintrust_Exportable = Exportable;
28756
- type braintrust_ExternalAttachment = ExternalAttachment;
28757
- declare const braintrust_ExternalAttachment: typeof ExternalAttachment;
28758
- type braintrust_ExternalAttachmentParams = ExternalAttachmentParams;
28759
- type braintrust_FailedHTTPResponse = FailedHTTPResponse;
28760
- declare const braintrust_FailedHTTPResponse: typeof FailedHTTPResponse;
28761
- type braintrust_FullInitDatasetOptions<IsLegacyDataset extends boolean> = FullInitDatasetOptions<IsLegacyDataset>;
28762
- type braintrust_FullInitOptions<IsOpen extends boolean> = FullInitOptions<IsOpen>;
28763
- type braintrust_FullLoginOptions = FullLoginOptions;
28764
- type braintrust_IDGenerator = IDGenerator;
28765
- declare const braintrust_IDGenerator: typeof IDGenerator;
28766
- type braintrust_IdField = IdField;
28767
- type braintrust_InitDatasetOptions<IsLegacyDataset extends boolean> = InitDatasetOptions<IsLegacyDataset>;
28768
- type braintrust_InitLoggerOptions<IsAsyncFlush> = InitLoggerOptions<IsAsyncFlush>;
28769
- type braintrust_InitOptions<IsOpen extends boolean> = InitOptions<IsOpen>;
28770
- type braintrust_InputField = InputField;
28771
- type braintrust_InvokeFunctionArgs<Input, Output, Stream extends boolean = false> = InvokeFunctionArgs<Input, Output, Stream>;
28772
- type braintrust_InvokeReturn<Stream extends boolean, Output> = InvokeReturn<Stream, Output>;
28773
- type braintrust_JSONAttachment = JSONAttachment;
28774
- declare const braintrust_JSONAttachment: typeof JSONAttachment;
28775
- declare const braintrust_LEGACY_CACHED_HEADER: typeof LEGACY_CACHED_HEADER;
28776
- type braintrust_LazyValue<T> = LazyValue<T>;
28777
- declare const braintrust_LazyValue: typeof LazyValue;
28778
- type braintrust_LoadPromptOptions = LoadPromptOptions;
28779
- type braintrust_LogCommentFullArgs = LogCommentFullArgs;
28780
- type braintrust_LogFeedbackFullArgs = LogFeedbackFullArgs;
28781
- type braintrust_LogOptions<IsAsyncFlush> = LogOptions<IsAsyncFlush>;
28782
- type braintrust_Logger<IsAsyncFlush extends boolean> = Logger<IsAsyncFlush>;
28783
- declare const braintrust_Logger: typeof Logger;
28784
- type braintrust_LoginInvalidOrgError = LoginInvalidOrgError;
28785
- declare const braintrust_LoginInvalidOrgError: typeof LoginInvalidOrgError;
28786
- type braintrust_LoginOptions = LoginOptions;
28787
- type braintrust_MetricSummary = MetricSummary;
28788
- declare const braintrust_NOOP_SPAN: typeof NOOP_SPAN;
28789
- declare const braintrust_NOOP_SPAN_PERMALINK: typeof NOOP_SPAN_PERMALINK;
28790
- type braintrust_NoopSpan = NoopSpan;
28791
- declare const braintrust_NoopSpan: typeof NoopSpan;
28792
- type braintrust_ObjectMetadata = ObjectMetadata;
28793
- type braintrust_OtherExperimentLogFields = OtherExperimentLogFields;
28794
- type braintrust_ParentExperimentIds = ParentExperimentIds;
28795
- type braintrust_ParentProjectLogIds = ParentProjectLogIds;
28796
- type braintrust_PromiseUnless<B, R> = PromiseUnless<B, R>;
28797
- type braintrust_Prompt<HasId extends boolean = true, HasVersion extends boolean = true> = Prompt<HasId, HasVersion>;
28798
- declare const braintrust_Prompt: typeof Prompt;
28799
- type braintrust_PromptRowWithId<HasId extends boolean = true, HasVersion extends boolean = true> = PromptRowWithId<HasId, HasVersion>;
28800
- type braintrust_ReadonlyAttachment = ReadonlyAttachment;
28801
- declare const braintrust_ReadonlyAttachment: typeof ReadonlyAttachment;
28802
- type braintrust_ReadonlyExperiment = ReadonlyExperiment;
28803
- declare const braintrust_ReadonlyExperiment: typeof ReadonlyExperiment;
28804
- type braintrust_ScoreSummary = ScoreSummary;
28805
- type braintrust_SerializedBraintrustState = SerializedBraintrustState;
28806
- type braintrust_SetCurrentArg = SetCurrentArg;
28807
- type braintrust_Span = Span;
28808
- type braintrust_SpanImpl = SpanImpl;
28809
- declare const braintrust_SpanImpl: typeof SpanImpl;
28810
- type braintrust_StartSpanArgs = StartSpanArgs;
28811
- type braintrust_TestBackgroundLogger = TestBackgroundLogger;
28812
- declare const braintrust_TestBackgroundLogger: typeof TestBackgroundLogger;
28813
- type braintrust_UUIDGenerator = UUIDGenerator;
28814
- declare const braintrust_UUIDGenerator: typeof UUIDGenerator;
28815
- type braintrust_WithTransactionId<R> = WithTransactionId<R>;
28816
- declare const braintrust_X_CACHED_HEADER: typeof X_CACHED_HEADER;
28817
- declare const braintrust__exportsForTestingOnly: typeof _exportsForTestingOnly;
28818
- declare const braintrust__internalGetGlobalState: typeof _internalGetGlobalState;
28819
- declare const braintrust__internalSetInitialState: typeof _internalSetInitialState;
28820
- declare const braintrust_braintrustStreamChunkSchema: typeof braintrustStreamChunkSchema;
28821
- declare const braintrust_createFinalValuePassThroughStream: typeof createFinalValuePassThroughStream;
28822
- declare const braintrust_currentExperiment: typeof currentExperiment;
28823
- declare const braintrust_currentLogger: typeof currentLogger;
28824
- declare const braintrust_currentSpan: typeof currentSpan;
28825
- declare const braintrust_deepCopyEvent: typeof deepCopyEvent;
28826
- declare const braintrust_deserializePlainStringAsJSON: typeof deserializePlainStringAsJSON;
28827
- declare const braintrust_devNullWritableStream: typeof devNullWritableStream;
28828
- declare const braintrust_evaluatorDefinitionSchema: typeof evaluatorDefinitionSchema;
28829
- declare const braintrust_evaluatorDefinitionsSchema: typeof evaluatorDefinitionsSchema;
28830
- declare const braintrust_flush: typeof flush;
28831
- declare const braintrust_getContextManager: typeof getContextManager;
28832
- declare const braintrust_getIdGenerator: typeof getIdGenerator;
28833
- declare const braintrust_getPromptVersions: typeof getPromptVersions;
28834
- declare const braintrust_getSpanParentObject: typeof getSpanParentObject;
28835
- declare const braintrust_init: typeof init;
28836
- declare const braintrust_initDataset: typeof initDataset;
28837
- declare const braintrust_initExperiment: typeof initExperiment;
28838
- declare const braintrust_initFunction: typeof initFunction;
28839
- declare const braintrust_initLogger: typeof initLogger;
28840
- declare const braintrust_invoke: typeof invoke;
28841
- declare const braintrust_loadPrompt: typeof loadPrompt;
28842
- declare const braintrust_log: typeof log;
28843
- declare const braintrust_logError: typeof logError;
28844
- declare const braintrust_login: typeof login;
28845
- declare const braintrust_loginToState: typeof loginToState;
28846
- declare const braintrust_newId: typeof newId;
28847
- declare const braintrust_parseCachedHeader: typeof parseCachedHeader;
28848
- declare const braintrust_permalink: typeof permalink;
28849
- declare const braintrust_renderMessage: typeof renderMessage;
28850
- declare const braintrust_renderPromptParams: typeof renderPromptParams;
28851
- declare const braintrust_setFetch: typeof setFetch;
28852
- declare const braintrust_setMaskingFunction: typeof setMaskingFunction;
28853
- declare const braintrust_spanComponentsToObjectId: typeof spanComponentsToObjectId;
28854
- declare const braintrust_startSpan: typeof startSpan;
28855
- declare const braintrust_summarize: typeof summarize;
28856
- declare const braintrust_traceable: typeof traceable;
28857
- declare const braintrust_traced: typeof traced;
28858
- declare const braintrust_updateSpan: typeof updateSpan;
28859
- declare const braintrust_withCurrent: typeof withCurrent;
28860
- declare const braintrust_withDataset: typeof withDataset;
28861
- declare const braintrust_withExperiment: typeof withExperiment;
28862
- declare const braintrust_withLogger: typeof withLogger;
28863
- declare const braintrust_withParent: typeof withParent;
28864
- declare const braintrust_wrapAISDK: typeof wrapAISDK;
28865
- declare const braintrust_wrapAnthropic: typeof wrapAnthropic;
28866
- declare const braintrust_wrapClaudeAgentSDK: typeof wrapClaudeAgentSDK;
28867
- declare const braintrust_wrapGoogleGenAI: typeof wrapGoogleGenAI;
28868
- declare const braintrust_wrapMastraAgent: typeof wrapMastraAgent;
28869
- declare const braintrust_wrapOpenAI: typeof wrapOpenAI;
28870
- declare const braintrust_wrapOpenAIv4: typeof wrapOpenAIv4;
28871
- declare const braintrust_wrapTraced: typeof wrapTraced;
28872
- declare namespace braintrust {
28873
- export { type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, braintrust_AttachmentReference as AttachmentReference, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustMiddleware as BraintrustMiddleware, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, type braintrust_CommentEvent as CommentEvent, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, braintrust_ContextManager as ContextManager, type braintrust_ContextParentSpanIds as ContextParentSpanIds, braintrust_DEFAULT_FETCH_BATCH_SIZE as DEFAULT_FETCH_BATCH_SIZE, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetRecord as DatasetRecord, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, braintrust_ERR_PERMALINK as ERR_PERMALINK, type braintrust_EndSpanArgs as EndSpanArgs, type braintrust_EvalCase as EvalCase, type braintrust_EvalParameterSerializedSchema as EvalParameterSerializedSchema, type braintrust_EvalParameters as EvalParameters, type braintrust_EvaluatorDefinition as EvaluatorDefinition, type braintrust_EvaluatorDefinitions as EvaluatorDefinitions, type braintrust_EvaluatorManifest as EvaluatorManifest, braintrust_Experiment as Experiment, type braintrust_ExperimentLogFullArgs as ExperimentLogFullArgs, type braintrust_ExperimentLogPartialArgs as ExperimentLogPartialArgs, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_ExternalAttachment as ExternalAttachment, type braintrust_ExternalAttachmentParams as ExternalAttachmentParams, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitDatasetOptions as FullInitDatasetOptions, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, braintrust_IDGenerator as IDGenerator, type braintrust_IdField as IdField, type braintrust_InitDatasetOptions as InitDatasetOptions, type braintrust_InitLoggerOptions as InitLoggerOptions, type braintrust_InitOptions as InitOptions, type braintrust_InputField as InputField, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_JSONAttachment as JSONAttachment, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LoadPromptOptions as LoadPromptOptions, type braintrust_LogCommentFullArgs as LogCommentFullArgs, type braintrust_LogFeedbackFullArgs as LogFeedbackFullArgs, type braintrust_LogOptions as LogOptions, braintrust_Logger as Logger, braintrust_LoginInvalidOrgError as LoginInvalidOrgError, type braintrust_LoginOptions as LoginOptions, type braintrust_MetricSummary as MetricSummary, braintrust_NOOP_SPAN as NOOP_SPAN, braintrust_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, braintrust_NoopSpan as NoopSpan, type braintrust_ObjectMetadata as ObjectMetadata, type braintrust_OtherExperimentLogFields as OtherExperimentLogFields, type braintrust_ParentExperimentIds as ParentExperimentIds, type braintrust_ParentProjectLogIds as ParentProjectLogIds, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, type braintrust_ScoreSummary as ScoreSummary, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type braintrust_Span as Span, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, braintrust_UUIDGenerator as UUIDGenerator, type braintrust_WithTransactionId as WithTransactionId, braintrust_X_CACHED_HEADER as X_CACHED_HEADER, braintrust__exportsForTestingOnly as _exportsForTestingOnly, braintrust__internalGetGlobalState as _internalGetGlobalState, braintrust__internalSetInitialState as _internalSetInitialState, braintrust_braintrustStreamChunkSchema as braintrustStreamChunkSchema, braintrust_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_deepCopyEvent as deepCopyEvent, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_evaluatorDefinitionSchema as evaluatorDefinitionSchema, braintrust_evaluatorDefinitionsSchema as evaluatorDefinitionsSchema, braintrust_flush as flush, braintrust_getContextManager as getContextManager, braintrust_getIdGenerator as getIdGenerator, braintrust_getPromptVersions as getPromptVersions, braintrust_getSpanParentObject as getSpanParentObject, graphFramework as graph, braintrust_init as init, braintrust_initDataset as initDataset, braintrust_initExperiment as initExperiment, braintrust_initFunction as initFunction, braintrust_initLogger as initLogger, braintrust_invoke as invoke, braintrust_loadPrompt as loadPrompt, braintrust_log as log, braintrust_logError as logError, braintrust_login as login, braintrust_loginToState as loginToState, braintrust_newId as newId, braintrust_parseCachedHeader as parseCachedHeader, braintrust_permalink as permalink, braintrust_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_setFetch as setFetch, braintrust_setMaskingFunction as setMaskingFunction, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, braintrust_traceable as traceable, braintrust_traced as traced, braintrust_updateSpan as updateSpan, braintrust_withCurrent as withCurrent, braintrust_withDataset as withDataset, braintrust_withExperiment as withExperiment, braintrust_withLogger as withLogger, braintrust_withParent as withParent, braintrust_wrapAISDK as wrapAISDK, braintrust_wrapAnthropic as wrapAnthropic, braintrust_wrapClaudeAgentSDK as wrapClaudeAgentSDK, braintrust_wrapGoogleGenAI as wrapGoogleGenAI, braintrust_wrapMastraAgent as wrapMastraAgent, braintrust_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
30655
+ type _exports_AnyDataset = AnyDataset;
30656
+ type _exports_Attachment = Attachment;
30657
+ declare const _exports_Attachment: typeof Attachment;
30658
+ type _exports_AttachmentParams = AttachmentParams;
30659
+ declare const _exports_AttachmentReference: typeof AttachmentReference;
30660
+ type _exports_BackgroundLoggerOpts = BackgroundLoggerOpts;
30661
+ type _exports_BaseAttachment = BaseAttachment;
30662
+ declare const _exports_BaseAttachment: typeof BaseAttachment;
30663
+ declare const _exports_BaseExperiment: typeof BaseExperiment;
30664
+ type _exports_BaseMetadata = BaseMetadata;
30665
+ declare const _exports_BraintrustMiddleware: typeof BraintrustMiddleware;
30666
+ type _exports_BraintrustState = BraintrustState;
30667
+ declare const _exports_BraintrustState: typeof BraintrustState;
30668
+ type _exports_BraintrustStream = BraintrustStream;
30669
+ declare const _exports_BraintrustStream: typeof BraintrustStream;
30670
+ type _exports_BraintrustStreamChunk = BraintrustStreamChunk;
30671
+ type _exports_ChatPrompt = ChatPrompt;
30672
+ type _exports_CodeFunction<Input, Output, Fn extends GenericFunction<Input, Output>> = CodeFunction<Input, Output, Fn>;
30673
+ declare const _exports_CodeFunction: typeof CodeFunction;
30674
+ type _exports_CodeOpts<Params, Returns, Fn extends GenericFunction<Params, Returns>> = CodeOpts<Params, Returns, Fn>;
30675
+ type _exports_CodePrompt = CodePrompt;
30676
+ declare const _exports_CodePrompt: typeof CodePrompt;
30677
+ type _exports_CommentEvent = CommentEvent;
30678
+ type _exports_CompiledPrompt<Flavor extends "chat" | "completion"> = CompiledPrompt<Flavor>;
30679
+ type _exports_CompiledPromptParams = CompiledPromptParams;
30680
+ type _exports_CompletionPrompt = CompletionPrompt;
30681
+ type _exports_ContextManager = ContextManager;
30682
+ declare const _exports_ContextManager: typeof ContextManager;
30683
+ type _exports_ContextParentSpanIds = ContextParentSpanIds;
30684
+ type _exports_CreateProjectOpts = CreateProjectOpts;
30685
+ declare const _exports_DEFAULT_FETCH_BATCH_SIZE: typeof DEFAULT_FETCH_BATCH_SIZE;
30686
+ type _exports_DataSummary = DataSummary;
30687
+ type _exports_Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY_DATASET> = Dataset<IsLegacyDataset>;
30688
+ declare const _exports_Dataset: typeof Dataset;
30689
+ type _exports_DatasetRecord<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY_DATASET> = DatasetRecord<IsLegacyDataset>;
30690
+ type _exports_DatasetSummary = DatasetSummary;
30691
+ type _exports_DefaultMetadataType = DefaultMetadataType;
30692
+ type _exports_DefaultPromptArgs = DefaultPromptArgs;
30693
+ declare const _exports_ERR_PERMALINK: typeof ERR_PERMALINK;
30694
+ type _exports_EndSpanArgs = EndSpanArgs;
30695
+ declare const _exports_Eval: typeof Eval;
30696
+ type _exports_EvalCase<Input, Expected, Metadata> = EvalCase<Input, Expected, Metadata>;
30697
+ type _exports_EvalHooks<Expected, Metadata extends BaseMetadata, Parameters extends EvalParameters> = EvalHooks<Expected, Metadata, Parameters>;
30698
+ type _exports_EvalParameterSerializedSchema = EvalParameterSerializedSchema;
30699
+ type _exports_EvalParameters = EvalParameters;
30700
+ type _exports_EvalResult<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = EvalResult<Input, Output, Expected, Metadata>;
30701
+ type _exports_EvalResultWithSummary<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = EvalResultWithSummary<Input, Output, Expected, Metadata>;
30702
+ declare const _exports_EvalResultWithSummary: typeof EvalResultWithSummary;
30703
+ type _exports_EvalScorer<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = EvalScorer<Input, Output, Expected, Metadata>;
30704
+ type _exports_EvalScorerArgs<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = EvalScorerArgs<Input, Output, Expected, Metadata>;
30705
+ type _exports_EvalTask<Input, Output, Expected, Metadata extends BaseMetadata, Parameters extends EvalParameters> = EvalTask<Input, Output, Expected, Metadata, Parameters>;
30706
+ type _exports_Evaluator<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType, Parameters extends EvalParameters = EvalParameters> = Evaluator<Input, Output, Expected, Metadata, Parameters>;
30707
+ type _exports_EvaluatorDef<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType, Parameters extends EvalParameters = EvalParameters> = EvaluatorDef<Input, Output, Expected, Metadata, Parameters>;
30708
+ type _exports_EvaluatorDefinition = EvaluatorDefinition;
30709
+ type _exports_EvaluatorDefinitions = EvaluatorDefinitions;
30710
+ type _exports_EvaluatorFile = EvaluatorFile;
30711
+ type _exports_EvaluatorManifest = EvaluatorManifest;
30712
+ type _exports_Experiment = Experiment;
30713
+ declare const _exports_Experiment: typeof Experiment;
30714
+ type _exports_ExperimentLogFullArgs = ExperimentLogFullArgs;
30715
+ type _exports_ExperimentLogPartialArgs = ExperimentLogPartialArgs;
30716
+ type _exports_ExperimentSummary = ExperimentSummary;
30717
+ type _exports_Exportable = Exportable;
30718
+ type _exports_ExternalAttachment = ExternalAttachment;
30719
+ declare const _exports_ExternalAttachment: typeof ExternalAttachment;
30720
+ type _exports_ExternalAttachmentParams = ExternalAttachmentParams;
30721
+ type _exports_FailedHTTPResponse = FailedHTTPResponse;
30722
+ declare const _exports_FailedHTTPResponse: typeof FailedHTTPResponse;
30723
+ type _exports_FullInitDatasetOptions<IsLegacyDataset extends boolean> = FullInitDatasetOptions<IsLegacyDataset>;
30724
+ type _exports_FullInitOptions<IsOpen extends boolean> = FullInitOptions<IsOpen>;
30725
+ type _exports_FullLoginOptions = FullLoginOptions;
30726
+ type _exports_FunctionEvent = FunctionEvent;
30727
+ type _exports_IDGenerator = IDGenerator;
30728
+ declare const _exports_IDGenerator: typeof IDGenerator;
30729
+ type _exports_IdField = IdField;
30730
+ type _exports_InitDatasetOptions<IsLegacyDataset extends boolean> = InitDatasetOptions<IsLegacyDataset>;
30731
+ type _exports_InitLoggerOptions<IsAsyncFlush> = InitLoggerOptions<IsAsyncFlush>;
30732
+ type _exports_InitOptions<IsOpen extends boolean> = InitOptions<IsOpen>;
30733
+ type _exports_InputField = InputField;
30734
+ type _exports_InvokeFunctionArgs<Input, Output, Stream extends boolean = false> = InvokeFunctionArgs<Input, Output, Stream>;
30735
+ type _exports_InvokeReturn<Stream extends boolean, Output> = InvokeReturn<Stream, Output>;
30736
+ type _exports_JSONAttachment = JSONAttachment;
30737
+ declare const _exports_JSONAttachment: typeof JSONAttachment;
30738
+ declare const _exports_LEGACY_CACHED_HEADER: typeof LEGACY_CACHED_HEADER;
30739
+ type _exports_LazyValue<T> = LazyValue<T>;
30740
+ declare const _exports_LazyValue: typeof LazyValue;
30741
+ type _exports_LoadPromptOptions = LoadPromptOptions;
30742
+ type _exports_LogCommentFullArgs = LogCommentFullArgs;
30743
+ type _exports_LogFeedbackFullArgs = LogFeedbackFullArgs;
30744
+ type _exports_LogOptions<IsAsyncFlush> = LogOptions<IsAsyncFlush>;
30745
+ type _exports_Logger<IsAsyncFlush extends boolean> = Logger<IsAsyncFlush>;
30746
+ declare const _exports_Logger: typeof Logger;
30747
+ type _exports_LoginInvalidOrgError = LoginInvalidOrgError;
30748
+ declare const _exports_LoginInvalidOrgError: typeof LoginInvalidOrgError;
30749
+ type _exports_LoginOptions = LoginOptions;
30750
+ type _exports_MetricSummary = MetricSummary;
30751
+ declare const _exports_NOOP_SPAN: typeof NOOP_SPAN;
30752
+ declare const _exports_NOOP_SPAN_PERMALINK: typeof NOOP_SPAN_PERMALINK;
30753
+ type _exports_NoopSpan = NoopSpan;
30754
+ declare const _exports_NoopSpan: typeof NoopSpan;
30755
+ type _exports_ObjectMetadata = ObjectMetadata;
30756
+ type _exports_OtherExperimentLogFields = OtherExperimentLogFields;
30757
+ type _exports_ParentExperimentIds = ParentExperimentIds;
30758
+ type _exports_ParentProjectLogIds = ParentProjectLogIds;
30759
+ type _exports_Project = Project;
30760
+ declare const _exports_Project: typeof Project;
30761
+ type _exports_ProjectNameIdMap = ProjectNameIdMap;
30762
+ declare const _exports_ProjectNameIdMap: typeof ProjectNameIdMap;
30763
+ type _exports_PromiseUnless<B, R> = PromiseUnless<B, R>;
30764
+ type _exports_Prompt<HasId extends boolean = true, HasVersion extends boolean = true> = Prompt<HasId, HasVersion>;
30765
+ declare const _exports_Prompt: typeof Prompt;
30766
+ type _exports_PromptBuilder = PromptBuilder;
30767
+ declare const _exports_PromptBuilder: typeof PromptBuilder;
30768
+ type _exports_PromptContents = PromptContents;
30769
+ type _exports_PromptDefinition = PromptDefinition;
30770
+ type _exports_PromptDefinitionWithTools = PromptDefinitionWithTools;
30771
+ type _exports_PromptOpts<HasId extends boolean, HasVersion extends boolean, HasTools extends boolean = true, HasNoTrace extends boolean = true> = PromptOpts<HasId, HasVersion, HasTools, HasNoTrace>;
30772
+ type _exports_PromptRowWithId<HasId extends boolean = true, HasVersion extends boolean = true> = PromptRowWithId<HasId, HasVersion>;
30773
+ type _exports_ReadonlyAttachment = ReadonlyAttachment;
30774
+ declare const _exports_ReadonlyAttachment: typeof ReadonlyAttachment;
30775
+ type _exports_ReadonlyExperiment = ReadonlyExperiment;
30776
+ declare const _exports_ReadonlyExperiment: typeof ReadonlyExperiment;
30777
+ declare const _exports_Reporter: typeof Reporter;
30778
+ type _exports_ReporterBody<EvalReport> = ReporterBody<EvalReport>;
30779
+ type _exports_ScoreSummary = ScoreSummary;
30780
+ type _exports_ScorerBuilder = ScorerBuilder;
30781
+ declare const _exports_ScorerBuilder: typeof ScorerBuilder;
30782
+ type _exports_ScorerOpts<Output, Input, Params, Returns, Fn extends GenericFunction<Exact<Params, ScorerArgs<Output, Input>>, Returns>> = ScorerOpts<Output, Input, Params, Returns, Fn>;
30783
+ type _exports_SerializedBraintrustState = SerializedBraintrustState;
30784
+ type _exports_SetCurrentArg = SetCurrentArg;
30785
+ type _exports_Span = Span;
30786
+ type _exports_SpanContext = SpanContext;
30787
+ type _exports_SpanImpl = SpanImpl;
30788
+ declare const _exports_SpanImpl: typeof SpanImpl;
30789
+ type _exports_StartSpanArgs = StartSpanArgs;
30790
+ type _exports_TestBackgroundLogger = TestBackgroundLogger;
30791
+ declare const _exports_TestBackgroundLogger: typeof TestBackgroundLogger;
30792
+ type _exports_ToolBuilder = ToolBuilder;
30793
+ declare const _exports_ToolBuilder: typeof ToolBuilder;
30794
+ type _exports_UUIDGenerator = UUIDGenerator;
30795
+ declare const _exports_UUIDGenerator: typeof UUIDGenerator;
30796
+ type _exports_WithTransactionId<R> = WithTransactionId<R>;
30797
+ declare const _exports_X_CACHED_HEADER: typeof X_CACHED_HEADER;
30798
+ declare const _exports__exportsForTestingOnly: typeof _exportsForTestingOnly;
30799
+ declare const _exports__internalGetGlobalState: typeof _internalGetGlobalState;
30800
+ declare const _exports__internalSetInitialState: typeof _internalSetInitialState;
30801
+ declare const _exports_braintrustStreamChunkSchema: typeof braintrustStreamChunkSchema;
30802
+ declare const _exports_buildLocalSummary: typeof buildLocalSummary;
30803
+ declare const _exports_createFinalValuePassThroughStream: typeof createFinalValuePassThroughStream;
30804
+ declare const _exports_currentExperiment: typeof currentExperiment;
30805
+ declare const _exports_currentLogger: typeof currentLogger;
30806
+ declare const _exports_currentSpan: typeof currentSpan;
30807
+ declare const _exports_deepCopyEvent: typeof deepCopyEvent;
30808
+ declare const _exports_defaultErrorScoreHandler: typeof defaultErrorScoreHandler;
30809
+ declare const _exports_deserializePlainStringAsJSON: typeof deserializePlainStringAsJSON;
30810
+ declare const _exports_devNullWritableStream: typeof devNullWritableStream;
30811
+ declare const _exports_evaluatorDefinitionSchema: typeof evaluatorDefinitionSchema;
30812
+ declare const _exports_evaluatorDefinitionsSchema: typeof evaluatorDefinitionsSchema;
30813
+ declare const _exports_flush: typeof flush;
30814
+ declare const _exports_getContextManager: typeof getContextManager;
30815
+ declare const _exports_getIdGenerator: typeof getIdGenerator;
30816
+ declare const _exports_getPromptVersions: typeof getPromptVersions;
30817
+ declare const _exports_getSpanParentObject: typeof getSpanParentObject;
30818
+ declare const _exports_init: typeof init;
30819
+ declare const _exports_initDataset: typeof initDataset;
30820
+ declare const _exports_initExperiment: typeof initExperiment;
30821
+ declare const _exports_initFunction: typeof initFunction;
30822
+ declare const _exports_initLogger: typeof initLogger;
30823
+ declare const _exports_invoke: typeof invoke;
30824
+ declare const _exports_loadPrompt: typeof loadPrompt;
30825
+ declare const _exports_log: typeof log;
30826
+ declare const _exports_logError: typeof logError;
30827
+ declare const _exports_login: typeof login;
30828
+ declare const _exports_loginToState: typeof loginToState;
30829
+ declare const _exports_newId: typeof newId;
30830
+ declare const _exports_parseCachedHeader: typeof parseCachedHeader;
30831
+ declare const _exports_permalink: typeof permalink;
30832
+ declare const _exports_projects: typeof projects;
30833
+ declare const _exports_promptContentsSchema: typeof promptContentsSchema;
30834
+ declare const _exports_promptDefinitionSchema: typeof promptDefinitionSchema;
30835
+ declare const _exports_promptDefinitionToPromptData: typeof promptDefinitionToPromptData;
30836
+ declare const _exports_promptDefinitionWithToolsSchema: typeof promptDefinitionWithToolsSchema;
30837
+ declare const _exports_renderMessage: typeof renderMessage;
30838
+ declare const _exports_renderPromptParams: typeof renderPromptParams;
30839
+ declare const _exports_reportFailures: typeof reportFailures;
30840
+ declare const _exports_runEvaluator: typeof runEvaluator;
30841
+ declare const _exports_setFetch: typeof setFetch;
30842
+ declare const _exports_setMaskingFunction: typeof setMaskingFunction;
30843
+ declare const _exports_spanComponentsToObjectId: typeof spanComponentsToObjectId;
30844
+ declare const _exports_startSpan: typeof startSpan;
30845
+ declare const _exports_summarize: typeof summarize;
30846
+ declare const _exports_traceable: typeof traceable;
30847
+ declare const _exports_traced: typeof traced;
30848
+ declare const _exports_updateSpan: typeof updateSpan;
30849
+ declare const _exports_withCurrent: typeof withCurrent;
30850
+ declare const _exports_withDataset: typeof withDataset;
30851
+ declare const _exports_withExperiment: typeof withExperiment;
30852
+ declare const _exports_withLogger: typeof withLogger;
30853
+ declare const _exports_withParent: typeof withParent;
30854
+ declare const _exports_wrapAISDK: typeof wrapAISDK;
30855
+ declare const _exports_wrapAISDKModel: typeof wrapAISDKModel;
30856
+ declare const _exports_wrapAnthropic: typeof wrapAnthropic;
30857
+ declare const _exports_wrapClaudeAgentSDK: typeof wrapClaudeAgentSDK;
30858
+ declare const _exports_wrapGoogleGenAI: typeof wrapGoogleGenAI;
30859
+ declare const _exports_wrapMastraAgent: typeof wrapMastraAgent;
30860
+ declare const _exports_wrapOpenAI: typeof wrapOpenAI;
30861
+ declare const _exports_wrapOpenAIv4: typeof wrapOpenAIv4;
30862
+ declare const _exports_wrapTraced: typeof wrapTraced;
30863
+ declare namespace _exports {
30864
+ export { type _exports_AnyDataset as AnyDataset, _exports_Attachment as Attachment, type _exports_AttachmentParams as AttachmentParams, _exports_AttachmentReference as AttachmentReference, type _exports_BackgroundLoggerOpts as BackgroundLoggerOpts, _exports_BaseAttachment as BaseAttachment, _exports_BaseExperiment as BaseExperiment, type _exports_BaseMetadata as BaseMetadata, _exports_BraintrustMiddleware as BraintrustMiddleware, _exports_BraintrustState as BraintrustState, _exports_BraintrustStream as BraintrustStream, type _exports_BraintrustStreamChunk as BraintrustStreamChunk, type _exports_ChatPrompt as ChatPrompt, _exports_CodeFunction as CodeFunction, type _exports_CodeOpts as CodeOpts, _exports_CodePrompt as CodePrompt, type _exports_CommentEvent as CommentEvent, type _exports_CompiledPrompt as CompiledPrompt, type _exports_CompiledPromptParams as CompiledPromptParams, type _exports_CompletionPrompt as CompletionPrompt, _exports_ContextManager as ContextManager, type _exports_ContextParentSpanIds as ContextParentSpanIds, type _exports_CreateProjectOpts as CreateProjectOpts, _exports_DEFAULT_FETCH_BATCH_SIZE as DEFAULT_FETCH_BATCH_SIZE, type _exports_DataSummary as DataSummary, _exports_Dataset as Dataset, type _exports_DatasetRecord as DatasetRecord, type _exports_DatasetSummary as DatasetSummary, type _exports_DefaultMetadataType as DefaultMetadataType, type _exports_DefaultPromptArgs as DefaultPromptArgs, _exports_ERR_PERMALINK as ERR_PERMALINK, type _exports_EndSpanArgs as EndSpanArgs, _exports_Eval as Eval, type _exports_EvalCase as EvalCase, type _exports_EvalHooks as EvalHooks, type _exports_EvalParameterSerializedSchema as EvalParameterSerializedSchema, type _exports_EvalParameters as EvalParameters, type _exports_EvalResult as EvalResult, _exports_EvalResultWithSummary as EvalResultWithSummary, type _exports_EvalScorer as EvalScorer, type _exports_EvalScorerArgs as EvalScorerArgs, type _exports_EvalTask as EvalTask, type _exports_Evaluator as Evaluator, type _exports_EvaluatorDef as EvaluatorDef, type _exports_EvaluatorDefinition as EvaluatorDefinition, type _exports_EvaluatorDefinitions as EvaluatorDefinitions, type _exports_EvaluatorFile as EvaluatorFile, type _exports_EvaluatorManifest as EvaluatorManifest, _exports_Experiment as Experiment, type _exports_ExperimentLogFullArgs as ExperimentLogFullArgs, type _exports_ExperimentLogPartialArgs as ExperimentLogPartialArgs, type _exports_ExperimentSummary as ExperimentSummary, type _exports_Exportable as Exportable, _exports_ExternalAttachment as ExternalAttachment, type _exports_ExternalAttachmentParams as ExternalAttachmentParams, _exports_FailedHTTPResponse as FailedHTTPResponse, type _exports_FullInitDatasetOptions as FullInitDatasetOptions, type _exports_FullInitOptions as FullInitOptions, type _exports_FullLoginOptions as FullLoginOptions, type _exports_FunctionEvent as FunctionEvent, _exports_IDGenerator as IDGenerator, type _exports_IdField as IdField, type _exports_InitDatasetOptions as InitDatasetOptions, type _exports_InitLoggerOptions as InitLoggerOptions, type _exports_InitOptions as InitOptions, type _exports_InputField as InputField, type _exports_InvokeFunctionArgs as InvokeFunctionArgs, type _exports_InvokeReturn as InvokeReturn, _exports_JSONAttachment as JSONAttachment, _exports_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, _exports_LazyValue as LazyValue, type _exports_LoadPromptOptions as LoadPromptOptions, type _exports_LogCommentFullArgs as LogCommentFullArgs, type _exports_LogFeedbackFullArgs as LogFeedbackFullArgs, type _exports_LogOptions as LogOptions, _exports_Logger as Logger, _exports_LoginInvalidOrgError as LoginInvalidOrgError, type _exports_LoginOptions as LoginOptions, type _exports_MetricSummary as MetricSummary, _exports_NOOP_SPAN as NOOP_SPAN, _exports_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, _exports_NoopSpan as NoopSpan, type _exports_ObjectMetadata as ObjectMetadata, type _exports_OtherExperimentLogFields as OtherExperimentLogFields, type _exports_ParentExperimentIds as ParentExperimentIds, type _exports_ParentProjectLogIds as ParentProjectLogIds, _exports_Project as Project, _exports_ProjectNameIdMap as ProjectNameIdMap, type _exports_PromiseUnless as PromiseUnless, _exports_Prompt as Prompt, _exports_PromptBuilder as PromptBuilder, type _exports_PromptContents as PromptContents, type _exports_PromptDefinition as PromptDefinition, type _exports_PromptDefinitionWithTools as PromptDefinitionWithTools, type _exports_PromptOpts as PromptOpts, type _exports_PromptRowWithId as PromptRowWithId, _exports_ReadonlyAttachment as ReadonlyAttachment, _exports_ReadonlyExperiment as ReadonlyExperiment, _exports_Reporter as Reporter, type _exports_ReporterBody as ReporterBody, type _exports_ScoreSummary as ScoreSummary, _exports_ScorerBuilder as ScorerBuilder, type _exports_ScorerOpts as ScorerOpts, type _exports_SerializedBraintrustState as SerializedBraintrustState, type _exports_SetCurrentArg as SetCurrentArg, type _exports_Span as Span, type _exports_SpanContext as SpanContext, _exports_SpanImpl as SpanImpl, type _exports_StartSpanArgs as StartSpanArgs, _exports_TestBackgroundLogger as TestBackgroundLogger, _exports_ToolBuilder as ToolBuilder, _exports_UUIDGenerator as UUIDGenerator, type _exports_WithTransactionId as WithTransactionId, _exports_X_CACHED_HEADER as X_CACHED_HEADER, _exports__exportsForTestingOnly as _exportsForTestingOnly, _exports__internalGetGlobalState as _internalGetGlobalState, _exports__internalSetInitialState as _internalSetInitialState, _exports_braintrustStreamChunkSchema as braintrustStreamChunkSchema, _exports_buildLocalSummary as buildLocalSummary, _exports_createFinalValuePassThroughStream as createFinalValuePassThroughStream, _exports_currentExperiment as currentExperiment, _exports_currentLogger as currentLogger, _exports_currentSpan as currentSpan, _exports_deepCopyEvent as deepCopyEvent, _exports_defaultErrorScoreHandler as defaultErrorScoreHandler, _exports_deserializePlainStringAsJSON as deserializePlainStringAsJSON, _exports_devNullWritableStream as devNullWritableStream, _exports_evaluatorDefinitionSchema as evaluatorDefinitionSchema, _exports_evaluatorDefinitionsSchema as evaluatorDefinitionsSchema, _exports_flush as flush, _exports_getContextManager as getContextManager, _exports_getIdGenerator as getIdGenerator, _exports_getPromptVersions as getPromptVersions, _exports_getSpanParentObject as getSpanParentObject, graphFramework as graph, _exports_init as init, _exports_initDataset as initDataset, _exports_initExperiment as initExperiment, _exports_initFunction as initFunction, _exports_initLogger as initLogger, _exports_invoke as invoke, _exports_loadPrompt as loadPrompt, _exports_log as log, _exports_logError as logError, _exports_login as login, _exports_loginToState as loginToState, _exports_newId as newId, _exports_parseCachedHeader as parseCachedHeader, _exports_permalink as permalink, _exports_projects as projects, _exports_promptContentsSchema as promptContentsSchema, _exports_promptDefinitionSchema as promptDefinitionSchema, _exports_promptDefinitionToPromptData as promptDefinitionToPromptData, _exports_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, _exports_renderMessage as renderMessage, _exports_renderPromptParams as renderPromptParams, _exports_reportFailures as reportFailures, _exports_runEvaluator as runEvaluator, _exports_setFetch as setFetch, _exports_setMaskingFunction as setMaskingFunction, _exports_spanComponentsToObjectId as spanComponentsToObjectId, _exports_startSpan as startSpan, _exports_summarize as summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, _exports_traceable as traceable, _exports_traced as traced, _exports_updateSpan as updateSpan, _exports_withCurrent as withCurrent, _exports_withDataset as withDataset, _exports_withExperiment as withExperiment, _exports_withLogger as withLogger, _exports_withParent as withParent, _exports_wrapAISDK as wrapAISDK, _exports_wrapAISDKModel as wrapAISDKModel, _exports_wrapAnthropic as wrapAnthropic, _exports_wrapClaudeAgentSDK as wrapClaudeAgentSDK, _exports_wrapGoogleGenAI as wrapGoogleGenAI, _exports_wrapMastraAgent as wrapMastraAgent, _exports_wrapOpenAI as wrapOpenAI, _exports_wrapOpenAIv4 as wrapOpenAIv4, _exports_wrapTraced as wrapTraced };
28874
30865
  }
28875
30866
 
28876
- export { type AnyDataset, Attachment, type AttachmentParams, AttachmentReference, type BackgroundLoggerOpts, BaseAttachment, type BaseMetadata, BraintrustMiddleware, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, ContextManager, type ContextParentSpanIds, DEFAULT_FETCH_BATCH_SIZE, type DataSummary, Dataset, type DatasetRecord, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, type EvalCase, type EvalParameterSerializedSchema, type EvalParameters, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitDatasetOptions, type FullInitOptions, type FullLoginOptions, IDGenerator, type IdField, type InitDatasetOptions, type InitLoggerOptions, type InitOptions, type InputField, type InvokeFunctionArgs, type InvokeReturn, JSONAttachment, LEGACY_CACHED_HEADER, LazyValue, type LoadPromptOptions, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, LoginInvalidOrgError, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, type ObjectMetadata, type OtherExperimentLogFields, type ParentExperimentIds, type ParentProjectLogIds, type PromiseUnless, Prompt, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, type ScoreSummary, type SerializedBraintrustState, type SetCurrentArg, type Span, SpanImpl, type StartSpanArgs, TestBackgroundLogger, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, braintrust as default, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getContextManager, getIdGenerator, getPromptVersions, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, renderMessage, renderPromptParams, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAnthropic, wrapClaudeAgentSDK, wrapGoogleGenAI, wrapMastraAgent, wrapOpenAI, wrapOpenAIv4, wrapTraced };
30867
+ export { type AnyDataset, Attachment, type AttachmentParams, AttachmentReference, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustMiddleware, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, ContextManager, type ContextParentSpanIds, type CreateProjectOpts, DEFAULT_FETCH_BATCH_SIZE, type DataSummary, Dataset, type DatasetRecord, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitDatasetOptions, type FullInitOptions, type FullLoginOptions, type FunctionEvent, IDGenerator, type IdField, type InitDatasetOptions, type InitLoggerOptions, type InitOptions, type InputField, type InvokeFunctionArgs, type InvokeReturn, JSONAttachment, LEGACY_CACHED_HEADER, LazyValue, type LoadPromptOptions, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, LoginInvalidOrgError, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, type ObjectMetadata, type OtherExperimentLogFields, type ParentExperimentIds, type ParentProjectLogIds, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, Reporter, type ReporterBody, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span, type SpanContext, SpanImpl, type StartSpanArgs, TestBackgroundLogger, ToolBuilder, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, buildLocalSummary, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, _exports as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getContextManager, getIdGenerator, getPromptVersions, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, renderMessage, renderPromptParams, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAnthropic, wrapClaudeAgentSDK, wrapGoogleGenAI, wrapMastraAgent, wrapOpenAI, wrapOpenAIv4, wrapTraced };