braintrust 1.1.1 → 2.0.0
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/dev/dist/index.d.mts +29 -6
- package/dev/dist/index.d.ts +29 -6
- package/dev/dist/index.js +66 -10
- package/dev/dist/index.mjs +66 -10
- package/dist/browser.d.mts +107 -18
- package/dist/browser.d.ts +107 -18
- package/dist/browser.js +201 -101
- package/dist/browser.mjs +138 -38
- package/dist/cli.js +74 -19
- package/dist/index.d.mts +107 -18
- package/dist/index.d.ts +107 -18
- package/dist/index.js +201 -101
- package/dist/index.mjs +138 -38
- package/package.json +8 -6
- package/util/dist/index.d.mts +10 -1
- package/util/dist/index.d.ts +10 -1
- package/util/dist/index.js +9 -1
- package/util/dist/index.mjs +8 -0
package/dev/dist/index.d.mts
CHANGED
|
@@ -1412,12 +1412,15 @@ declare const SavedFunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
1412
1412
|
}>, z.ZodObject<{
|
|
1413
1413
|
type: z.ZodLiteral<"global">;
|
|
1414
1414
|
name: z.ZodString;
|
|
1415
|
+
function_type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet"]>, z.ZodNull]>>;
|
|
1415
1416
|
}, "strip", z.ZodTypeAny, {
|
|
1416
1417
|
type: "global";
|
|
1417
1418
|
name: string;
|
|
1419
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
1418
1420
|
}, {
|
|
1419
1421
|
type: "global";
|
|
1420
1422
|
name: string;
|
|
1423
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
1421
1424
|
}>]>;
|
|
1422
1425
|
type SavedFunctionIdType = z.infer<typeof SavedFunctionId>;
|
|
1423
1426
|
declare const PromptBlockData: z.ZodUnion<[z.ZodObject<{
|
|
@@ -3668,14 +3671,17 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
3668
3671
|
}>, z.ZodObject<{
|
|
3669
3672
|
type: z.ZodLiteral<"global">;
|
|
3670
3673
|
name: z.ZodString;
|
|
3674
|
+
function_type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet"]>, z.ZodNull]>>;
|
|
3671
3675
|
config: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodNull]>>;
|
|
3672
3676
|
}, "strip", z.ZodTypeAny, {
|
|
3673
3677
|
type: "global";
|
|
3674
3678
|
name: string;
|
|
3679
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3675
3680
|
config?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
3676
3681
|
}, {
|
|
3677
3682
|
type: "global";
|
|
3678
3683
|
name: string;
|
|
3684
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3679
3685
|
config?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
3680
3686
|
}>, z.ZodObject<{
|
|
3681
3687
|
type: z.ZodLiteral<"facet">;
|
|
@@ -3691,12 +3697,15 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
3691
3697
|
}>, z.ZodObject<{
|
|
3692
3698
|
type: z.ZodLiteral<"global">;
|
|
3693
3699
|
name: z.ZodString;
|
|
3700
|
+
function_type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet"]>, z.ZodNull]>>;
|
|
3694
3701
|
}, "strip", z.ZodTypeAny, {
|
|
3695
3702
|
type: "global";
|
|
3696
3703
|
name: string;
|
|
3704
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3697
3705
|
}, {
|
|
3698
3706
|
type: "global";
|
|
3699
3707
|
name: string;
|
|
3708
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3700
3709
|
}>, z.ZodNull]>, z.ZodUnknown>>;
|
|
3701
3710
|
prompt: z.ZodString;
|
|
3702
3711
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -3711,6 +3720,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
3711
3720
|
} | {
|
|
3712
3721
|
type: "global";
|
|
3713
3722
|
name: string;
|
|
3723
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3714
3724
|
} | null | undefined;
|
|
3715
3725
|
no_match_pattern?: string | undefined;
|
|
3716
3726
|
}, {
|
|
@@ -3723,6 +3733,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
3723
3733
|
} | {
|
|
3724
3734
|
type: "global";
|
|
3725
3735
|
name: string;
|
|
3736
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3726
3737
|
} | null | undefined;
|
|
3727
3738
|
no_match_pattern?: string | undefined;
|
|
3728
3739
|
}>]>;
|
|
@@ -4949,12 +4960,15 @@ declare const PromptData: z.ZodObject<{
|
|
|
4949
4960
|
}>, z.ZodObject<{
|
|
4950
4961
|
type: z.ZodLiteral<"global">;
|
|
4951
4962
|
name: z.ZodString;
|
|
4963
|
+
function_type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet"]>, z.ZodNull]>>;
|
|
4952
4964
|
}, "strip", z.ZodTypeAny, {
|
|
4953
4965
|
type: "global";
|
|
4954
4966
|
name: string;
|
|
4967
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
4955
4968
|
}, {
|
|
4956
4969
|
type: "global";
|
|
4957
4970
|
name: string;
|
|
4971
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
4958
4972
|
}>]>, "many">, z.ZodNull]>>;
|
|
4959
4973
|
template_format: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["mustache", "nunjucks", "none"]>, z.ZodNull]>>;
|
|
4960
4974
|
mcp: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
@@ -5233,6 +5247,7 @@ declare const PromptData: z.ZodObject<{
|
|
|
5233
5247
|
} | {
|
|
5234
5248
|
type: "global";
|
|
5235
5249
|
name: string;
|
|
5250
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
5236
5251
|
})[] | null | undefined;
|
|
5237
5252
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
5238
5253
|
mcp?: Record<string, {
|
|
@@ -5478,6 +5493,7 @@ declare const PromptData: z.ZodObject<{
|
|
|
5478
5493
|
} | {
|
|
5479
5494
|
type: "global";
|
|
5480
5495
|
name: string;
|
|
5496
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
5481
5497
|
})[] | null | undefined;
|
|
5482
5498
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
5483
5499
|
mcp?: Record<string, {
|
|
@@ -6761,12 +6777,15 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
6761
6777
|
}>, z.ZodObject<{
|
|
6762
6778
|
type: z.ZodLiteral<"global">;
|
|
6763
6779
|
name: z.ZodString;
|
|
6780
|
+
function_type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet"]>, z.ZodNull]>>;
|
|
6764
6781
|
}, "strip", z.ZodTypeAny, {
|
|
6765
6782
|
type: "global";
|
|
6766
6783
|
name: string;
|
|
6784
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
6767
6785
|
}, {
|
|
6768
6786
|
type: "global";
|
|
6769
6787
|
name: string;
|
|
6788
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
6770
6789
|
}>]>, "many">, z.ZodNull]>>;
|
|
6771
6790
|
template_format: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["mustache", "nunjucks", "none"]>, z.ZodNull]>>;
|
|
6772
6791
|
mcp: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
@@ -7045,6 +7064,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7045
7064
|
} | {
|
|
7046
7065
|
type: "global";
|
|
7047
7066
|
name: string;
|
|
7067
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7048
7068
|
})[] | null | undefined;
|
|
7049
7069
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
7050
7070
|
mcp?: Record<string, {
|
|
@@ -7290,6 +7310,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7290
7310
|
} | {
|
|
7291
7311
|
type: "global";
|
|
7292
7312
|
name: string;
|
|
7313
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7293
7314
|
})[] | null | undefined;
|
|
7294
7315
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
7295
7316
|
mcp?: Record<string, {
|
|
@@ -7319,6 +7340,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7319
7340
|
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
7320
7341
|
description?: string | null | undefined;
|
|
7321
7342
|
tags?: string[] | null | undefined;
|
|
7343
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7322
7344
|
prompt_data?: {
|
|
7323
7345
|
options?: {
|
|
7324
7346
|
params?: z.objectOutputType<{
|
|
@@ -7551,6 +7573,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7551
7573
|
} | {
|
|
7552
7574
|
type: "global";
|
|
7553
7575
|
name: string;
|
|
7576
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7554
7577
|
})[] | null | undefined;
|
|
7555
7578
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
7556
7579
|
mcp?: Record<string, {
|
|
@@ -7565,7 +7588,6 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7565
7588
|
enabled_tools?: string[] | null | undefined;
|
|
7566
7589
|
}> | null | undefined;
|
|
7567
7590
|
} | null | undefined;
|
|
7568
|
-
function_type?: "tool" | "task" | "scorer" | "llm" | "facet" | "preprocessor" | "custom_view" | null | undefined;
|
|
7569
7591
|
}, {
|
|
7570
7592
|
id: string;
|
|
7571
7593
|
org_id: string;
|
|
@@ -7578,6 +7600,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7578
7600
|
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
7579
7601
|
description?: string | null | undefined;
|
|
7580
7602
|
tags?: string[] | null | undefined;
|
|
7603
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7581
7604
|
prompt_data?: {
|
|
7582
7605
|
options?: {
|
|
7583
7606
|
params?: z.objectInputType<{
|
|
@@ -7810,6 +7833,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7810
7833
|
} | {
|
|
7811
7834
|
type: "global";
|
|
7812
7835
|
name: string;
|
|
7836
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7813
7837
|
})[] | null | undefined;
|
|
7814
7838
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
7815
7839
|
mcp?: Record<string, {
|
|
@@ -7824,7 +7848,6 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7824
7848
|
enabled_tools?: string[] | null | undefined;
|
|
7825
7849
|
}> | null | undefined;
|
|
7826
7850
|
} | null | undefined;
|
|
7827
|
-
function_type?: "tool" | "task" | "scorer" | "llm" | "facet" | "preprocessor" | "custom_view" | null | undefined;
|
|
7828
7851
|
}>;
|
|
7829
7852
|
type PromptType = z.infer<typeof Prompt$1>;
|
|
7830
7853
|
declare const PromptSessionEvent: z.ZodObject<{
|
|
@@ -7849,9 +7872,9 @@ declare const PromptSessionEvent: z.ZodObject<{
|
|
|
7849
7872
|
prompt_session_id: string;
|
|
7850
7873
|
_pagination_key?: string | null | undefined;
|
|
7851
7874
|
tags?: string[] | null | undefined;
|
|
7875
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7852
7876
|
completion?: unknown;
|
|
7853
7877
|
prompt_data?: unknown;
|
|
7854
|
-
function_type?: "tool" | "task" | "scorer" | "llm" | "facet" | "preprocessor" | "custom_view" | null | undefined;
|
|
7855
7878
|
function_data?: unknown;
|
|
7856
7879
|
prompt_session_data?: unknown;
|
|
7857
7880
|
object_data?: unknown;
|
|
@@ -7863,9 +7886,9 @@ declare const PromptSessionEvent: z.ZodObject<{
|
|
|
7863
7886
|
prompt_session_id: string;
|
|
7864
7887
|
_pagination_key?: string | null | undefined;
|
|
7865
7888
|
tags?: string[] | null | undefined;
|
|
7889
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7866
7890
|
completion?: unknown;
|
|
7867
7891
|
prompt_data?: unknown;
|
|
7868
|
-
function_type?: "tool" | "task" | "scorer" | "llm" | "facet" | "preprocessor" | "custom_view" | null | undefined;
|
|
7869
7892
|
function_data?: unknown;
|
|
7870
7893
|
prompt_session_data?: unknown;
|
|
7871
7894
|
object_data?: unknown;
|
|
@@ -7900,7 +7923,7 @@ declare const SSEProgressEventData: z.ZodObject<{
|
|
|
7900
7923
|
data: z.ZodString;
|
|
7901
7924
|
}, "strip", z.ZodTypeAny, {
|
|
7902
7925
|
id: string;
|
|
7903
|
-
object_type: "prompt" | "tool" | "task" | "scorer" | "
|
|
7926
|
+
object_type: "prompt" | "tool" | "task" | "scorer" | "custom_view" | "preprocessor" | "facet" | "agent";
|
|
7904
7927
|
name: string;
|
|
7905
7928
|
data: string;
|
|
7906
7929
|
event: "done" | "error" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console" | "start";
|
|
@@ -7915,7 +7938,7 @@ declare const SSEProgressEventData: z.ZodObject<{
|
|
|
7915
7938
|
} | null | undefined;
|
|
7916
7939
|
}, {
|
|
7917
7940
|
id: string;
|
|
7918
|
-
object_type: "prompt" | "tool" | "task" | "scorer" | "
|
|
7941
|
+
object_type: "prompt" | "tool" | "task" | "scorer" | "custom_view" | "preprocessor" | "facet" | "agent";
|
|
7919
7942
|
name: string;
|
|
7920
7943
|
data: string;
|
|
7921
7944
|
event: "done" | "error" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console" | "start";
|
package/dev/dist/index.d.ts
CHANGED
|
@@ -1412,12 +1412,15 @@ declare const SavedFunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
1412
1412
|
}>, z.ZodObject<{
|
|
1413
1413
|
type: z.ZodLiteral<"global">;
|
|
1414
1414
|
name: z.ZodString;
|
|
1415
|
+
function_type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet"]>, z.ZodNull]>>;
|
|
1415
1416
|
}, "strip", z.ZodTypeAny, {
|
|
1416
1417
|
type: "global";
|
|
1417
1418
|
name: string;
|
|
1419
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
1418
1420
|
}, {
|
|
1419
1421
|
type: "global";
|
|
1420
1422
|
name: string;
|
|
1423
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
1421
1424
|
}>]>;
|
|
1422
1425
|
type SavedFunctionIdType = z.infer<typeof SavedFunctionId>;
|
|
1423
1426
|
declare const PromptBlockData: z.ZodUnion<[z.ZodObject<{
|
|
@@ -3668,14 +3671,17 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
3668
3671
|
}>, z.ZodObject<{
|
|
3669
3672
|
type: z.ZodLiteral<"global">;
|
|
3670
3673
|
name: z.ZodString;
|
|
3674
|
+
function_type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet"]>, z.ZodNull]>>;
|
|
3671
3675
|
config: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodNull]>>;
|
|
3672
3676
|
}, "strip", z.ZodTypeAny, {
|
|
3673
3677
|
type: "global";
|
|
3674
3678
|
name: string;
|
|
3679
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3675
3680
|
config?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
3676
3681
|
}, {
|
|
3677
3682
|
type: "global";
|
|
3678
3683
|
name: string;
|
|
3684
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3679
3685
|
config?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
3680
3686
|
}>, z.ZodObject<{
|
|
3681
3687
|
type: z.ZodLiteral<"facet">;
|
|
@@ -3691,12 +3697,15 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
3691
3697
|
}>, z.ZodObject<{
|
|
3692
3698
|
type: z.ZodLiteral<"global">;
|
|
3693
3699
|
name: z.ZodString;
|
|
3700
|
+
function_type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet"]>, z.ZodNull]>>;
|
|
3694
3701
|
}, "strip", z.ZodTypeAny, {
|
|
3695
3702
|
type: "global";
|
|
3696
3703
|
name: string;
|
|
3704
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3697
3705
|
}, {
|
|
3698
3706
|
type: "global";
|
|
3699
3707
|
name: string;
|
|
3708
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3700
3709
|
}>, z.ZodNull]>, z.ZodUnknown>>;
|
|
3701
3710
|
prompt: z.ZodString;
|
|
3702
3711
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -3711,6 +3720,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
3711
3720
|
} | {
|
|
3712
3721
|
type: "global";
|
|
3713
3722
|
name: string;
|
|
3723
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3714
3724
|
} | null | undefined;
|
|
3715
3725
|
no_match_pattern?: string | undefined;
|
|
3716
3726
|
}, {
|
|
@@ -3723,6 +3733,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
3723
3733
|
} | {
|
|
3724
3734
|
type: "global";
|
|
3725
3735
|
name: string;
|
|
3736
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
3726
3737
|
} | null | undefined;
|
|
3727
3738
|
no_match_pattern?: string | undefined;
|
|
3728
3739
|
}>]>;
|
|
@@ -4949,12 +4960,15 @@ declare const PromptData: z.ZodObject<{
|
|
|
4949
4960
|
}>, z.ZodObject<{
|
|
4950
4961
|
type: z.ZodLiteral<"global">;
|
|
4951
4962
|
name: z.ZodString;
|
|
4963
|
+
function_type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet"]>, z.ZodNull]>>;
|
|
4952
4964
|
}, "strip", z.ZodTypeAny, {
|
|
4953
4965
|
type: "global";
|
|
4954
4966
|
name: string;
|
|
4967
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
4955
4968
|
}, {
|
|
4956
4969
|
type: "global";
|
|
4957
4970
|
name: string;
|
|
4971
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
4958
4972
|
}>]>, "many">, z.ZodNull]>>;
|
|
4959
4973
|
template_format: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["mustache", "nunjucks", "none"]>, z.ZodNull]>>;
|
|
4960
4974
|
mcp: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
@@ -5233,6 +5247,7 @@ declare const PromptData: z.ZodObject<{
|
|
|
5233
5247
|
} | {
|
|
5234
5248
|
type: "global";
|
|
5235
5249
|
name: string;
|
|
5250
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
5236
5251
|
})[] | null | undefined;
|
|
5237
5252
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
5238
5253
|
mcp?: Record<string, {
|
|
@@ -5478,6 +5493,7 @@ declare const PromptData: z.ZodObject<{
|
|
|
5478
5493
|
} | {
|
|
5479
5494
|
type: "global";
|
|
5480
5495
|
name: string;
|
|
5496
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
5481
5497
|
})[] | null | undefined;
|
|
5482
5498
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
5483
5499
|
mcp?: Record<string, {
|
|
@@ -6761,12 +6777,15 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
6761
6777
|
}>, z.ZodObject<{
|
|
6762
6778
|
type: z.ZodLiteral<"global">;
|
|
6763
6779
|
name: z.ZodString;
|
|
6780
|
+
function_type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet"]>, z.ZodNull]>>;
|
|
6764
6781
|
}, "strip", z.ZodTypeAny, {
|
|
6765
6782
|
type: "global";
|
|
6766
6783
|
name: string;
|
|
6784
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
6767
6785
|
}, {
|
|
6768
6786
|
type: "global";
|
|
6769
6787
|
name: string;
|
|
6788
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
6770
6789
|
}>]>, "many">, z.ZodNull]>>;
|
|
6771
6790
|
template_format: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["mustache", "nunjucks", "none"]>, z.ZodNull]>>;
|
|
6772
6791
|
mcp: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
@@ -7045,6 +7064,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7045
7064
|
} | {
|
|
7046
7065
|
type: "global";
|
|
7047
7066
|
name: string;
|
|
7067
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7048
7068
|
})[] | null | undefined;
|
|
7049
7069
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
7050
7070
|
mcp?: Record<string, {
|
|
@@ -7290,6 +7310,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7290
7310
|
} | {
|
|
7291
7311
|
type: "global";
|
|
7292
7312
|
name: string;
|
|
7313
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7293
7314
|
})[] | null | undefined;
|
|
7294
7315
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
7295
7316
|
mcp?: Record<string, {
|
|
@@ -7319,6 +7340,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7319
7340
|
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
7320
7341
|
description?: string | null | undefined;
|
|
7321
7342
|
tags?: string[] | null | undefined;
|
|
7343
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7322
7344
|
prompt_data?: {
|
|
7323
7345
|
options?: {
|
|
7324
7346
|
params?: z.objectOutputType<{
|
|
@@ -7551,6 +7573,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7551
7573
|
} | {
|
|
7552
7574
|
type: "global";
|
|
7553
7575
|
name: string;
|
|
7576
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7554
7577
|
})[] | null | undefined;
|
|
7555
7578
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
7556
7579
|
mcp?: Record<string, {
|
|
@@ -7565,7 +7588,6 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7565
7588
|
enabled_tools?: string[] | null | undefined;
|
|
7566
7589
|
}> | null | undefined;
|
|
7567
7590
|
} | null | undefined;
|
|
7568
|
-
function_type?: "tool" | "task" | "scorer" | "llm" | "facet" | "preprocessor" | "custom_view" | null | undefined;
|
|
7569
7591
|
}, {
|
|
7570
7592
|
id: string;
|
|
7571
7593
|
org_id: string;
|
|
@@ -7578,6 +7600,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7578
7600
|
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
7579
7601
|
description?: string | null | undefined;
|
|
7580
7602
|
tags?: string[] | null | undefined;
|
|
7603
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7581
7604
|
prompt_data?: {
|
|
7582
7605
|
options?: {
|
|
7583
7606
|
params?: z.objectInputType<{
|
|
@@ -7810,6 +7833,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7810
7833
|
} | {
|
|
7811
7834
|
type: "global";
|
|
7812
7835
|
name: string;
|
|
7836
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7813
7837
|
})[] | null | undefined;
|
|
7814
7838
|
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
7815
7839
|
mcp?: Record<string, {
|
|
@@ -7824,7 +7848,6 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
7824
7848
|
enabled_tools?: string[] | null | undefined;
|
|
7825
7849
|
}> | null | undefined;
|
|
7826
7850
|
} | null | undefined;
|
|
7827
|
-
function_type?: "tool" | "task" | "scorer" | "llm" | "facet" | "preprocessor" | "custom_view" | null | undefined;
|
|
7828
7851
|
}>;
|
|
7829
7852
|
type PromptType = z.infer<typeof Prompt$1>;
|
|
7830
7853
|
declare const PromptSessionEvent: z.ZodObject<{
|
|
@@ -7849,9 +7872,9 @@ declare const PromptSessionEvent: z.ZodObject<{
|
|
|
7849
7872
|
prompt_session_id: string;
|
|
7850
7873
|
_pagination_key?: string | null | undefined;
|
|
7851
7874
|
tags?: string[] | null | undefined;
|
|
7875
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7852
7876
|
completion?: unknown;
|
|
7853
7877
|
prompt_data?: unknown;
|
|
7854
|
-
function_type?: "tool" | "task" | "scorer" | "llm" | "facet" | "preprocessor" | "custom_view" | null | undefined;
|
|
7855
7878
|
function_data?: unknown;
|
|
7856
7879
|
prompt_session_data?: unknown;
|
|
7857
7880
|
object_data?: unknown;
|
|
@@ -7863,9 +7886,9 @@ declare const PromptSessionEvent: z.ZodObject<{
|
|
|
7863
7886
|
prompt_session_id: string;
|
|
7864
7887
|
_pagination_key?: string | null | undefined;
|
|
7865
7888
|
tags?: string[] | null | undefined;
|
|
7889
|
+
function_type?: "tool" | "task" | "scorer" | "llm" | "custom_view" | "preprocessor" | "facet" | null | undefined;
|
|
7866
7890
|
completion?: unknown;
|
|
7867
7891
|
prompt_data?: unknown;
|
|
7868
|
-
function_type?: "tool" | "task" | "scorer" | "llm" | "facet" | "preprocessor" | "custom_view" | null | undefined;
|
|
7869
7892
|
function_data?: unknown;
|
|
7870
7893
|
prompt_session_data?: unknown;
|
|
7871
7894
|
object_data?: unknown;
|
|
@@ -7900,7 +7923,7 @@ declare const SSEProgressEventData: z.ZodObject<{
|
|
|
7900
7923
|
data: z.ZodString;
|
|
7901
7924
|
}, "strip", z.ZodTypeAny, {
|
|
7902
7925
|
id: string;
|
|
7903
|
-
object_type: "prompt" | "tool" | "task" | "scorer" | "
|
|
7926
|
+
object_type: "prompt" | "tool" | "task" | "scorer" | "custom_view" | "preprocessor" | "facet" | "agent";
|
|
7904
7927
|
name: string;
|
|
7905
7928
|
data: string;
|
|
7906
7929
|
event: "done" | "error" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console" | "start";
|
|
@@ -7915,7 +7938,7 @@ declare const SSEProgressEventData: z.ZodObject<{
|
|
|
7915
7938
|
} | null | undefined;
|
|
7916
7939
|
}, {
|
|
7917
7940
|
id: string;
|
|
7918
|
-
object_type: "prompt" | "tool" | "task" | "scorer" | "
|
|
7941
|
+
object_type: "prompt" | "tool" | "task" | "scorer" | "custom_view" | "preprocessor" | "facet" | "agent";
|
|
7919
7942
|
name: string;
|
|
7920
7943
|
data: string;
|
|
7921
7944
|
event: "done" | "error" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console" | "start";
|
package/dev/dist/index.js
CHANGED
|
@@ -1589,6 +1589,13 @@ function parseParent(parent) {
|
|
|
1589
1589
|
propagated_event: parent.propagated_event
|
|
1590
1590
|
}).toStr() : void 0;
|
|
1591
1591
|
}
|
|
1592
|
+
function makeScorerPropagatedEvent(parent) {
|
|
1593
|
+
const parentPropagatedEvent = parent ? _nullishCoalesce(SpanComponentsV4.fromStr(parent).data.propagated_event, () => ( {})) : {};
|
|
1594
|
+
return mergeDicts(
|
|
1595
|
+
{ ...parentPropagatedEvent },
|
|
1596
|
+
{ span_attributes: { purpose: "scorer" } }
|
|
1597
|
+
);
|
|
1598
|
+
}
|
|
1592
1599
|
|
|
1593
1600
|
// util/git_fields.ts
|
|
1594
1601
|
function mergeGitMetadataSettings(s1, s2) {
|
|
@@ -2091,9 +2098,25 @@ var ExperimentEvent = _v3.z.object({
|
|
|
2091
2098
|
comments: _v3.z.union([_v3.z.array(_v3.z.unknown()), _v3.z.null()]).optional(),
|
|
2092
2099
|
audit_data: _v3.z.union([_v3.z.array(_v3.z.unknown()), _v3.z.null()]).optional()
|
|
2093
2100
|
});
|
|
2101
|
+
var NullableFunctionTypeEnum = _v3.z.union([
|
|
2102
|
+
_v3.z.enum([
|
|
2103
|
+
"llm",
|
|
2104
|
+
"scorer",
|
|
2105
|
+
"task",
|
|
2106
|
+
"tool",
|
|
2107
|
+
"custom_view",
|
|
2108
|
+
"preprocessor",
|
|
2109
|
+
"facet"
|
|
2110
|
+
]),
|
|
2111
|
+
_v3.z.null()
|
|
2112
|
+
]);
|
|
2094
2113
|
var ExtendedSavedFunctionId = _v3.z.union([
|
|
2095
2114
|
_v3.z.object({ type: _v3.z.literal("function"), id: _v3.z.string() }),
|
|
2096
|
-
_v3.z.object({
|
|
2115
|
+
_v3.z.object({
|
|
2116
|
+
type: _v3.z.literal("global"),
|
|
2117
|
+
name: _v3.z.string(),
|
|
2118
|
+
function_type: NullableFunctionTypeEnum.optional()
|
|
2119
|
+
}),
|
|
2097
2120
|
_v3.z.object({
|
|
2098
2121
|
type: _v3.z.literal("slug"),
|
|
2099
2122
|
project_id: _v3.z.string(),
|
|
@@ -2102,7 +2125,11 @@ var ExtendedSavedFunctionId = _v3.z.union([
|
|
|
2102
2125
|
]);
|
|
2103
2126
|
var NullableSavedFunctionId = _v3.z.union([
|
|
2104
2127
|
_v3.z.object({ type: _v3.z.literal("function"), id: _v3.z.string() }),
|
|
2105
|
-
_v3.z.object({
|
|
2128
|
+
_v3.z.object({
|
|
2129
|
+
type: _v3.z.literal("global"),
|
|
2130
|
+
name: _v3.z.string(),
|
|
2131
|
+
function_type: NullableFunctionTypeEnum.optional()
|
|
2132
|
+
}),
|
|
2106
2133
|
_v3.z.null()
|
|
2107
2134
|
]);
|
|
2108
2135
|
var FacetData = _v3.z.object({
|
|
@@ -2199,7 +2226,11 @@ var PromptParserNullish = _v3.z.union([
|
|
|
2199
2226
|
]);
|
|
2200
2227
|
var SavedFunctionId = _v3.z.union([
|
|
2201
2228
|
_v3.z.object({ type: _v3.z.literal("function"), id: _v3.z.string() }),
|
|
2202
|
-
_v3.z.object({
|
|
2229
|
+
_v3.z.object({
|
|
2230
|
+
type: _v3.z.literal("global"),
|
|
2231
|
+
name: _v3.z.string(),
|
|
2232
|
+
function_type: NullableFunctionTypeEnum.optional()
|
|
2233
|
+
})
|
|
2203
2234
|
]);
|
|
2204
2235
|
var PromptDataNullish = _v3.z.union([
|
|
2205
2236
|
_v3.z.object({
|
|
@@ -2346,6 +2377,7 @@ var FunctionData = _v3.z.union([
|
|
|
2346
2377
|
_v3.z.object({
|
|
2347
2378
|
type: _v3.z.literal("global"),
|
|
2348
2379
|
name: _v3.z.string(),
|
|
2380
|
+
function_type: NullableFunctionTypeEnum.optional(),
|
|
2349
2381
|
config: _v3.z.union([_v3.z.object({}).partial().passthrough(), _v3.z.null()]).optional()
|
|
2350
2382
|
}),
|
|
2351
2383
|
FacetData
|
|
@@ -2432,7 +2464,10 @@ var FunctionId = _v3.z.union([
|
|
|
2432
2464
|
slug: _v3.z.string(),
|
|
2433
2465
|
version: _v3.z.string().optional()
|
|
2434
2466
|
}),
|
|
2435
|
-
_v3.z.object({
|
|
2467
|
+
_v3.z.object({
|
|
2468
|
+
global_function: _v3.z.string(),
|
|
2469
|
+
function_type: NullableFunctionTypeEnum.optional()
|
|
2470
|
+
}),
|
|
2436
2471
|
_v3.z.object({
|
|
2437
2472
|
prompt_session_id: _v3.z.string(),
|
|
2438
2473
|
prompt_session_function_id: _v3.z.string(),
|
|
@@ -2643,6 +2678,7 @@ var Project = _v3.z.object({
|
|
|
2643
2678
|
id: _v3.z.string().uuid(),
|
|
2644
2679
|
org_id: _v3.z.string().uuid(),
|
|
2645
2680
|
name: _v3.z.string(),
|
|
2681
|
+
description: _v3.z.union([_v3.z.string(), _v3.z.null()]).optional(),
|
|
2646
2682
|
created: _v3.z.union([_v3.z.string(), _v3.z.null()]).optional(),
|
|
2647
2683
|
deleted_at: _v3.z.union([_v3.z.string(), _v3.z.null()]).optional(),
|
|
2648
2684
|
user_id: _v3.z.union([_v3.z.string(), _v3.z.null()]).optional(),
|
|
@@ -9458,8 +9494,12 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
|
|
|
9458
9494
|
const results = await rootSpan.traced(runScorer, {
|
|
9459
9495
|
name: scorerNames[score_idx],
|
|
9460
9496
|
spanAttributes: {
|
|
9461
|
-
type: "score" /* SCORE
|
|
9497
|
+
type: "score" /* SCORE */,
|
|
9498
|
+
purpose: "scorer"
|
|
9462
9499
|
},
|
|
9500
|
+
propagatedEvent: makeScorerPropagatedEvent(
|
|
9501
|
+
await rootSpan.export()
|
|
9502
|
+
),
|
|
9463
9503
|
event: { input: scoringArgs }
|
|
9464
9504
|
});
|
|
9465
9505
|
return { kind: "score", value: results };
|
|
@@ -10017,7 +10057,23 @@ var evaluatorDefinitionsSchema = _v3.z.record(
|
|
|
10017
10057
|
|
|
10018
10058
|
// dev/server.ts
|
|
10019
10059
|
|
|
10020
|
-
|
|
10060
|
+
|
|
10061
|
+
// src/zod/utils.ts
|
|
10062
|
+
var _zodtojsonschema = require('zod-to-json-schema');
|
|
10063
|
+
var _v4 = require('zod/v4'); var z42 = _interopRequireWildcard(_v4);
|
|
10064
|
+
function isZodV4(zodObject) {
|
|
10065
|
+
return typeof zodObject === "object" && zodObject !== null && "_zod" in zodObject && zodObject._zod !== void 0;
|
|
10066
|
+
}
|
|
10067
|
+
function zodToJsonSchema(schema) {
|
|
10068
|
+
if (isZodV4(schema)) {
|
|
10069
|
+
return z42.toJSONSchema(schema, {
|
|
10070
|
+
target: "draft-7"
|
|
10071
|
+
});
|
|
10072
|
+
}
|
|
10073
|
+
return _zodtojsonschema.zodToJsonSchema.call(void 0, schema);
|
|
10074
|
+
}
|
|
10075
|
+
|
|
10076
|
+
// dev/server.ts
|
|
10021
10077
|
function runDevServer(evaluators, opts) {
|
|
10022
10078
|
const allEvaluators = Object.fromEntries(
|
|
10023
10079
|
evaluators.map((evaluator) => [evaluator.evalName, evaluator])
|
|
@@ -10307,14 +10363,14 @@ function makeEvalParametersSchema(parameters) {
|
|
|
10307
10363
|
}
|
|
10308
10364
|
];
|
|
10309
10365
|
} else {
|
|
10310
|
-
const
|
|
10366
|
+
const schemaObj = zodToJsonSchema(value);
|
|
10311
10367
|
return [
|
|
10312
10368
|
name,
|
|
10313
10369
|
{
|
|
10314
10370
|
type: "data",
|
|
10315
|
-
schema,
|
|
10316
|
-
default:
|
|
10317
|
-
description:
|
|
10371
|
+
schema: schemaObj,
|
|
10372
|
+
default: schemaObj.default,
|
|
10373
|
+
description: schemaObj.description
|
|
10318
10374
|
}
|
|
10319
10375
|
];
|
|
10320
10376
|
}
|