braintrust 3.20.0 → 3.21.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/NOTICE +20 -0
- package/README.md +2 -0
- package/dev/dist/index.d.mts +309 -199
- package/dev/dist/index.d.ts +309 -199
- package/dev/dist/index.js +2826 -983
- package/dev/dist/index.mjs +2286 -443
- package/dist/apply-auto-instrumentation.js +781 -199
- package/dist/apply-auto-instrumentation.mjs +588 -6
- package/dist/auto-instrumentations/bundler/esbuild.cjs +594 -2
- package/dist/auto-instrumentations/bundler/esbuild.d.mts +2 -2
- package/dist/auto-instrumentations/bundler/esbuild.d.ts +2 -2
- package/dist/auto-instrumentations/bundler/esbuild.mjs +3 -3
- package/dist/auto-instrumentations/bundler/next.cjs +594 -2
- package/dist/auto-instrumentations/bundler/next.mjs +4 -4
- package/dist/auto-instrumentations/bundler/rollup.cjs +594 -2
- package/dist/auto-instrumentations/bundler/rollup.d.mts +2 -2
- package/dist/auto-instrumentations/bundler/rollup.d.ts +2 -2
- package/dist/auto-instrumentations/bundler/rollup.mjs +3 -3
- package/dist/auto-instrumentations/bundler/vite.cjs +594 -2
- package/dist/auto-instrumentations/bundler/vite.d.mts +2 -2
- package/dist/auto-instrumentations/bundler/vite.d.ts +2 -2
- package/dist/auto-instrumentations/bundler/vite.mjs +3 -3
- package/dist/auto-instrumentations/bundler/webpack-loader.cjs +593 -9
- package/dist/auto-instrumentations/bundler/webpack-loader.d.ts +68 -1
- package/dist/auto-instrumentations/bundler/webpack.cjs +594 -2
- package/dist/auto-instrumentations/bundler/webpack.d.mts +2 -2
- package/dist/auto-instrumentations/bundler/webpack.d.ts +2 -2
- package/dist/auto-instrumentations/bundler/webpack.mjs +4 -4
- package/dist/auto-instrumentations/{chunk-W4E36GIW.mjs → chunk-BRQX23KL.mjs} +16 -0
- package/dist/auto-instrumentations/chunk-M6DLIJ2Z.mjs +784 -0
- package/dist/auto-instrumentations/{chunk-K74TZGGM.mjs → chunk-T6J4C7LX.mjs} +1 -1
- package/dist/auto-instrumentations/{chunk-S4374IP6.mjs → chunk-TKRPRPGD.mjs} +4 -6
- package/dist/auto-instrumentations/chunk-VT6DDNKM.mjs +856 -0
- package/dist/auto-instrumentations/hook.mjs +749 -45
- package/dist/auto-instrumentations/index.cjs +16 -0
- package/dist/auto-instrumentations/index.d.mts +2 -3
- package/dist/auto-instrumentations/index.d.ts +2 -3
- package/dist/auto-instrumentations/index.mjs +1 -1
- package/dist/auto-instrumentations/loader/cjs-patch.cjs +578 -4
- package/dist/auto-instrumentations/loader/cjs-patch.d.mts +1 -1
- package/dist/auto-instrumentations/loader/cjs-patch.d.ts +1 -1
- package/dist/auto-instrumentations/loader/cjs-patch.mjs +3 -7
- package/dist/auto-instrumentations/loader/esm-hook.mjs +2 -6
- package/dist/auto-instrumentations/{plugin-D7nDswtC.d.mts → plugin-D0KHwSJv.d.mts} +1 -1
- package/dist/auto-instrumentations/{plugin-D7nDswtC.d.ts → plugin-G6fgxk1b.d.ts} +1 -1
- package/dist/auto-instrumentations/types-RNPaKi9o.d.mts +70 -0
- package/dist/auto-instrumentations/types-RNPaKi9o.d.ts +70 -0
- package/dist/browser.d.mts +1357 -847
- package/dist/browser.d.ts +1357 -847
- package/dist/browser.js +2726 -469
- package/dist/browser.mjs +2726 -469
- package/dist/{chunk-LPC4W2WX.js → chunk-BFGIH2ZJ.js} +4 -0
- package/dist/{chunk-POCCIJAL.js → chunk-FY7DAKA5.js} +3141 -1269
- package/dist/{chunk-Y7W7WP6H.mjs → chunk-KMGUTPB7.mjs} +4 -0
- package/dist/{chunk-F73OMF66.mjs → chunk-O2P765XK.mjs} +2391 -519
- package/dist/cli.js +2260 -408
- package/dist/edge-light.d.mts +1 -1
- package/dist/edge-light.d.ts +1 -1
- package/dist/edge-light.js +2726 -469
- package/dist/edge-light.mjs +2726 -469
- package/dist/index.d.mts +1837 -1327
- package/dist/index.d.ts +1837 -1327
- package/dist/index.js +752 -353
- package/dist/index.mjs +445 -46
- package/dist/instrumentation/index.d.mts +107 -19
- package/dist/instrumentation/index.d.ts +107 -19
- package/dist/instrumentation/index.js +2337 -509
- package/dist/instrumentation/index.mjs +2337 -509
- package/dist/vitest-evals-reporter.js +16 -16
- package/dist/vitest-evals-reporter.mjs +2 -2
- package/dist/workerd.d.mts +1 -1
- package/dist/workerd.d.ts +1 -1
- package/dist/workerd.js +2726 -469
- package/dist/workerd.mjs +2726 -469
- package/licenses/import-in-the-middle/LICENSE +201 -0
- package/licenses/import-in-the-middle/LICENSE-3rdparty.csv +4 -0
- package/licenses/import-in-the-middle/NOTICE +34 -0
- package/licenses/orchestrion-js/LICENSE +202 -0
- package/licenses/orchestrion-js/LICENSE-3rdparty.csv +8 -0
- package/licenses/orchestrion-js/NOTICE +3 -0
- package/licenses/require-in-the-middle/LICENSE +23 -0
- package/package.json +13 -4
- package/util/dist/index.d.mts +1 -0
- package/util/dist/index.d.ts +1 -0
- package/util/dist/index.js +4 -4
- package/util/dist/index.mjs +2 -2
- package/dist/auto-instrumentations/chunk-J57YF7WS.mjs +0 -208
- package/dist/auto-instrumentations/chunk-QFMACSOL.mjs +0 -280
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,578 @@
|
|
|
1
1
|
import { z } from 'zod/v3';
|
|
2
2
|
|
|
3
|
+
type DebugLogLevel = "error" | "warn" | "info" | "debug";
|
|
4
|
+
type DebugLogLevelOption = DebugLogLevel | false | undefined;
|
|
5
|
+
declare function resetDebugLoggerForTests(): void;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Abstract base class for ID generators
|
|
9
|
+
*/
|
|
10
|
+
declare abstract class IDGenerator {
|
|
11
|
+
/**
|
|
12
|
+
* Generate a span ID
|
|
13
|
+
*/
|
|
14
|
+
abstract getSpanId(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Generate a trace ID
|
|
17
|
+
*/
|
|
18
|
+
abstract getTraceId(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Return true if the generator should use span_id as root_span_id for backwards compatibility
|
|
21
|
+
*/
|
|
22
|
+
abstract shareRootSpanId(): boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ID generator that uses UUID4 for both span and trace IDs
|
|
26
|
+
*/
|
|
27
|
+
declare class UUIDGenerator extends IDGenerator {
|
|
28
|
+
getSpanId(): string;
|
|
29
|
+
getTraceId(): string;
|
|
30
|
+
shareRootSpanId(): boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* ID generator that produces OpenTelemetry-compatible hex IDs.
|
|
34
|
+
*
|
|
35
|
+
* Span IDs are 8 random bytes (16 hex chars) and trace IDs are 16 random bytes
|
|
36
|
+
* (32 hex chars), matching the W3C Trace Context / OpenTelemetry shape. Trace
|
|
37
|
+
* ids are distinct from span ids (root_span_id is a separate trace id, not the
|
|
38
|
+
* root span's id), so `shareRootSpanId()` returns false.
|
|
39
|
+
*/
|
|
40
|
+
declare class OTELIDGenerator extends IDGenerator {
|
|
41
|
+
getSpanId(): string;
|
|
42
|
+
getTraceId(): string;
|
|
43
|
+
shareRootSpanId(): boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Factory function that creates a new ID generator instance each time.
|
|
47
|
+
*
|
|
48
|
+
* This eliminates global state and makes tests parallelizable.
|
|
49
|
+
* Each caller gets their own generator instance.
|
|
50
|
+
*
|
|
51
|
+
* Honors an explicitly-installed `globalThis.BRAINTRUST_ID_GENERATOR` (e.g. set
|
|
52
|
+
* by `@braintrust/otel`'s `setupOtelCompat()`). Otherwise it defaults to
|
|
53
|
+
* OpenTelemetry-compatible hex IDs, falling back to legacy UUID IDs when
|
|
54
|
+
* BRAINTRUST_LEGACY_IDS is set.
|
|
55
|
+
*/
|
|
56
|
+
declare function getIdGenerator(): IDGenerator;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Native W3C Trace Context propagation for Braintrust.
|
|
60
|
+
*
|
|
61
|
+
* This module implements the propagation wire format described in the Braintrust
|
|
62
|
+
* distributed-tracing spec, in pure TypeScript with no dependency on
|
|
63
|
+
* `@opentelemetry/api`. It parses and serializes the W3C `traceparent` and
|
|
64
|
+
* `baggage` headers and the Braintrust `braintrust.parent` baggage entry.
|
|
65
|
+
*
|
|
66
|
+
* Trace identity (trace id + parent span id) is carried in `traceparent`; the
|
|
67
|
+
* Braintrust container the trace belongs to (project/experiment) is carried in
|
|
68
|
+
* `baggage` under the `braintrust.parent` key.
|
|
69
|
+
*/
|
|
70
|
+
declare const TRACEPARENT_HEADER = "traceparent";
|
|
71
|
+
declare const TRACESTATE_HEADER = "tracestate";
|
|
72
|
+
declare const BAGGAGE_HEADER = "baggage";
|
|
73
|
+
declare const BRAINTRUST_PARENT_KEY = "braintrust.parent";
|
|
74
|
+
/**
|
|
75
|
+
* Parsed W3C `traceparent` fields.
|
|
76
|
+
*
|
|
77
|
+
* `traceFlags` is the raw 2-hex trace-flags byte (e.g. `"01"` sampled, `"00"`
|
|
78
|
+
* not sampled), kept raw so any future flag bits survive a parse -> format
|
|
79
|
+
* round trip without per-bit handling.
|
|
80
|
+
*/
|
|
81
|
+
interface ParsedTraceparent {
|
|
82
|
+
traceId: string;
|
|
83
|
+
spanId: string;
|
|
84
|
+
traceFlags: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Inbound W3C trace-context state that Braintrust forwards but never interprets.
|
|
88
|
+
*
|
|
89
|
+
* Captured at the span created from inbound headers (via
|
|
90
|
+
* `extractTraceContextFromHeaders`) and inherited by every subspan, so that any
|
|
91
|
+
* `inject()` within the trace re-emits the upstream state unchanged, per the W3C
|
|
92
|
+
* Trace Context spec.
|
|
93
|
+
*
|
|
94
|
+
* - `tracestate`: the W3C `tracestate` header (opaque vendor state).
|
|
95
|
+
* - `traceFlags`: the raw 2-hex `traceparent` trace-flags byte. Stored raw so
|
|
96
|
+
* future flag bits are preserved without per-bit handling.
|
|
97
|
+
* - `braintrustParent`: the resolved `braintrust.parent` value, kept so
|
|
98
|
+
* id-based propagated parents can be re-injected synchronously before their
|
|
99
|
+
* lazy object id has been awaited.
|
|
100
|
+
*/
|
|
101
|
+
interface PropagatedState {
|
|
102
|
+
tracestate?: string;
|
|
103
|
+
traceFlags?: string;
|
|
104
|
+
braintrustParent?: string;
|
|
105
|
+
}
|
|
106
|
+
type TraceContextHeaderValue = string | number | readonly string[] | null | undefined;
|
|
107
|
+
type TraceContextHeaderTuple = readonly [name: string, value: string];
|
|
108
|
+
/**
|
|
109
|
+
* Minimal structural interface for inbound HTTP headers.
|
|
110
|
+
*
|
|
111
|
+
* Covers Node/framework header bags and Web/Fetch-compatible `Headers` objects
|
|
112
|
+
* without depending on Node or DOM platform typings.
|
|
113
|
+
*/
|
|
114
|
+
type TraceContextHeaders = {
|
|
115
|
+
[name: string]: TraceContextHeaderValue;
|
|
116
|
+
} | {
|
|
117
|
+
get(name: string): TraceContextHeaderValue;
|
|
118
|
+
} | {
|
|
119
|
+
getHeader(name: string): TraceContextHeaderValue;
|
|
120
|
+
} | readonly TraceContextHeaderTuple[];
|
|
121
|
+
/**
|
|
122
|
+
* Minimal structural interface for outbound HTTP header carriers.
|
|
123
|
+
*
|
|
124
|
+
* Supports plain objects, Web/Fetch-compatible `Headers`, Node/Fastify-style
|
|
125
|
+
* response carriers, and mutable `HeadersInit` tuple arrays.
|
|
126
|
+
*/
|
|
127
|
+
type TraceContextCarrier = {
|
|
128
|
+
[name: string]: TraceContextHeaderValue;
|
|
129
|
+
} | {
|
|
130
|
+
get(name: string): TraceContextHeaderValue;
|
|
131
|
+
set(name: string, value: string): void;
|
|
132
|
+
delete?(name: string): void;
|
|
133
|
+
} | {
|
|
134
|
+
getHeader(name: string): TraceContextHeaderValue;
|
|
135
|
+
setHeader(name: string, value: string): void;
|
|
136
|
+
removeHeader?(name: string): void;
|
|
137
|
+
} | {
|
|
138
|
+
get?(name: string): TraceContextHeaderValue;
|
|
139
|
+
getHeader?(name: string): TraceContextHeaderValue;
|
|
140
|
+
header(name: string, value: string): void;
|
|
141
|
+
delete?(name: string): void;
|
|
142
|
+
removeHeader?(name: string): void;
|
|
143
|
+
} | [string, string][];
|
|
144
|
+
|
|
145
|
+
declare const TRANSACTION_ID_FIELD = "_xact_id";
|
|
146
|
+
declare const IS_MERGE_FIELD = "_is_merge";
|
|
147
|
+
declare const MERGE_PATHS_FIELD = "_merge_paths";
|
|
148
|
+
declare const AUDIT_SOURCE_FIELD = "_audit_source";
|
|
149
|
+
declare const AUDIT_METADATA_FIELD = "_audit_metadata";
|
|
150
|
+
declare const VALID_SOURCES: readonly ["app", "api", "external"];
|
|
151
|
+
type Source = (typeof VALID_SOURCES)[number];
|
|
152
|
+
declare const ASYNC_SCORING_CONTROL_FIELD = "_async_scoring_control";
|
|
153
|
+
declare const SKIP_ASYNC_SCORING_FIELD = "_skip_async_scoring";
|
|
154
|
+
type TransactionId = string;
|
|
155
|
+
|
|
156
|
+
declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
|
|
157
|
+
kind: z.ZodLiteral<"score_update">;
|
|
158
|
+
token: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
kind: "score_update";
|
|
161
|
+
token?: string | undefined;
|
|
162
|
+
}, {
|
|
163
|
+
kind: "score_update";
|
|
164
|
+
token?: string | undefined;
|
|
165
|
+
}>, z.ZodObject<{
|
|
166
|
+
kind: z.ZodLiteral<"state_override">;
|
|
167
|
+
state: z.ZodUnion<[z.ZodObject<{
|
|
168
|
+
status: z.ZodLiteral<"enabled">;
|
|
169
|
+
token: z.ZodString;
|
|
170
|
+
function_ids: z.ZodArray<z.ZodUnknown, "many">;
|
|
171
|
+
skip_logging: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
|
|
172
|
+
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
status: "enabled";
|
|
174
|
+
token: string;
|
|
175
|
+
function_ids: unknown[];
|
|
176
|
+
skip_logging?: boolean | null | undefined;
|
|
177
|
+
}, {
|
|
178
|
+
status: "enabled";
|
|
179
|
+
token: string;
|
|
180
|
+
function_ids: unknown[];
|
|
181
|
+
skip_logging?: boolean | null | undefined;
|
|
182
|
+
}>, z.ZodObject<{
|
|
183
|
+
status: z.ZodLiteral<"disabled">;
|
|
184
|
+
}, "strip", z.ZodTypeAny, {
|
|
185
|
+
status: "disabled";
|
|
186
|
+
}, {
|
|
187
|
+
status: "disabled";
|
|
188
|
+
}>, z.ZodNull, z.ZodNull]>;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
kind: "state_override";
|
|
191
|
+
state: {
|
|
192
|
+
status: "enabled";
|
|
193
|
+
token: string;
|
|
194
|
+
function_ids: unknown[];
|
|
195
|
+
skip_logging?: boolean | null | undefined;
|
|
196
|
+
} | {
|
|
197
|
+
status: "disabled";
|
|
198
|
+
} | null;
|
|
199
|
+
}, {
|
|
200
|
+
kind: "state_override";
|
|
201
|
+
state: {
|
|
202
|
+
status: "enabled";
|
|
203
|
+
token: string;
|
|
204
|
+
function_ids: unknown[];
|
|
205
|
+
skip_logging?: boolean | null | undefined;
|
|
206
|
+
} | {
|
|
207
|
+
status: "disabled";
|
|
208
|
+
} | null;
|
|
209
|
+
}>, z.ZodObject<{
|
|
210
|
+
kind: z.ZodLiteral<"state_force_reselect">;
|
|
211
|
+
}, "strip", z.ZodTypeAny, {
|
|
212
|
+
kind: "state_force_reselect";
|
|
213
|
+
}, {
|
|
214
|
+
kind: "state_force_reselect";
|
|
215
|
+
}>, z.ZodObject<{
|
|
216
|
+
kind: z.ZodLiteral<"state_enabled_force_rescore">;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
kind: "state_enabled_force_rescore";
|
|
219
|
+
}, {
|
|
220
|
+
kind: "state_enabled_force_rescore";
|
|
221
|
+
}>, z.ZodObject<{
|
|
222
|
+
kind: z.ZodLiteral<"add_triggered_functions">;
|
|
223
|
+
triggered_function_ids: z.ZodArray<z.ZodUnknown, "many">;
|
|
224
|
+
}, "strip", z.ZodTypeAny, {
|
|
225
|
+
kind: "add_triggered_functions";
|
|
226
|
+
triggered_function_ids: unknown[];
|
|
227
|
+
}, {
|
|
228
|
+
kind: "add_triggered_functions";
|
|
229
|
+
triggered_function_ids: unknown[];
|
|
230
|
+
}>, z.ZodObject<{
|
|
231
|
+
kind: z.ZodLiteral<"complete_triggered_functions">;
|
|
232
|
+
function_ids: z.ZodArray<z.ZodUnknown, "many">;
|
|
233
|
+
triggered_xact_id: z.ZodString;
|
|
234
|
+
}, "strip", z.ZodTypeAny, {
|
|
235
|
+
kind: "complete_triggered_functions";
|
|
236
|
+
triggered_xact_id: string;
|
|
237
|
+
function_ids: unknown[];
|
|
238
|
+
}, {
|
|
239
|
+
kind: "complete_triggered_functions";
|
|
240
|
+
triggered_xact_id: string;
|
|
241
|
+
function_ids: unknown[];
|
|
242
|
+
}>]>;
|
|
243
|
+
type AsyncScoringControlType = z.infer<typeof AsyncScoringControl>;
|
|
244
|
+
declare const ObjectReference$1: z.ZodObject<{
|
|
245
|
+
object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
|
|
246
|
+
object_id: z.ZodString;
|
|
247
|
+
id: z.ZodString;
|
|
248
|
+
_xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
249
|
+
created: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
250
|
+
}, "strip", z.ZodTypeAny, {
|
|
251
|
+
id: string;
|
|
252
|
+
object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
|
|
253
|
+
object_id: string;
|
|
254
|
+
created?: string | null | undefined;
|
|
255
|
+
_xact_id?: string | null | undefined;
|
|
256
|
+
}, {
|
|
257
|
+
id: string;
|
|
258
|
+
object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
|
|
259
|
+
object_id: string;
|
|
260
|
+
created?: string | null | undefined;
|
|
261
|
+
_xact_id?: string | null | undefined;
|
|
262
|
+
}>;
|
|
263
|
+
type ObjectReferenceType$1 = z.infer<typeof ObjectReference$1>;
|
|
264
|
+
|
|
265
|
+
type IdField = {
|
|
266
|
+
id: string;
|
|
267
|
+
};
|
|
268
|
+
type InputField = {
|
|
269
|
+
input: unknown;
|
|
270
|
+
};
|
|
271
|
+
type OtherExperimentLogFields = {
|
|
272
|
+
output: unknown;
|
|
273
|
+
expected: unknown;
|
|
274
|
+
error: unknown;
|
|
275
|
+
tags: string[];
|
|
276
|
+
scores: Record<string, number | null>;
|
|
277
|
+
classifications?: Record<string, {
|
|
278
|
+
id: string;
|
|
279
|
+
label?: string;
|
|
280
|
+
}[]>;
|
|
281
|
+
metadata: Record<string, unknown>;
|
|
282
|
+
metrics: Record<string, unknown>;
|
|
283
|
+
datasetRecordId: string;
|
|
284
|
+
origin: ObjectReferenceType$1;
|
|
285
|
+
span_attributes: Record<string, unknown>;
|
|
286
|
+
[ASYNC_SCORING_CONTROL_FIELD]: AsyncScoringControlType;
|
|
287
|
+
[MERGE_PATHS_FIELD]: string[][];
|
|
288
|
+
[SKIP_ASYNC_SCORING_FIELD]: boolean;
|
|
289
|
+
};
|
|
290
|
+
type ExperimentLogPartialArgs = Partial<OtherExperimentLogFields> & Partial<InputField>;
|
|
291
|
+
type ExperimentLogFullArgs = Partial<Omit<OtherExperimentLogFields, "output" | "scores">> & Required<Pick<OtherExperimentLogFields, "output" | "scores">> & Partial<InputField> & Partial<IdField>;
|
|
292
|
+
type LogFeedbackFullArgs = IdField & Partial<Omit<OtherExperimentLogFields, "output" | "metrics" | "datasetRecordId"> & {
|
|
293
|
+
comment: string;
|
|
294
|
+
source: Source;
|
|
295
|
+
}>;
|
|
296
|
+
interface ParentExperimentIds {
|
|
297
|
+
experiment_id: string;
|
|
298
|
+
}
|
|
299
|
+
interface ParentProjectLogIds {
|
|
300
|
+
project_id: string;
|
|
301
|
+
log_id: "g";
|
|
302
|
+
}
|
|
303
|
+
interface ParentPlaygroundLogIds {
|
|
304
|
+
prompt_session_id: string;
|
|
305
|
+
log_id: "x";
|
|
306
|
+
}
|
|
307
|
+
type LogCommentFullArgs = IdField & {
|
|
308
|
+
created: string;
|
|
309
|
+
origin: {
|
|
310
|
+
id: string;
|
|
311
|
+
};
|
|
312
|
+
comment: {
|
|
313
|
+
text: string;
|
|
314
|
+
};
|
|
315
|
+
[AUDIT_SOURCE_FIELD]: Source;
|
|
316
|
+
[AUDIT_METADATA_FIELD]?: Record<string, unknown>;
|
|
317
|
+
} & (ParentExperimentIds | ParentProjectLogIds);
|
|
318
|
+
type ExperimentEvent = Partial<InputField> & Partial<OtherExperimentLogFields> & {
|
|
319
|
+
id: string;
|
|
320
|
+
span_id?: string;
|
|
321
|
+
root_span_id?: string;
|
|
322
|
+
experiment_id: string;
|
|
323
|
+
[IS_MERGE_FIELD]: boolean;
|
|
324
|
+
} & Partial<{
|
|
325
|
+
created: string;
|
|
326
|
+
span_parents: string[];
|
|
327
|
+
span_attributes: Record<string, unknown>;
|
|
328
|
+
context: Record<string, unknown>;
|
|
329
|
+
is_root: boolean | null;
|
|
330
|
+
[AUDIT_SOURCE_FIELD]: Source;
|
|
331
|
+
[AUDIT_METADATA_FIELD]?: Record<string, unknown>;
|
|
332
|
+
}>;
|
|
333
|
+
type DatasetEvent = {
|
|
334
|
+
input?: unknown;
|
|
335
|
+
tags?: string[];
|
|
336
|
+
metadata?: unknown;
|
|
337
|
+
created?: string;
|
|
338
|
+
origin?: ObjectReferenceType$1;
|
|
339
|
+
id: string;
|
|
340
|
+
dataset_id: string;
|
|
341
|
+
} & ({
|
|
342
|
+
expected?: unknown;
|
|
343
|
+
} | {
|
|
344
|
+
output?: unknown;
|
|
345
|
+
});
|
|
346
|
+
type LoggingEvent = Omit<ExperimentEvent, "experiment_id"> & {
|
|
347
|
+
project_id: string;
|
|
348
|
+
log_id: "g";
|
|
349
|
+
};
|
|
350
|
+
type PlaygroundLogEvent = Omit<ExperimentEvent, "experiment_id"> & {
|
|
351
|
+
prompt_session_id: string;
|
|
352
|
+
log_id: "x";
|
|
353
|
+
};
|
|
354
|
+
type CommentEvent = IdField & {
|
|
355
|
+
created: string;
|
|
356
|
+
origin: {
|
|
357
|
+
id: string;
|
|
358
|
+
};
|
|
359
|
+
comment: {
|
|
360
|
+
text: string;
|
|
361
|
+
};
|
|
362
|
+
[AUDIT_SOURCE_FIELD]: Source;
|
|
363
|
+
[AUDIT_METADATA_FIELD]?: Record<string, unknown>;
|
|
364
|
+
} & (ParentExperimentIds | ParentProjectLogIds | ParentPlaygroundLogIds);
|
|
365
|
+
type BackgroundLogEvent = ExperimentEvent | DatasetEvent | LoggingEvent | PlaygroundLogEvent | CommentEvent;
|
|
366
|
+
declare const DEFAULT_IS_LEGACY_DATASET = false;
|
|
367
|
+
interface LegacyDatasetRecord {
|
|
368
|
+
id: string;
|
|
369
|
+
input: any;
|
|
370
|
+
output: any;
|
|
371
|
+
metadata: any;
|
|
372
|
+
}
|
|
373
|
+
interface NewDatasetRecord {
|
|
374
|
+
id: string;
|
|
375
|
+
input: any;
|
|
376
|
+
expected: any;
|
|
377
|
+
tags: any;
|
|
378
|
+
metadata: any;
|
|
379
|
+
}
|
|
380
|
+
type DatasetRecord<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY_DATASET> = IsLegacyDataset extends true ? LegacyDatasetRecord : NewDatasetRecord;
|
|
381
|
+
|
|
382
|
+
declare enum SpanObjectTypeV3 {
|
|
383
|
+
EXPERIMENT = 1,
|
|
384
|
+
PROJECT_LOGS = 2,
|
|
385
|
+
PLAYGROUND_LOGS = 3
|
|
386
|
+
}
|
|
387
|
+
declare const spanComponentsV3Schema: z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
|
|
388
|
+
object_type: z.ZodNativeEnum<typeof SpanObjectTypeV3>;
|
|
389
|
+
propagated_event: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
390
|
+
}, "strip", z.ZodTypeAny, {
|
|
391
|
+
object_type: SpanObjectTypeV3;
|
|
392
|
+
propagated_event?: Record<string, unknown> | null | undefined;
|
|
393
|
+
}, {
|
|
394
|
+
object_type: SpanObjectTypeV3;
|
|
395
|
+
propagated_event?: Record<string, unknown> | null | undefined;
|
|
396
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
397
|
+
object_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
398
|
+
compute_object_metadata_args: z.ZodOptional<z.ZodNull>;
|
|
399
|
+
}, "strip", z.ZodTypeAny, {
|
|
400
|
+
object_id?: string | null | undefined;
|
|
401
|
+
compute_object_metadata_args?: null | undefined;
|
|
402
|
+
}, {
|
|
403
|
+
object_id?: string | null | undefined;
|
|
404
|
+
compute_object_metadata_args?: null | undefined;
|
|
405
|
+
}>, z.ZodObject<{
|
|
406
|
+
object_id: z.ZodOptional<z.ZodNull>;
|
|
407
|
+
compute_object_metadata_args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
408
|
+
}, "strip", z.ZodTypeAny, {
|
|
409
|
+
compute_object_metadata_args: Record<string, unknown>;
|
|
410
|
+
object_id?: null | undefined;
|
|
411
|
+
}, {
|
|
412
|
+
compute_object_metadata_args: Record<string, unknown>;
|
|
413
|
+
object_id?: null | undefined;
|
|
414
|
+
}>]>>, z.ZodUnion<[z.ZodObject<{
|
|
415
|
+
row_id: z.ZodString;
|
|
416
|
+
span_id: z.ZodString;
|
|
417
|
+
root_span_id: z.ZodString;
|
|
418
|
+
}, "strip", z.ZodTypeAny, {
|
|
419
|
+
span_id: string;
|
|
420
|
+
root_span_id: string;
|
|
421
|
+
row_id: string;
|
|
422
|
+
}, {
|
|
423
|
+
span_id: string;
|
|
424
|
+
root_span_id: string;
|
|
425
|
+
row_id: string;
|
|
426
|
+
}>, z.ZodObject<{
|
|
427
|
+
row_id: z.ZodOptional<z.ZodNull>;
|
|
428
|
+
span_id: z.ZodOptional<z.ZodNull>;
|
|
429
|
+
root_span_id: z.ZodOptional<z.ZodNull>;
|
|
430
|
+
}, "strip", z.ZodTypeAny, {
|
|
431
|
+
span_id?: null | undefined;
|
|
432
|
+
root_span_id?: null | undefined;
|
|
433
|
+
row_id?: null | undefined;
|
|
434
|
+
}, {
|
|
435
|
+
span_id?: null | undefined;
|
|
436
|
+
root_span_id?: null | undefined;
|
|
437
|
+
row_id?: null | undefined;
|
|
438
|
+
}>]>>;
|
|
439
|
+
type SpanComponentsV3Data = z.infer<typeof spanComponentsV3Schema>;
|
|
440
|
+
declare class SpanComponentsV3 {
|
|
441
|
+
data: SpanComponentsV3Data;
|
|
442
|
+
constructor(data: SpanComponentsV3Data);
|
|
443
|
+
toStr(): string;
|
|
444
|
+
static fromStr(s: string): SpanComponentsV3;
|
|
445
|
+
objectIdFields(): ParentExperimentIds | ParentProjectLogIds | ParentPlaygroundLogIds;
|
|
446
|
+
export(): Promise<string>;
|
|
447
|
+
private static fromJsonObj;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* The result returned by a classifier function. Unlike `Score`, `id` is
|
|
452
|
+
* required and the span will be recorded as a classifier span.
|
|
453
|
+
*/
|
|
454
|
+
interface Classification {
|
|
455
|
+
/**
|
|
456
|
+
* The name of this classification result. Used as the key in the
|
|
457
|
+
* `classifications` log record. If omitted, defaults to the classifier
|
|
458
|
+
* function's name.
|
|
459
|
+
*/
|
|
460
|
+
name: string;
|
|
461
|
+
/**
|
|
462
|
+
* A machine-readable identifier for the classification outcome
|
|
463
|
+
* (e.g. `"positive"`, `"negative"`, `"neutral"`). This value is stored
|
|
464
|
+
* in the log and used for programmatic analysis.
|
|
465
|
+
*/
|
|
466
|
+
id: string;
|
|
467
|
+
/**
|
|
468
|
+
* An optional human-readable display label for this outcome. If omitted,
|
|
469
|
+
* defaults to `id`. Use this when you want a friendlier label in the UI
|
|
470
|
+
* while keeping a stable `id` for programmatic use.
|
|
471
|
+
*/
|
|
472
|
+
label?: string;
|
|
473
|
+
/**
|
|
474
|
+
* Optional arbitrary metadata to attach to this classification result.
|
|
475
|
+
*/
|
|
476
|
+
metadata?: Record<string, unknown>;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* The serialized form of a classification stored in the `classifications` log record.
|
|
480
|
+
*/
|
|
481
|
+
interface ClassificationItem {
|
|
482
|
+
id: string;
|
|
483
|
+
label: string;
|
|
484
|
+
metadata?: Record<string, unknown>;
|
|
485
|
+
}
|
|
486
|
+
interface Score {
|
|
487
|
+
name: string;
|
|
488
|
+
score: number | null;
|
|
489
|
+
metadata?: Record<string, unknown>;
|
|
490
|
+
/**
|
|
491
|
+
* @deprecated
|
|
492
|
+
*/
|
|
493
|
+
error?: unknown;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
declare const spanComponentsV4Schema: z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
|
|
497
|
+
object_type: z.ZodNativeEnum<typeof SpanObjectTypeV3>;
|
|
498
|
+
propagated_event: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
499
|
+
}, "strip", z.ZodTypeAny, {
|
|
500
|
+
object_type: SpanObjectTypeV3;
|
|
501
|
+
propagated_event?: Record<string, unknown> | null | undefined;
|
|
502
|
+
}, {
|
|
503
|
+
object_type: SpanObjectTypeV3;
|
|
504
|
+
propagated_event?: Record<string, unknown> | null | undefined;
|
|
505
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
506
|
+
object_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
507
|
+
compute_object_metadata_args: z.ZodOptional<z.ZodNull>;
|
|
508
|
+
}, "strip", z.ZodTypeAny, {
|
|
509
|
+
object_id?: string | null | undefined;
|
|
510
|
+
compute_object_metadata_args?: null | undefined;
|
|
511
|
+
}, {
|
|
512
|
+
object_id?: string | null | undefined;
|
|
513
|
+
compute_object_metadata_args?: null | undefined;
|
|
514
|
+
}>, z.ZodObject<{
|
|
515
|
+
object_id: z.ZodOptional<z.ZodNull>;
|
|
516
|
+
compute_object_metadata_args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
517
|
+
}, "strip", z.ZodTypeAny, {
|
|
518
|
+
compute_object_metadata_args: Record<string, unknown>;
|
|
519
|
+
object_id?: null | undefined;
|
|
520
|
+
}, {
|
|
521
|
+
compute_object_metadata_args: Record<string, unknown>;
|
|
522
|
+
object_id?: null | undefined;
|
|
523
|
+
}>]>>, z.ZodUnion<[z.ZodObject<{
|
|
524
|
+
row_id: z.ZodString;
|
|
525
|
+
span_id: z.ZodString;
|
|
526
|
+
root_span_id: z.ZodString;
|
|
527
|
+
}, "strip", z.ZodTypeAny, {
|
|
528
|
+
span_id: string;
|
|
529
|
+
root_span_id: string;
|
|
530
|
+
row_id: string;
|
|
531
|
+
}, {
|
|
532
|
+
span_id: string;
|
|
533
|
+
root_span_id: string;
|
|
534
|
+
row_id: string;
|
|
535
|
+
}>, z.ZodObject<{
|
|
536
|
+
row_id: z.ZodOptional<z.ZodNull>;
|
|
537
|
+
span_id: z.ZodOptional<z.ZodNull>;
|
|
538
|
+
root_span_id: z.ZodOptional<z.ZodNull>;
|
|
539
|
+
}, "strip", z.ZodTypeAny, {
|
|
540
|
+
span_id?: null | undefined;
|
|
541
|
+
root_span_id?: null | undefined;
|
|
542
|
+
row_id?: null | undefined;
|
|
543
|
+
}, {
|
|
544
|
+
span_id?: null | undefined;
|
|
545
|
+
root_span_id?: null | undefined;
|
|
546
|
+
row_id?: null | undefined;
|
|
547
|
+
}>]>>;
|
|
548
|
+
type SpanComponentsV4Data = z.infer<typeof spanComponentsV4Schema>;
|
|
549
|
+
declare class SpanComponentsV4 {
|
|
550
|
+
data: SpanComponentsV4Data;
|
|
551
|
+
constructor(data: SpanComponentsV4Data);
|
|
552
|
+
toStr(): string;
|
|
553
|
+
static fromStr(s: string): SpanComponentsV4;
|
|
554
|
+
objectIdFields(): ParentExperimentIds | ParentProjectLogIds | ParentPlaygroundLogIds;
|
|
555
|
+
export(): Promise<string>;
|
|
556
|
+
private static fromJsonObj;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
declare const spanTypeAttributeValues: readonly ["llm", "score", "function", "eval", "task", "tool", "automation", "facet", "preprocessor", "classifier", "review"];
|
|
560
|
+
type SpanType = (typeof spanTypeAttributeValues)[number];
|
|
561
|
+
|
|
562
|
+
declare class LazyValue<T> {
|
|
563
|
+
private callable;
|
|
564
|
+
private resolvedValue;
|
|
565
|
+
private value;
|
|
566
|
+
constructor(callable: () => Promise<T>);
|
|
567
|
+
get(): Promise<T>;
|
|
568
|
+
getSync(): {
|
|
569
|
+
resolved: boolean;
|
|
570
|
+
value: T | undefined;
|
|
571
|
+
};
|
|
572
|
+
get hasSucceeded(): boolean;
|
|
573
|
+
}
|
|
574
|
+
declare function addAzureBlobHeaders(headers: Record<string, string>, url: string): void;
|
|
575
|
+
|
|
3
576
|
declare const ResponseFormatJsonSchema: z.ZodObject<{
|
|
4
577
|
name: z.ZodString;
|
|
5
578
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -6700,6 +7273,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
6700
7273
|
}>>;
|
|
6701
7274
|
disable_reconciliation: z.ZodOptional<z.ZodBoolean>;
|
|
6702
7275
|
distance_threshold: z.ZodOptional<z.ZodNumber>;
|
|
7276
|
+
btql_filter: z.ZodOptional<z.ZodString>;
|
|
7277
|
+
automation_btql_filter: z.ZodOptional<z.ZodString>;
|
|
6703
7278
|
}, "strip", z.ZodTypeAny, {
|
|
6704
7279
|
type: "topic_map";
|
|
6705
7280
|
source_facet: string;
|
|
@@ -6719,6 +7294,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
6719
7294
|
} | undefined;
|
|
6720
7295
|
disable_reconciliation?: boolean | undefined;
|
|
6721
7296
|
distance_threshold?: number | undefined;
|
|
7297
|
+
btql_filter?: string | undefined;
|
|
7298
|
+
automation_btql_filter?: string | undefined;
|
|
6722
7299
|
}, {
|
|
6723
7300
|
type: "topic_map";
|
|
6724
7301
|
source_facet: string;
|
|
@@ -6738,6 +7315,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
6738
7315
|
} | undefined;
|
|
6739
7316
|
disable_reconciliation?: boolean | undefined;
|
|
6740
7317
|
distance_threshold?: number | undefined;
|
|
7318
|
+
btql_filter?: string | undefined;
|
|
7319
|
+
automation_btql_filter?: string | undefined;
|
|
6741
7320
|
}>;
|
|
6742
7321
|
}, "strip", z.ZodTypeAny, {
|
|
6743
7322
|
function_name: string;
|
|
@@ -6760,6 +7339,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
6760
7339
|
} | undefined;
|
|
6761
7340
|
disable_reconciliation?: boolean | undefined;
|
|
6762
7341
|
distance_threshold?: number | undefined;
|
|
7342
|
+
btql_filter?: string | undefined;
|
|
7343
|
+
automation_btql_filter?: string | undefined;
|
|
6763
7344
|
};
|
|
6764
7345
|
topic_map_id?: string | undefined;
|
|
6765
7346
|
}, {
|
|
@@ -6783,6 +7364,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
6783
7364
|
} | undefined;
|
|
6784
7365
|
disable_reconciliation?: boolean | undefined;
|
|
6785
7366
|
distance_threshold?: number | undefined;
|
|
7367
|
+
btql_filter?: string | undefined;
|
|
7368
|
+
automation_btql_filter?: string | undefined;
|
|
6786
7369
|
};
|
|
6787
7370
|
topic_map_id?: string | undefined;
|
|
6788
7371
|
}>, "many">>>;
|
|
@@ -6825,6 +7408,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
6825
7408
|
} | undefined;
|
|
6826
7409
|
disable_reconciliation?: boolean | undefined;
|
|
6827
7410
|
distance_threshold?: number | undefined;
|
|
7411
|
+
btql_filter?: string | undefined;
|
|
7412
|
+
automation_btql_filter?: string | undefined;
|
|
6828
7413
|
};
|
|
6829
7414
|
topic_map_id?: string | undefined;
|
|
6830
7415
|
}[]> | undefined;
|
|
@@ -6867,6 +7452,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
6867
7452
|
} | undefined;
|
|
6868
7453
|
disable_reconciliation?: boolean | undefined;
|
|
6869
7454
|
distance_threshold?: number | undefined;
|
|
7455
|
+
btql_filter?: string | undefined;
|
|
7456
|
+
automation_btql_filter?: string | undefined;
|
|
6870
7457
|
};
|
|
6871
7458
|
topic_map_id?: string | undefined;
|
|
6872
7459
|
}[]> | undefined;
|
|
@@ -6948,6 +7535,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
6948
7535
|
}>>;
|
|
6949
7536
|
disable_reconciliation: z.ZodOptional<z.ZodBoolean>;
|
|
6950
7537
|
distance_threshold: z.ZodOptional<z.ZodNumber>;
|
|
7538
|
+
btql_filter: z.ZodOptional<z.ZodString>;
|
|
7539
|
+
automation_btql_filter: z.ZodOptional<z.ZodString>;
|
|
6951
7540
|
}, "strip", z.ZodTypeAny, {
|
|
6952
7541
|
type: "topic_map";
|
|
6953
7542
|
source_facet: string;
|
|
@@ -6967,6 +7556,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
6967
7556
|
} | undefined;
|
|
6968
7557
|
disable_reconciliation?: boolean | undefined;
|
|
6969
7558
|
distance_threshold?: number | undefined;
|
|
7559
|
+
btql_filter?: string | undefined;
|
|
7560
|
+
automation_btql_filter?: string | undefined;
|
|
6970
7561
|
}, {
|
|
6971
7562
|
type: "topic_map";
|
|
6972
7563
|
source_facet: string;
|
|
@@ -6986,6 +7577,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
6986
7577
|
} | undefined;
|
|
6987
7578
|
disable_reconciliation?: boolean | undefined;
|
|
6988
7579
|
distance_threshold?: number | undefined;
|
|
7580
|
+
btql_filter?: string | undefined;
|
|
7581
|
+
automation_btql_filter?: string | undefined;
|
|
6989
7582
|
}>, z.ZodUnknown>]>;
|
|
6990
7583
|
declare const PromptData: z.ZodObject<{
|
|
6991
7584
|
prompt: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -8196,18 +8789,21 @@ declare const PromptData: z.ZodObject<{
|
|
|
8196
8789
|
choice_scores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
8197
8790
|
choice: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8198
8791
|
allow_no_match: z.ZodOptional<z.ZodBoolean>;
|
|
8792
|
+
allow_skip: z.ZodOptional<z.ZodBoolean>;
|
|
8199
8793
|
}, "strip", z.ZodTypeAny, {
|
|
8200
8794
|
type: "llm_classifier";
|
|
8201
8795
|
use_cot: boolean;
|
|
8202
8796
|
choice_scores?: Record<string, number> | undefined;
|
|
8203
8797
|
choice?: string[] | undefined;
|
|
8204
8798
|
allow_no_match?: boolean | undefined;
|
|
8799
|
+
allow_skip?: boolean | undefined;
|
|
8205
8800
|
}, {
|
|
8206
8801
|
type: "llm_classifier";
|
|
8207
8802
|
use_cot: boolean;
|
|
8208
8803
|
choice_scores?: Record<string, number> | undefined;
|
|
8209
8804
|
choice?: string[] | undefined;
|
|
8210
8805
|
allow_no_match?: boolean | undefined;
|
|
8806
|
+
allow_skip?: boolean | undefined;
|
|
8211
8807
|
}>, z.ZodNull]>>;
|
|
8212
8808
|
tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
8213
8809
|
type: z.ZodLiteral<"function">;
|
|
@@ -8507,6 +9103,7 @@ declare const PromptData: z.ZodObject<{
|
|
|
8507
9103
|
choice_scores?: Record<string, number> | undefined;
|
|
8508
9104
|
choice?: string[] | undefined;
|
|
8509
9105
|
allow_no_match?: boolean | undefined;
|
|
9106
|
+
allow_skip?: boolean | undefined;
|
|
8510
9107
|
} | null | undefined;
|
|
8511
9108
|
tool_functions?: ({
|
|
8512
9109
|
type: "function";
|
|
@@ -8757,6 +9354,7 @@ declare const PromptData: z.ZodObject<{
|
|
|
8757
9354
|
choice_scores?: Record<string, number> | undefined;
|
|
8758
9355
|
choice?: string[] | undefined;
|
|
8759
9356
|
allow_no_match?: boolean | undefined;
|
|
9357
|
+
allow_skip?: boolean | undefined;
|
|
8760
9358
|
} | null | undefined;
|
|
8761
9359
|
tool_functions?: ({
|
|
8762
9360
|
type: "function";
|
|
@@ -10063,18 +10661,21 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
10063
10661
|
choice_scores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
10064
10662
|
choice: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
10065
10663
|
allow_no_match: z.ZodOptional<z.ZodBoolean>;
|
|
10664
|
+
allow_skip: z.ZodOptional<z.ZodBoolean>;
|
|
10066
10665
|
}, "strip", z.ZodTypeAny, {
|
|
10067
10666
|
type: "llm_classifier";
|
|
10068
10667
|
use_cot: boolean;
|
|
10069
10668
|
choice_scores?: Record<string, number> | undefined;
|
|
10070
10669
|
choice?: string[] | undefined;
|
|
10071
10670
|
allow_no_match?: boolean | undefined;
|
|
10671
|
+
allow_skip?: boolean | undefined;
|
|
10072
10672
|
}, {
|
|
10073
10673
|
type: "llm_classifier";
|
|
10074
10674
|
use_cot: boolean;
|
|
10075
10675
|
choice_scores?: Record<string, number> | undefined;
|
|
10076
10676
|
choice?: string[] | undefined;
|
|
10077
10677
|
allow_no_match?: boolean | undefined;
|
|
10678
|
+
allow_skip?: boolean | undefined;
|
|
10078
10679
|
}>, z.ZodNull]>>;
|
|
10079
10680
|
tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
10080
10681
|
type: z.ZodLiteral<"function">;
|
|
@@ -10374,6 +10975,7 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
10374
10975
|
choice_scores?: Record<string, number> | undefined;
|
|
10375
10976
|
choice?: string[] | undefined;
|
|
10376
10977
|
allow_no_match?: boolean | undefined;
|
|
10978
|
+
allow_skip?: boolean | undefined;
|
|
10377
10979
|
} | null | undefined;
|
|
10378
10980
|
tool_functions?: ({
|
|
10379
10981
|
type: "function";
|
|
@@ -10624,6 +11226,7 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
10624
11226
|
choice_scores?: Record<string, number> | undefined;
|
|
10625
11227
|
choice?: string[] | undefined;
|
|
10626
11228
|
allow_no_match?: boolean | undefined;
|
|
11229
|
+
allow_skip?: boolean | undefined;
|
|
10627
11230
|
} | null | undefined;
|
|
10628
11231
|
tool_functions?: ({
|
|
10629
11232
|
type: "function";
|
|
@@ -10884,6 +11487,7 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
10884
11487
|
choice_scores?: Record<string, number> | undefined;
|
|
10885
11488
|
choice?: string[] | undefined;
|
|
10886
11489
|
allow_no_match?: boolean | undefined;
|
|
11490
|
+
allow_skip?: boolean | undefined;
|
|
10887
11491
|
} | null | undefined;
|
|
10888
11492
|
tool_functions?: ({
|
|
10889
11493
|
type: "function";
|
|
@@ -11141,6 +11745,7 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
11141
11745
|
choice_scores?: Record<string, number> | undefined;
|
|
11142
11746
|
choice?: string[] | undefined;
|
|
11143
11747
|
allow_no_match?: boolean | undefined;
|
|
11748
|
+
allow_skip?: boolean | undefined;
|
|
11144
11749
|
} | null | undefined;
|
|
11145
11750
|
tool_functions?: ({
|
|
11146
11751
|
type: "function";
|
|
@@ -12374,18 +12979,21 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
12374
12979
|
choice_scores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
12375
12980
|
choice: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
12376
12981
|
allow_no_match: z.ZodOptional<z.ZodBoolean>;
|
|
12982
|
+
allow_skip: z.ZodOptional<z.ZodBoolean>;
|
|
12377
12983
|
}, "strip", z.ZodTypeAny, {
|
|
12378
12984
|
type: "llm_classifier";
|
|
12379
12985
|
use_cot: boolean;
|
|
12380
12986
|
choice_scores?: Record<string, number> | undefined;
|
|
12381
12987
|
choice?: string[] | undefined;
|
|
12382
12988
|
allow_no_match?: boolean | undefined;
|
|
12989
|
+
allow_skip?: boolean | undefined;
|
|
12383
12990
|
}, {
|
|
12384
12991
|
type: "llm_classifier";
|
|
12385
12992
|
use_cot: boolean;
|
|
12386
12993
|
choice_scores?: Record<string, number> | undefined;
|
|
12387
12994
|
choice?: string[] | undefined;
|
|
12388
12995
|
allow_no_match?: boolean | undefined;
|
|
12996
|
+
allow_skip?: boolean | undefined;
|
|
12389
12997
|
}>, z.ZodNull]>>;
|
|
12390
12998
|
tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
12391
12999
|
type: z.ZodLiteral<"function">;
|
|
@@ -12685,6 +13293,7 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
12685
13293
|
choice_scores?: Record<string, number> | undefined;
|
|
12686
13294
|
choice?: string[] | undefined;
|
|
12687
13295
|
allow_no_match?: boolean | undefined;
|
|
13296
|
+
allow_skip?: boolean | undefined;
|
|
12688
13297
|
} | null | undefined;
|
|
12689
13298
|
tool_functions?: ({
|
|
12690
13299
|
type: "function";
|
|
@@ -12935,6 +13544,7 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
12935
13544
|
choice_scores?: Record<string, number> | undefined;
|
|
12936
13545
|
choice?: string[] | undefined;
|
|
12937
13546
|
allow_no_match?: boolean | undefined;
|
|
13547
|
+
allow_skip?: boolean | undefined;
|
|
12938
13548
|
} | null | undefined;
|
|
12939
13549
|
tool_functions?: ({
|
|
12940
13550
|
type: "function";
|
|
@@ -13190,6 +13800,7 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
13190
13800
|
choice_scores?: Record<string, number> | undefined;
|
|
13191
13801
|
choice?: string[] | undefined;
|
|
13192
13802
|
allow_no_match?: boolean | undefined;
|
|
13803
|
+
allow_skip?: boolean | undefined;
|
|
13193
13804
|
} | null | undefined;
|
|
13194
13805
|
tool_functions?: ({
|
|
13195
13806
|
type: "function";
|
|
@@ -13443,6 +14054,7 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
13443
14054
|
choice_scores?: Record<string, number> | undefined;
|
|
13444
14055
|
choice?: string[] | undefined;
|
|
13445
14056
|
allow_no_match?: boolean | undefined;
|
|
14057
|
+
allow_skip?: boolean | undefined;
|
|
13446
14058
|
} | null | undefined;
|
|
13447
14059
|
tool_functions?: ({
|
|
13448
14060
|
type: "function";
|
|
@@ -13485,7 +14097,7 @@ declare const IfExists: z.ZodEnum<["error", "ignore", "replace"]>;
|
|
|
13485
14097
|
type IfExistsType = z.infer<typeof IfExists>;
|
|
13486
14098
|
declare const StreamingMode: z.ZodUnion<[z.ZodEnum<["auto", "parallel", "json", "text"]>, z.ZodNull]>;
|
|
13487
14099
|
type StreamingModeType = z.infer<typeof StreamingMode>;
|
|
13488
|
-
declare const ObjectReference
|
|
14100
|
+
declare const ObjectReference: z.ZodObject<{
|
|
13489
14101
|
object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
|
|
13490
14102
|
object_id: z.ZodString;
|
|
13491
14103
|
id: z.ZodString;
|
|
@@ -13504,7 +14116,7 @@ declare const ObjectReference$1: z.ZodObject<{
|
|
|
13504
14116
|
created?: string | null | undefined;
|
|
13505
14117
|
_xact_id?: string | null | undefined;
|
|
13506
14118
|
}>;
|
|
13507
|
-
type ObjectReferenceType
|
|
14119
|
+
type ObjectReferenceType = z.infer<typeof ObjectReference>;
|
|
13508
14120
|
declare const Prompt$1: z.ZodObject<{
|
|
13509
14121
|
id: z.ZodString;
|
|
13510
14122
|
_xact_id: z.ZodString;
|
|
@@ -14724,18 +15336,21 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
14724
15336
|
choice_scores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
14725
15337
|
choice: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14726
15338
|
allow_no_match: z.ZodOptional<z.ZodBoolean>;
|
|
15339
|
+
allow_skip: z.ZodOptional<z.ZodBoolean>;
|
|
14727
15340
|
}, "strip", z.ZodTypeAny, {
|
|
14728
15341
|
type: "llm_classifier";
|
|
14729
15342
|
use_cot: boolean;
|
|
14730
15343
|
choice_scores?: Record<string, number> | undefined;
|
|
14731
15344
|
choice?: string[] | undefined;
|
|
14732
15345
|
allow_no_match?: boolean | undefined;
|
|
15346
|
+
allow_skip?: boolean | undefined;
|
|
14733
15347
|
}, {
|
|
14734
15348
|
type: "llm_classifier";
|
|
14735
15349
|
use_cot: boolean;
|
|
14736
15350
|
choice_scores?: Record<string, number> | undefined;
|
|
14737
15351
|
choice?: string[] | undefined;
|
|
14738
15352
|
allow_no_match?: boolean | undefined;
|
|
15353
|
+
allow_skip?: boolean | undefined;
|
|
14739
15354
|
}>, z.ZodNull]>>;
|
|
14740
15355
|
tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
14741
15356
|
type: z.ZodLiteral<"function">;
|
|
@@ -15035,6 +15650,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
15035
15650
|
choice_scores?: Record<string, number> | undefined;
|
|
15036
15651
|
choice?: string[] | undefined;
|
|
15037
15652
|
allow_no_match?: boolean | undefined;
|
|
15653
|
+
allow_skip?: boolean | undefined;
|
|
15038
15654
|
} | null | undefined;
|
|
15039
15655
|
tool_functions?: ({
|
|
15040
15656
|
type: "function";
|
|
@@ -15285,6 +15901,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
15285
15901
|
choice_scores?: Record<string, number> | undefined;
|
|
15286
15902
|
choice?: string[] | undefined;
|
|
15287
15903
|
allow_no_match?: boolean | undefined;
|
|
15904
|
+
allow_skip?: boolean | undefined;
|
|
15288
15905
|
} | null | undefined;
|
|
15289
15906
|
tool_functions?: ({
|
|
15290
15907
|
type: "function";
|
|
@@ -15313,284 +15930,285 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
15313
15930
|
function_type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox"]>, z.ZodNull]>>;
|
|
15314
15931
|
}, "strip", z.ZodTypeAny, {
|
|
15315
15932
|
id: string;
|
|
15316
|
-
org_id: string;
|
|
15317
|
-
name: string;
|
|
15318
15933
|
project_id: string;
|
|
15319
|
-
|
|
15934
|
+
name: string;
|
|
15320
15935
|
slug: string;
|
|
15321
|
-
log_id: "p";
|
|
15322
|
-
created?: string | null | undefined;
|
|
15323
|
-
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
15324
|
-
description?: string | null | undefined;
|
|
15325
|
-
function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | null | undefined;
|
|
15326
|
-
tags?: string[] | null | undefined;
|
|
15327
|
-
prompt_data?: {
|
|
15328
|
-
options?: {
|
|
15329
|
-
params?: z.objectOutputType<{
|
|
15330
|
-
use_cache: z.ZodOptional<z.ZodBoolean>;
|
|
15331
|
-
reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
15332
|
-
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
15333
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
|
15334
|
-
top_p: z.ZodOptional<z.ZodNumber>;
|
|
15335
|
-
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
15336
|
-
max_completion_tokens: z.ZodOptional<z.ZodNumber>;
|
|
15337
|
-
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
15338
|
-
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
15339
|
-
response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
15340
|
-
type: z.ZodLiteral<"json_object">;
|
|
15341
|
-
}, "strip", z.ZodTypeAny, {
|
|
15342
|
-
type: "json_object";
|
|
15343
|
-
}, {
|
|
15344
|
-
type: "json_object";
|
|
15345
|
-
}>, z.ZodObject<{
|
|
15346
|
-
type: z.ZodLiteral<"json_schema">;
|
|
15347
|
-
json_schema: z.ZodObject<{
|
|
15348
|
-
name: z.ZodString;
|
|
15349
|
-
description: z.ZodOptional<z.ZodString>;
|
|
15350
|
-
schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
|
|
15351
|
-
strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
|
|
15352
|
-
}, "strip", z.ZodTypeAny, {
|
|
15353
|
-
name: string;
|
|
15354
|
-
description?: string | undefined;
|
|
15355
|
-
schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
15356
|
-
strict?: boolean | null | undefined;
|
|
15357
|
-
}, {
|
|
15358
|
-
name: string;
|
|
15359
|
-
description?: string | undefined;
|
|
15360
|
-
schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
15361
|
-
strict?: boolean | null | undefined;
|
|
15362
|
-
}>;
|
|
15363
|
-
}, "strip", z.ZodTypeAny, {
|
|
15364
|
-
type: "json_schema";
|
|
15365
|
-
json_schema: {
|
|
15366
|
-
name: string;
|
|
15367
|
-
description?: string | undefined;
|
|
15368
|
-
schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
15369
|
-
strict?: boolean | null | undefined;
|
|
15370
|
-
};
|
|
15371
|
-
}, {
|
|
15372
|
-
type: "json_schema";
|
|
15373
|
-
json_schema: {
|
|
15374
|
-
name: string;
|
|
15375
|
-
description?: string | undefined;
|
|
15376
|
-
schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
15377
|
-
strict?: boolean | null | undefined;
|
|
15378
|
-
};
|
|
15379
|
-
}>, z.ZodObject<{
|
|
15380
|
-
type: z.ZodLiteral<"text">;
|
|
15381
|
-
}, "strip", z.ZodTypeAny, {
|
|
15382
|
-
type: "text";
|
|
15383
|
-
}, {
|
|
15384
|
-
type: "text";
|
|
15385
|
-
}>, z.ZodNull]>>;
|
|
15386
|
-
tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
|
|
15387
|
-
type: z.ZodLiteral<"function">;
|
|
15388
|
-
function: z.ZodObject<{
|
|
15389
|
-
name: z.ZodString;
|
|
15390
|
-
}, "strip", z.ZodTypeAny, {
|
|
15391
|
-
name: string;
|
|
15392
|
-
}, {
|
|
15393
|
-
name: string;
|
|
15394
|
-
}>;
|
|
15395
|
-
}, "strip", z.ZodTypeAny, {
|
|
15396
|
-
function: {
|
|
15397
|
-
name: string;
|
|
15398
|
-
};
|
|
15399
|
-
type: "function";
|
|
15400
|
-
}, {
|
|
15401
|
-
function: {
|
|
15402
|
-
name: string;
|
|
15403
|
-
};
|
|
15404
|
-
type: "function";
|
|
15405
|
-
}>]>>;
|
|
15406
|
-
function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
|
|
15407
|
-
name: z.ZodString;
|
|
15408
|
-
}, "strip", z.ZodTypeAny, {
|
|
15409
|
-
name: string;
|
|
15410
|
-
}, {
|
|
15411
|
-
name: string;
|
|
15412
|
-
}>]>>;
|
|
15413
|
-
n: z.ZodOptional<z.ZodNumber>;
|
|
15414
|
-
stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15415
|
-
reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
|
|
15416
|
-
verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
15417
|
-
}, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
|
|
15418
|
-
use_cache: z.ZodOptional<z.ZodBoolean>;
|
|
15419
|
-
reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
15420
|
-
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
15421
|
-
max_tokens: z.ZodNumber;
|
|
15422
|
-
temperature: z.ZodNumber;
|
|
15423
|
-
top_p: z.ZodOptional<z.ZodNumber>;
|
|
15424
|
-
top_k: z.ZodOptional<z.ZodNumber>;
|
|
15425
|
-
stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15426
|
-
max_tokens_to_sample: z.ZodOptional<z.ZodNumber>;
|
|
15427
|
-
}, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
|
|
15428
|
-
use_cache: z.ZodOptional<z.ZodBoolean>;
|
|
15429
|
-
reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
15430
|
-
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
15431
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
|
15432
|
-
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
15433
|
-
topP: z.ZodOptional<z.ZodNumber>;
|
|
15434
|
-
topK: z.ZodOptional<z.ZodNumber>;
|
|
15435
|
-
}, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
|
|
15436
|
-
use_cache: z.ZodOptional<z.ZodBoolean>;
|
|
15437
|
-
reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
15438
|
-
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
15439
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
|
15440
|
-
topK: z.ZodOptional<z.ZodNumber>;
|
|
15441
|
-
}, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
|
|
15442
|
-
use_cache: z.ZodOptional<z.ZodBoolean>;
|
|
15443
|
-
reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
15444
|
-
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
15445
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
15446
|
-
model?: string | undefined;
|
|
15447
|
-
position?: string | undefined;
|
|
15448
|
-
} | null | undefined;
|
|
15449
|
-
prompt?: {
|
|
15450
|
-
type: "chat";
|
|
15451
|
-
messages: ({
|
|
15452
|
-
role: "system";
|
|
15453
|
-
content: string | {
|
|
15454
|
-
type: "text";
|
|
15455
|
-
text: string;
|
|
15456
|
-
cache_control?: {
|
|
15457
|
-
type: "ephemeral";
|
|
15458
|
-
} | undefined;
|
|
15459
|
-
}[];
|
|
15460
|
-
name?: string | undefined;
|
|
15461
|
-
} | {
|
|
15462
|
-
role: "user";
|
|
15463
|
-
content: string | ({
|
|
15464
|
-
type: "text";
|
|
15465
|
-
text: string;
|
|
15466
|
-
cache_control?: {
|
|
15467
|
-
type: "ephemeral";
|
|
15468
|
-
} | undefined;
|
|
15469
|
-
} | {
|
|
15470
|
-
type: "image_url";
|
|
15471
|
-
image_url: {
|
|
15472
|
-
url: string;
|
|
15473
|
-
detail?: "auto" | "low" | "high" | undefined;
|
|
15474
|
-
};
|
|
15475
|
-
} | {
|
|
15476
|
-
type: "file";
|
|
15477
|
-
file: {
|
|
15478
|
-
filename?: string | undefined;
|
|
15479
|
-
file_data?: string | undefined;
|
|
15480
|
-
file_id?: string | undefined;
|
|
15481
|
-
};
|
|
15482
|
-
})[];
|
|
15483
|
-
name?: string | undefined;
|
|
15484
|
-
} | {
|
|
15485
|
-
role: "assistant";
|
|
15486
|
-
name?: string | undefined;
|
|
15487
|
-
function_call?: {
|
|
15488
|
-
name: string;
|
|
15489
|
-
arguments: string;
|
|
15490
|
-
} | undefined;
|
|
15491
|
-
content?: string | {
|
|
15492
|
-
type: "text";
|
|
15493
|
-
text: string;
|
|
15494
|
-
cache_control?: {
|
|
15495
|
-
type: "ephemeral";
|
|
15496
|
-
} | undefined;
|
|
15497
|
-
}[] | null | undefined;
|
|
15498
|
-
tool_calls?: {
|
|
15499
|
-
function: {
|
|
15500
|
-
name: string;
|
|
15501
|
-
arguments: string;
|
|
15502
|
-
};
|
|
15503
|
-
type: "function";
|
|
15504
|
-
id: string;
|
|
15505
|
-
}[] | undefined;
|
|
15506
|
-
reasoning?: {
|
|
15507
|
-
id?: string | undefined;
|
|
15508
|
-
content?: string | undefined;
|
|
15509
|
-
}[] | undefined;
|
|
15510
|
-
reasoning_signature?: string | undefined;
|
|
15511
|
-
} | {
|
|
15512
|
-
role: "tool";
|
|
15513
|
-
content: string | {
|
|
15514
|
-
type: "text";
|
|
15515
|
-
text: string;
|
|
15516
|
-
cache_control?: {
|
|
15517
|
-
type: "ephemeral";
|
|
15518
|
-
} | undefined;
|
|
15519
|
-
}[];
|
|
15520
|
-
tool_call_id: string;
|
|
15521
|
-
} | {
|
|
15522
|
-
role: "function";
|
|
15523
|
-
name: string;
|
|
15524
|
-
content: string | null;
|
|
15525
|
-
} | {
|
|
15526
|
-
role: "developer";
|
|
15527
|
-
content: string | {
|
|
15528
|
-
type: "text";
|
|
15529
|
-
text: string;
|
|
15530
|
-
cache_control?: {
|
|
15531
|
-
type: "ephemeral";
|
|
15532
|
-
} | undefined;
|
|
15533
|
-
}[];
|
|
15534
|
-
name?: string | undefined;
|
|
15535
|
-
} | {
|
|
15536
|
-
role: "model";
|
|
15537
|
-
content?: string | null | undefined;
|
|
15538
|
-
})[];
|
|
15539
|
-
tools?: string | undefined;
|
|
15540
|
-
} | {
|
|
15541
|
-
type: "completion";
|
|
15542
|
-
content: string;
|
|
15543
|
-
} | null | undefined;
|
|
15544
|
-
origin?: {
|
|
15545
|
-
project_id?: string | undefined;
|
|
15546
|
-
prompt_id?: string | undefined;
|
|
15547
|
-
prompt_version?: string | undefined;
|
|
15548
|
-
} | null | undefined;
|
|
15549
|
-
parser?: {
|
|
15550
|
-
type: "llm_classifier";
|
|
15551
|
-
use_cot: boolean;
|
|
15552
|
-
choice_scores?: Record<string, number> | undefined;
|
|
15553
|
-
choice?: string[] | undefined;
|
|
15554
|
-
allow_no_match?: boolean | undefined;
|
|
15555
|
-
} | null | undefined;
|
|
15556
|
-
tool_functions?: ({
|
|
15557
|
-
type: "function";
|
|
15558
|
-
id: string;
|
|
15559
|
-
version?: string | undefined;
|
|
15560
|
-
} | {
|
|
15561
|
-
type: "global";
|
|
15562
|
-
name: string;
|
|
15563
|
-
function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
|
|
15564
|
-
})[] | null | undefined;
|
|
15565
|
-
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
15566
|
-
mcp?: Record<string, {
|
|
15567
|
-
type: "id";
|
|
15568
|
-
id: string;
|
|
15569
|
-
is_disabled?: boolean | undefined;
|
|
15570
|
-
enabled_tools?: string[] | null | undefined;
|
|
15571
|
-
} | {
|
|
15572
|
-
type: "url";
|
|
15573
|
-
url: string;
|
|
15574
|
-
is_disabled?: boolean | undefined;
|
|
15575
|
-
enabled_tools?: string[] | null | undefined;
|
|
15576
|
-
}> | null | undefined;
|
|
15577
|
-
} | null | undefined;
|
|
15578
|
-
}, {
|
|
15579
|
-
id: string;
|
|
15580
15936
|
org_id: string;
|
|
15581
|
-
name: string;
|
|
15582
|
-
project_id: string;
|
|
15583
15937
|
_xact_id: string;
|
|
15584
|
-
slug: string;
|
|
15585
15938
|
log_id: "p";
|
|
15586
15939
|
created?: string | null | undefined;
|
|
15587
|
-
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
15588
15940
|
description?: string | null | undefined;
|
|
15941
|
+
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
15589
15942
|
function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | null | undefined;
|
|
15590
15943
|
tags?: string[] | null | undefined;
|
|
15591
15944
|
prompt_data?: {
|
|
15592
15945
|
options?: {
|
|
15593
|
-
params?: z.
|
|
15946
|
+
params?: z.objectOutputType<{
|
|
15947
|
+
use_cache: z.ZodOptional<z.ZodBoolean>;
|
|
15948
|
+
reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
15949
|
+
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
15950
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
15951
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
15952
|
+
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
15953
|
+
max_completion_tokens: z.ZodOptional<z.ZodNumber>;
|
|
15954
|
+
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
15955
|
+
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
15956
|
+
response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
15957
|
+
type: z.ZodLiteral<"json_object">;
|
|
15958
|
+
}, "strip", z.ZodTypeAny, {
|
|
15959
|
+
type: "json_object";
|
|
15960
|
+
}, {
|
|
15961
|
+
type: "json_object";
|
|
15962
|
+
}>, z.ZodObject<{
|
|
15963
|
+
type: z.ZodLiteral<"json_schema">;
|
|
15964
|
+
json_schema: z.ZodObject<{
|
|
15965
|
+
name: z.ZodString;
|
|
15966
|
+
description: z.ZodOptional<z.ZodString>;
|
|
15967
|
+
schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
|
|
15968
|
+
strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
|
|
15969
|
+
}, "strip", z.ZodTypeAny, {
|
|
15970
|
+
name: string;
|
|
15971
|
+
description?: string | undefined;
|
|
15972
|
+
schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
15973
|
+
strict?: boolean | null | undefined;
|
|
15974
|
+
}, {
|
|
15975
|
+
name: string;
|
|
15976
|
+
description?: string | undefined;
|
|
15977
|
+
schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
15978
|
+
strict?: boolean | null | undefined;
|
|
15979
|
+
}>;
|
|
15980
|
+
}, "strip", z.ZodTypeAny, {
|
|
15981
|
+
type: "json_schema";
|
|
15982
|
+
json_schema: {
|
|
15983
|
+
name: string;
|
|
15984
|
+
description?: string | undefined;
|
|
15985
|
+
schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
15986
|
+
strict?: boolean | null | undefined;
|
|
15987
|
+
};
|
|
15988
|
+
}, {
|
|
15989
|
+
type: "json_schema";
|
|
15990
|
+
json_schema: {
|
|
15991
|
+
name: string;
|
|
15992
|
+
description?: string | undefined;
|
|
15993
|
+
schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
15994
|
+
strict?: boolean | null | undefined;
|
|
15995
|
+
};
|
|
15996
|
+
}>, z.ZodObject<{
|
|
15997
|
+
type: z.ZodLiteral<"text">;
|
|
15998
|
+
}, "strip", z.ZodTypeAny, {
|
|
15999
|
+
type: "text";
|
|
16000
|
+
}, {
|
|
16001
|
+
type: "text";
|
|
16002
|
+
}>, z.ZodNull]>>;
|
|
16003
|
+
tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
|
|
16004
|
+
type: z.ZodLiteral<"function">;
|
|
16005
|
+
function: z.ZodObject<{
|
|
16006
|
+
name: z.ZodString;
|
|
16007
|
+
}, "strip", z.ZodTypeAny, {
|
|
16008
|
+
name: string;
|
|
16009
|
+
}, {
|
|
16010
|
+
name: string;
|
|
16011
|
+
}>;
|
|
16012
|
+
}, "strip", z.ZodTypeAny, {
|
|
16013
|
+
function: {
|
|
16014
|
+
name: string;
|
|
16015
|
+
};
|
|
16016
|
+
type: "function";
|
|
16017
|
+
}, {
|
|
16018
|
+
function: {
|
|
16019
|
+
name: string;
|
|
16020
|
+
};
|
|
16021
|
+
type: "function";
|
|
16022
|
+
}>]>>;
|
|
16023
|
+
function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
|
|
16024
|
+
name: z.ZodString;
|
|
16025
|
+
}, "strip", z.ZodTypeAny, {
|
|
16026
|
+
name: string;
|
|
16027
|
+
}, {
|
|
16028
|
+
name: string;
|
|
16029
|
+
}>]>>;
|
|
16030
|
+
n: z.ZodOptional<z.ZodNumber>;
|
|
16031
|
+
stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
16032
|
+
reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
|
|
16033
|
+
verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
16034
|
+
}, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
|
|
16035
|
+
use_cache: z.ZodOptional<z.ZodBoolean>;
|
|
16036
|
+
reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
16037
|
+
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
16038
|
+
max_tokens: z.ZodNumber;
|
|
16039
|
+
temperature: z.ZodNumber;
|
|
16040
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
16041
|
+
top_k: z.ZodOptional<z.ZodNumber>;
|
|
16042
|
+
stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
16043
|
+
max_tokens_to_sample: z.ZodOptional<z.ZodNumber>;
|
|
16044
|
+
}, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
|
|
16045
|
+
use_cache: z.ZodOptional<z.ZodBoolean>;
|
|
16046
|
+
reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
16047
|
+
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
16048
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
16049
|
+
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
16050
|
+
topP: z.ZodOptional<z.ZodNumber>;
|
|
16051
|
+
topK: z.ZodOptional<z.ZodNumber>;
|
|
16052
|
+
}, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
|
|
16053
|
+
use_cache: z.ZodOptional<z.ZodBoolean>;
|
|
16054
|
+
reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
16055
|
+
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
16056
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
16057
|
+
topK: z.ZodOptional<z.ZodNumber>;
|
|
16058
|
+
}, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
|
|
16059
|
+
use_cache: z.ZodOptional<z.ZodBoolean>;
|
|
16060
|
+
reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
16061
|
+
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
16062
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
16063
|
+
model?: string | undefined;
|
|
16064
|
+
position?: string | undefined;
|
|
16065
|
+
} | null | undefined;
|
|
16066
|
+
prompt?: {
|
|
16067
|
+
type: "chat";
|
|
16068
|
+
messages: ({
|
|
16069
|
+
role: "system";
|
|
16070
|
+
content: string | {
|
|
16071
|
+
type: "text";
|
|
16072
|
+
text: string;
|
|
16073
|
+
cache_control?: {
|
|
16074
|
+
type: "ephemeral";
|
|
16075
|
+
} | undefined;
|
|
16076
|
+
}[];
|
|
16077
|
+
name?: string | undefined;
|
|
16078
|
+
} | {
|
|
16079
|
+
role: "user";
|
|
16080
|
+
content: string | ({
|
|
16081
|
+
type: "text";
|
|
16082
|
+
text: string;
|
|
16083
|
+
cache_control?: {
|
|
16084
|
+
type: "ephemeral";
|
|
16085
|
+
} | undefined;
|
|
16086
|
+
} | {
|
|
16087
|
+
type: "image_url";
|
|
16088
|
+
image_url: {
|
|
16089
|
+
url: string;
|
|
16090
|
+
detail?: "auto" | "low" | "high" | undefined;
|
|
16091
|
+
};
|
|
16092
|
+
} | {
|
|
16093
|
+
type: "file";
|
|
16094
|
+
file: {
|
|
16095
|
+
filename?: string | undefined;
|
|
16096
|
+
file_data?: string | undefined;
|
|
16097
|
+
file_id?: string | undefined;
|
|
16098
|
+
};
|
|
16099
|
+
})[];
|
|
16100
|
+
name?: string | undefined;
|
|
16101
|
+
} | {
|
|
16102
|
+
role: "assistant";
|
|
16103
|
+
name?: string | undefined;
|
|
16104
|
+
function_call?: {
|
|
16105
|
+
name: string;
|
|
16106
|
+
arguments: string;
|
|
16107
|
+
} | undefined;
|
|
16108
|
+
content?: string | {
|
|
16109
|
+
type: "text";
|
|
16110
|
+
text: string;
|
|
16111
|
+
cache_control?: {
|
|
16112
|
+
type: "ephemeral";
|
|
16113
|
+
} | undefined;
|
|
16114
|
+
}[] | null | undefined;
|
|
16115
|
+
tool_calls?: {
|
|
16116
|
+
function: {
|
|
16117
|
+
name: string;
|
|
16118
|
+
arguments: string;
|
|
16119
|
+
};
|
|
16120
|
+
type: "function";
|
|
16121
|
+
id: string;
|
|
16122
|
+
}[] | undefined;
|
|
16123
|
+
reasoning?: {
|
|
16124
|
+
id?: string | undefined;
|
|
16125
|
+
content?: string | undefined;
|
|
16126
|
+
}[] | undefined;
|
|
16127
|
+
reasoning_signature?: string | undefined;
|
|
16128
|
+
} | {
|
|
16129
|
+
role: "tool";
|
|
16130
|
+
content: string | {
|
|
16131
|
+
type: "text";
|
|
16132
|
+
text: string;
|
|
16133
|
+
cache_control?: {
|
|
16134
|
+
type: "ephemeral";
|
|
16135
|
+
} | undefined;
|
|
16136
|
+
}[];
|
|
16137
|
+
tool_call_id: string;
|
|
16138
|
+
} | {
|
|
16139
|
+
role: "function";
|
|
16140
|
+
name: string;
|
|
16141
|
+
content: string | null;
|
|
16142
|
+
} | {
|
|
16143
|
+
role: "developer";
|
|
16144
|
+
content: string | {
|
|
16145
|
+
type: "text";
|
|
16146
|
+
text: string;
|
|
16147
|
+
cache_control?: {
|
|
16148
|
+
type: "ephemeral";
|
|
16149
|
+
} | undefined;
|
|
16150
|
+
}[];
|
|
16151
|
+
name?: string | undefined;
|
|
16152
|
+
} | {
|
|
16153
|
+
role: "model";
|
|
16154
|
+
content?: string | null | undefined;
|
|
16155
|
+
})[];
|
|
16156
|
+
tools?: string | undefined;
|
|
16157
|
+
} | {
|
|
16158
|
+
type: "completion";
|
|
16159
|
+
content: string;
|
|
16160
|
+
} | null | undefined;
|
|
16161
|
+
origin?: {
|
|
16162
|
+
project_id?: string | undefined;
|
|
16163
|
+
prompt_id?: string | undefined;
|
|
16164
|
+
prompt_version?: string | undefined;
|
|
16165
|
+
} | null | undefined;
|
|
16166
|
+
parser?: {
|
|
16167
|
+
type: "llm_classifier";
|
|
16168
|
+
use_cot: boolean;
|
|
16169
|
+
choice_scores?: Record<string, number> | undefined;
|
|
16170
|
+
choice?: string[] | undefined;
|
|
16171
|
+
allow_no_match?: boolean | undefined;
|
|
16172
|
+
allow_skip?: boolean | undefined;
|
|
16173
|
+
} | null | undefined;
|
|
16174
|
+
tool_functions?: ({
|
|
16175
|
+
type: "function";
|
|
16176
|
+
id: string;
|
|
16177
|
+
version?: string | undefined;
|
|
16178
|
+
} | {
|
|
16179
|
+
type: "global";
|
|
16180
|
+
name: string;
|
|
16181
|
+
function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
|
|
16182
|
+
})[] | null | undefined;
|
|
16183
|
+
template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
|
|
16184
|
+
mcp?: Record<string, {
|
|
16185
|
+
type: "id";
|
|
16186
|
+
id: string;
|
|
16187
|
+
is_disabled?: boolean | undefined;
|
|
16188
|
+
enabled_tools?: string[] | null | undefined;
|
|
16189
|
+
} | {
|
|
16190
|
+
type: "url";
|
|
16191
|
+
url: string;
|
|
16192
|
+
is_disabled?: boolean | undefined;
|
|
16193
|
+
enabled_tools?: string[] | null | undefined;
|
|
16194
|
+
}> | null | undefined;
|
|
16195
|
+
} | null | undefined;
|
|
16196
|
+
}, {
|
|
16197
|
+
id: string;
|
|
16198
|
+
project_id: string;
|
|
16199
|
+
name: string;
|
|
16200
|
+
slug: string;
|
|
16201
|
+
org_id: string;
|
|
16202
|
+
_xact_id: string;
|
|
16203
|
+
log_id: "p";
|
|
16204
|
+
created?: string | null | undefined;
|
|
16205
|
+
description?: string | null | undefined;
|
|
16206
|
+
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
16207
|
+
function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | null | undefined;
|
|
16208
|
+
tags?: string[] | null | undefined;
|
|
16209
|
+
prompt_data?: {
|
|
16210
|
+
options?: {
|
|
16211
|
+
params?: z.objectInputType<{
|
|
15594
16212
|
use_cache: z.ZodOptional<z.ZodBoolean>;
|
|
15595
16213
|
reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
15596
16214
|
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
@@ -15816,6 +16434,7 @@ declare const Prompt$1: z.ZodObject<{
|
|
|
15816
16434
|
choice_scores?: Record<string, number> | undefined;
|
|
15817
16435
|
choice?: string[] | undefined;
|
|
15818
16436
|
allow_no_match?: boolean | undefined;
|
|
16437
|
+
allow_skip?: boolean | undefined;
|
|
15819
16438
|
} | null | undefined;
|
|
15820
16439
|
tool_functions?: ({
|
|
15821
16440
|
type: "function";
|
|
@@ -15981,6 +16600,91 @@ declare const ToolFunctionDefinition: z.ZodObject<{
|
|
|
15981
16600
|
}>;
|
|
15982
16601
|
type ToolFunctionDefinitionType = z.infer<typeof ToolFunctionDefinition>;
|
|
15983
16602
|
|
|
16603
|
+
type TemplateFormat = "mustache" | "nunjucks" | "none";
|
|
16604
|
+
interface TemplateRenderer {
|
|
16605
|
+
render: (template: string, variables: Record<string, unknown>, escape: (v: unknown) => string, strict: boolean) => string;
|
|
16606
|
+
lint?: (template: string, variables: Record<string, unknown>) => void;
|
|
16607
|
+
}
|
|
16608
|
+
/**
|
|
16609
|
+
* A template renderer plugin that can be registered with Braintrust.
|
|
16610
|
+
*
|
|
16611
|
+
* Plugins provide support for different template engines (e.g., Nunjucks).
|
|
16612
|
+
* They use a factory pattern where the plugin is registered once, then activated with specific
|
|
16613
|
+
* configuration options when needed.
|
|
16614
|
+
*
|
|
16615
|
+
* @example
|
|
16616
|
+
* ```typescript
|
|
16617
|
+
* import type { TemplateRendererPlugin } from "braintrust";
|
|
16618
|
+
*
|
|
16619
|
+
* export const myPlugin: TemplateRendererPlugin = {
|
|
16620
|
+
* name: "my-template-engine",
|
|
16621
|
+
* version: "1.0.0",
|
|
16622
|
+
* defaultOptions: { strict: false },
|
|
16623
|
+
* createRenderer(options?: unknown) {
|
|
16624
|
+
* const opts = options ?? this.defaultOptions;
|
|
16625
|
+
* return {
|
|
16626
|
+
* render(template, variables, escape, strict) {
|
|
16627
|
+
* // Your rendering logic here
|
|
16628
|
+
* }
|
|
16629
|
+
* };
|
|
16630
|
+
* }
|
|
16631
|
+
* };
|
|
16632
|
+
* ```
|
|
16633
|
+
*/
|
|
16634
|
+
interface TemplateRendererPlugin {
|
|
16635
|
+
/**
|
|
16636
|
+
* Unique identifier for this plugin.
|
|
16637
|
+
* Must match the format string used in `templateFormat` option.
|
|
16638
|
+
*/
|
|
16639
|
+
name: string;
|
|
16640
|
+
/**
|
|
16641
|
+
* Factory function that creates a renderer instance.
|
|
16642
|
+
*
|
|
16643
|
+
* @param options - If not provided, `defaultOptions` is used.
|
|
16644
|
+
* @returns A configured TemplateRenderer instance
|
|
16645
|
+
*/
|
|
16646
|
+
createRenderer: () => TemplateRenderer;
|
|
16647
|
+
/**
|
|
16648
|
+
* Default configuration options for this plugin.
|
|
16649
|
+
*/
|
|
16650
|
+
defaultOptions?: unknown;
|
|
16651
|
+
}
|
|
16652
|
+
declare class TemplatePluginRegistry {
|
|
16653
|
+
private plugins;
|
|
16654
|
+
register(plugin: TemplateRendererPlugin): void;
|
|
16655
|
+
getAvailable(): string[];
|
|
16656
|
+
get(name: string): TemplateRenderer | undefined;
|
|
16657
|
+
isRegistered(name: string): boolean;
|
|
16658
|
+
}
|
|
16659
|
+
declare const templateRegistry: TemplatePluginRegistry;
|
|
16660
|
+
/**
|
|
16661
|
+
* Register a template plugin and optionally activate it
|
|
16662
|
+
*
|
|
16663
|
+
* If `options` is provided it will be used to create the active renderer.
|
|
16664
|
+
* If `options` is omitted but the plugin defines `defaultOptions`, the
|
|
16665
|
+
* registry will activate the renderer using those defaults.
|
|
16666
|
+
*/
|
|
16667
|
+
declare const registerTemplatePlugin: (plugin: TemplateRendererPlugin) => void;
|
|
16668
|
+
/**
|
|
16669
|
+
* Gets an active template renderer by name.
|
|
16670
|
+
*
|
|
16671
|
+
* Returns `undefined` if the renderer is not active.
|
|
16672
|
+
*
|
|
16673
|
+
* @param name - Name of the renderer to retrieve
|
|
16674
|
+
* @returns The active renderer, or undefined if not activated
|
|
16675
|
+
*
|
|
16676
|
+
* @example
|
|
16677
|
+
* ```typescript
|
|
16678
|
+
* import { getTemplateRenderer } from "braintrust";
|
|
16679
|
+
*
|
|
16680
|
+
* const renderer = getTemplateRenderer("nunjucks");
|
|
16681
|
+
* if (renderer) {
|
|
16682
|
+
* const output = renderer.render(template, variables, escape, strict);
|
|
16683
|
+
* }
|
|
16684
|
+
* ```
|
|
16685
|
+
*/
|
|
16686
|
+
declare const getTemplateRenderer: (name: string) => TemplateRenderer | undefined;
|
|
16687
|
+
|
|
15984
16688
|
interface CallerLocation {
|
|
15985
16689
|
caller_functionname: string;
|
|
15986
16690
|
caller_filename: string;
|
|
@@ -16069,558 +16773,6 @@ interface Common {
|
|
|
16069
16773
|
}
|
|
16070
16774
|
declare const iso: Common;
|
|
16071
16775
|
|
|
16072
|
-
type DebugLogLevel = "error" | "warn" | "info" | "debug";
|
|
16073
|
-
type DebugLogLevelOption = DebugLogLevel | false | undefined;
|
|
16074
|
-
declare function resetDebugLoggerForTests(): void;
|
|
16075
|
-
|
|
16076
|
-
/**
|
|
16077
|
-
* Abstract base class for ID generators
|
|
16078
|
-
*/
|
|
16079
|
-
declare abstract class IDGenerator {
|
|
16080
|
-
/**
|
|
16081
|
-
* Generate a span ID
|
|
16082
|
-
*/
|
|
16083
|
-
abstract getSpanId(): string;
|
|
16084
|
-
/**
|
|
16085
|
-
* Generate a trace ID
|
|
16086
|
-
*/
|
|
16087
|
-
abstract getTraceId(): string;
|
|
16088
|
-
/**
|
|
16089
|
-
* Return true if the generator should use span_id as root_span_id for backwards compatibility
|
|
16090
|
-
*/
|
|
16091
|
-
abstract shareRootSpanId(): boolean;
|
|
16092
|
-
}
|
|
16093
|
-
/**
|
|
16094
|
-
* ID generator that uses UUID4 for both span and trace IDs
|
|
16095
|
-
*/
|
|
16096
|
-
declare class UUIDGenerator extends IDGenerator {
|
|
16097
|
-
getSpanId(): string;
|
|
16098
|
-
getTraceId(): string;
|
|
16099
|
-
shareRootSpanId(): boolean;
|
|
16100
|
-
}
|
|
16101
|
-
/**
|
|
16102
|
-
* Factory function that creates a new ID generator instance each time.
|
|
16103
|
-
*
|
|
16104
|
-
* This eliminates global state and makes tests parallelizable.
|
|
16105
|
-
* Each caller gets their own generator instance.
|
|
16106
|
-
*/
|
|
16107
|
-
declare function getIdGenerator(): IDGenerator;
|
|
16108
|
-
|
|
16109
|
-
declare const TRANSACTION_ID_FIELD = "_xact_id";
|
|
16110
|
-
declare const IS_MERGE_FIELD = "_is_merge";
|
|
16111
|
-
declare const MERGE_PATHS_FIELD = "_merge_paths";
|
|
16112
|
-
declare const AUDIT_SOURCE_FIELD = "_audit_source";
|
|
16113
|
-
declare const AUDIT_METADATA_FIELD = "_audit_metadata";
|
|
16114
|
-
declare const VALID_SOURCES: readonly ["app", "api", "external"];
|
|
16115
|
-
type Source = (typeof VALID_SOURCES)[number];
|
|
16116
|
-
declare const ASYNC_SCORING_CONTROL_FIELD = "_async_scoring_control";
|
|
16117
|
-
declare const SKIP_ASYNC_SCORING_FIELD = "_skip_async_scoring";
|
|
16118
|
-
type TransactionId = string;
|
|
16119
|
-
|
|
16120
|
-
declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
|
|
16121
|
-
kind: z.ZodLiteral<"score_update">;
|
|
16122
|
-
token: z.ZodOptional<z.ZodString>;
|
|
16123
|
-
}, "strip", z.ZodTypeAny, {
|
|
16124
|
-
kind: "score_update";
|
|
16125
|
-
token?: string | undefined;
|
|
16126
|
-
}, {
|
|
16127
|
-
kind: "score_update";
|
|
16128
|
-
token?: string | undefined;
|
|
16129
|
-
}>, z.ZodObject<{
|
|
16130
|
-
kind: z.ZodLiteral<"state_override">;
|
|
16131
|
-
state: z.ZodUnion<[z.ZodObject<{
|
|
16132
|
-
status: z.ZodLiteral<"enabled">;
|
|
16133
|
-
token: z.ZodString;
|
|
16134
|
-
function_ids: z.ZodArray<z.ZodUnknown, "many">;
|
|
16135
|
-
skip_logging: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
|
|
16136
|
-
}, "strip", z.ZodTypeAny, {
|
|
16137
|
-
status: "enabled";
|
|
16138
|
-
token: string;
|
|
16139
|
-
function_ids: unknown[];
|
|
16140
|
-
skip_logging?: boolean | null | undefined;
|
|
16141
|
-
}, {
|
|
16142
|
-
status: "enabled";
|
|
16143
|
-
token: string;
|
|
16144
|
-
function_ids: unknown[];
|
|
16145
|
-
skip_logging?: boolean | null | undefined;
|
|
16146
|
-
}>, z.ZodObject<{
|
|
16147
|
-
status: z.ZodLiteral<"disabled">;
|
|
16148
|
-
}, "strip", z.ZodTypeAny, {
|
|
16149
|
-
status: "disabled";
|
|
16150
|
-
}, {
|
|
16151
|
-
status: "disabled";
|
|
16152
|
-
}>, z.ZodNull, z.ZodNull]>;
|
|
16153
|
-
}, "strip", z.ZodTypeAny, {
|
|
16154
|
-
kind: "state_override";
|
|
16155
|
-
state: {
|
|
16156
|
-
status: "enabled";
|
|
16157
|
-
token: string;
|
|
16158
|
-
function_ids: unknown[];
|
|
16159
|
-
skip_logging?: boolean | null | undefined;
|
|
16160
|
-
} | {
|
|
16161
|
-
status: "disabled";
|
|
16162
|
-
} | null;
|
|
16163
|
-
}, {
|
|
16164
|
-
kind: "state_override";
|
|
16165
|
-
state: {
|
|
16166
|
-
status: "enabled";
|
|
16167
|
-
token: string;
|
|
16168
|
-
function_ids: unknown[];
|
|
16169
|
-
skip_logging?: boolean | null | undefined;
|
|
16170
|
-
} | {
|
|
16171
|
-
status: "disabled";
|
|
16172
|
-
} | null;
|
|
16173
|
-
}>, z.ZodObject<{
|
|
16174
|
-
kind: z.ZodLiteral<"state_force_reselect">;
|
|
16175
|
-
}, "strip", z.ZodTypeAny, {
|
|
16176
|
-
kind: "state_force_reselect";
|
|
16177
|
-
}, {
|
|
16178
|
-
kind: "state_force_reselect";
|
|
16179
|
-
}>, z.ZodObject<{
|
|
16180
|
-
kind: z.ZodLiteral<"state_enabled_force_rescore">;
|
|
16181
|
-
}, "strip", z.ZodTypeAny, {
|
|
16182
|
-
kind: "state_enabled_force_rescore";
|
|
16183
|
-
}, {
|
|
16184
|
-
kind: "state_enabled_force_rescore";
|
|
16185
|
-
}>, z.ZodObject<{
|
|
16186
|
-
kind: z.ZodLiteral<"add_triggered_functions">;
|
|
16187
|
-
triggered_function_ids: z.ZodArray<z.ZodUnknown, "many">;
|
|
16188
|
-
}, "strip", z.ZodTypeAny, {
|
|
16189
|
-
kind: "add_triggered_functions";
|
|
16190
|
-
triggered_function_ids: unknown[];
|
|
16191
|
-
}, {
|
|
16192
|
-
kind: "add_triggered_functions";
|
|
16193
|
-
triggered_function_ids: unknown[];
|
|
16194
|
-
}>, z.ZodObject<{
|
|
16195
|
-
kind: z.ZodLiteral<"complete_triggered_functions">;
|
|
16196
|
-
function_ids: z.ZodArray<z.ZodUnknown, "many">;
|
|
16197
|
-
triggered_xact_id: z.ZodString;
|
|
16198
|
-
}, "strip", z.ZodTypeAny, {
|
|
16199
|
-
triggered_xact_id: string;
|
|
16200
|
-
function_ids: unknown[];
|
|
16201
|
-
kind: "complete_triggered_functions";
|
|
16202
|
-
}, {
|
|
16203
|
-
triggered_xact_id: string;
|
|
16204
|
-
function_ids: unknown[];
|
|
16205
|
-
kind: "complete_triggered_functions";
|
|
16206
|
-
}>]>;
|
|
16207
|
-
type AsyncScoringControlType = z.infer<typeof AsyncScoringControl>;
|
|
16208
|
-
declare const ObjectReference: z.ZodObject<{
|
|
16209
|
-
object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
|
|
16210
|
-
object_id: z.ZodString;
|
|
16211
|
-
id: z.ZodString;
|
|
16212
|
-
_xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
16213
|
-
created: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
16214
|
-
}, "strip", z.ZodTypeAny, {
|
|
16215
|
-
id: string;
|
|
16216
|
-
object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
|
|
16217
|
-
object_id: string;
|
|
16218
|
-
created?: string | null | undefined;
|
|
16219
|
-
_xact_id?: string | null | undefined;
|
|
16220
|
-
}, {
|
|
16221
|
-
id: string;
|
|
16222
|
-
object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
|
|
16223
|
-
object_id: string;
|
|
16224
|
-
created?: string | null | undefined;
|
|
16225
|
-
_xact_id?: string | null | undefined;
|
|
16226
|
-
}>;
|
|
16227
|
-
type ObjectReferenceType = z.infer<typeof ObjectReference>;
|
|
16228
|
-
|
|
16229
|
-
type IdField = {
|
|
16230
|
-
id: string;
|
|
16231
|
-
};
|
|
16232
|
-
type InputField = {
|
|
16233
|
-
input: unknown;
|
|
16234
|
-
};
|
|
16235
|
-
type OtherExperimentLogFields = {
|
|
16236
|
-
output: unknown;
|
|
16237
|
-
expected: unknown;
|
|
16238
|
-
error: unknown;
|
|
16239
|
-
tags: string[];
|
|
16240
|
-
scores: Record<string, number | null>;
|
|
16241
|
-
classifications?: Record<string, {
|
|
16242
|
-
id: string;
|
|
16243
|
-
label?: string;
|
|
16244
|
-
}[]>;
|
|
16245
|
-
metadata: Record<string, unknown>;
|
|
16246
|
-
metrics: Record<string, unknown>;
|
|
16247
|
-
datasetRecordId: string;
|
|
16248
|
-
origin: ObjectReferenceType;
|
|
16249
|
-
span_attributes: Record<string, unknown>;
|
|
16250
|
-
[ASYNC_SCORING_CONTROL_FIELD]: AsyncScoringControlType;
|
|
16251
|
-
[MERGE_PATHS_FIELD]: string[][];
|
|
16252
|
-
[SKIP_ASYNC_SCORING_FIELD]: boolean;
|
|
16253
|
-
};
|
|
16254
|
-
type ExperimentLogPartialArgs = Partial<OtherExperimentLogFields> & Partial<InputField>;
|
|
16255
|
-
type ExperimentLogFullArgs = Partial<Omit<OtherExperimentLogFields, "output" | "scores">> & Required<Pick<OtherExperimentLogFields, "output" | "scores">> & Partial<InputField> & Partial<IdField>;
|
|
16256
|
-
type LogFeedbackFullArgs = IdField & Partial<Omit<OtherExperimentLogFields, "output" | "metrics" | "datasetRecordId"> & {
|
|
16257
|
-
comment: string;
|
|
16258
|
-
source: Source;
|
|
16259
|
-
}>;
|
|
16260
|
-
interface ParentExperimentIds {
|
|
16261
|
-
experiment_id: string;
|
|
16262
|
-
}
|
|
16263
|
-
interface ParentProjectLogIds {
|
|
16264
|
-
project_id: string;
|
|
16265
|
-
log_id: "g";
|
|
16266
|
-
}
|
|
16267
|
-
interface ParentPlaygroundLogIds {
|
|
16268
|
-
prompt_session_id: string;
|
|
16269
|
-
log_id: "x";
|
|
16270
|
-
}
|
|
16271
|
-
type LogCommentFullArgs = IdField & {
|
|
16272
|
-
created: string;
|
|
16273
|
-
origin: {
|
|
16274
|
-
id: string;
|
|
16275
|
-
};
|
|
16276
|
-
comment: {
|
|
16277
|
-
text: string;
|
|
16278
|
-
};
|
|
16279
|
-
[AUDIT_SOURCE_FIELD]: Source;
|
|
16280
|
-
[AUDIT_METADATA_FIELD]?: Record<string, unknown>;
|
|
16281
|
-
} & (ParentExperimentIds | ParentProjectLogIds);
|
|
16282
|
-
type ExperimentEvent = Partial<InputField> & Partial<OtherExperimentLogFields> & {
|
|
16283
|
-
id: string;
|
|
16284
|
-
span_id?: string;
|
|
16285
|
-
root_span_id?: string;
|
|
16286
|
-
experiment_id: string;
|
|
16287
|
-
[IS_MERGE_FIELD]: boolean;
|
|
16288
|
-
} & Partial<{
|
|
16289
|
-
created: string;
|
|
16290
|
-
span_parents: string[];
|
|
16291
|
-
span_attributes: Record<string, unknown>;
|
|
16292
|
-
context: Record<string, unknown>;
|
|
16293
|
-
[AUDIT_SOURCE_FIELD]: Source;
|
|
16294
|
-
[AUDIT_METADATA_FIELD]?: Record<string, unknown>;
|
|
16295
|
-
}>;
|
|
16296
|
-
type DatasetEvent = {
|
|
16297
|
-
input?: unknown;
|
|
16298
|
-
tags?: string[];
|
|
16299
|
-
metadata?: unknown;
|
|
16300
|
-
created?: string;
|
|
16301
|
-
origin?: ObjectReferenceType;
|
|
16302
|
-
id: string;
|
|
16303
|
-
dataset_id: string;
|
|
16304
|
-
} & ({
|
|
16305
|
-
expected?: unknown;
|
|
16306
|
-
} | {
|
|
16307
|
-
output?: unknown;
|
|
16308
|
-
});
|
|
16309
|
-
type LoggingEvent = Omit<ExperimentEvent, "experiment_id"> & {
|
|
16310
|
-
project_id: string;
|
|
16311
|
-
log_id: "g";
|
|
16312
|
-
};
|
|
16313
|
-
type PlaygroundLogEvent = Omit<ExperimentEvent, "experiment_id"> & {
|
|
16314
|
-
prompt_session_id: string;
|
|
16315
|
-
log_id: "x";
|
|
16316
|
-
};
|
|
16317
|
-
type CommentEvent = IdField & {
|
|
16318
|
-
created: string;
|
|
16319
|
-
origin: {
|
|
16320
|
-
id: string;
|
|
16321
|
-
};
|
|
16322
|
-
comment: {
|
|
16323
|
-
text: string;
|
|
16324
|
-
};
|
|
16325
|
-
[AUDIT_SOURCE_FIELD]: Source;
|
|
16326
|
-
[AUDIT_METADATA_FIELD]?: Record<string, unknown>;
|
|
16327
|
-
} & (ParentExperimentIds | ParentProjectLogIds | ParentPlaygroundLogIds);
|
|
16328
|
-
type BackgroundLogEvent = ExperimentEvent | DatasetEvent | LoggingEvent | PlaygroundLogEvent | CommentEvent;
|
|
16329
|
-
declare const DEFAULT_IS_LEGACY_DATASET = false;
|
|
16330
|
-
interface LegacyDatasetRecord {
|
|
16331
|
-
id: string;
|
|
16332
|
-
input: any;
|
|
16333
|
-
output: any;
|
|
16334
|
-
metadata: any;
|
|
16335
|
-
}
|
|
16336
|
-
interface NewDatasetRecord {
|
|
16337
|
-
id: string;
|
|
16338
|
-
input: any;
|
|
16339
|
-
expected: any;
|
|
16340
|
-
tags: any;
|
|
16341
|
-
metadata: any;
|
|
16342
|
-
}
|
|
16343
|
-
type DatasetRecord<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY_DATASET> = IsLegacyDataset extends true ? LegacyDatasetRecord : NewDatasetRecord;
|
|
16344
|
-
|
|
16345
|
-
declare enum SpanObjectTypeV3 {
|
|
16346
|
-
EXPERIMENT = 1,
|
|
16347
|
-
PROJECT_LOGS = 2,
|
|
16348
|
-
PLAYGROUND_LOGS = 3
|
|
16349
|
-
}
|
|
16350
|
-
declare const spanComponentsV3Schema: z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
|
|
16351
|
-
object_type: z.ZodNativeEnum<typeof SpanObjectTypeV3>;
|
|
16352
|
-
propagated_event: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
16353
|
-
}, "strip", z.ZodTypeAny, {
|
|
16354
|
-
object_type: SpanObjectTypeV3;
|
|
16355
|
-
propagated_event?: Record<string, unknown> | null | undefined;
|
|
16356
|
-
}, {
|
|
16357
|
-
object_type: SpanObjectTypeV3;
|
|
16358
|
-
propagated_event?: Record<string, unknown> | null | undefined;
|
|
16359
|
-
}>, z.ZodUnion<[z.ZodObject<{
|
|
16360
|
-
object_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16361
|
-
compute_object_metadata_args: z.ZodOptional<z.ZodNull>;
|
|
16362
|
-
}, "strip", z.ZodTypeAny, {
|
|
16363
|
-
object_id?: string | null | undefined;
|
|
16364
|
-
compute_object_metadata_args?: null | undefined;
|
|
16365
|
-
}, {
|
|
16366
|
-
object_id?: string | null | undefined;
|
|
16367
|
-
compute_object_metadata_args?: null | undefined;
|
|
16368
|
-
}>, z.ZodObject<{
|
|
16369
|
-
object_id: z.ZodOptional<z.ZodNull>;
|
|
16370
|
-
compute_object_metadata_args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16371
|
-
}, "strip", z.ZodTypeAny, {
|
|
16372
|
-
compute_object_metadata_args: Record<string, unknown>;
|
|
16373
|
-
object_id?: null | undefined;
|
|
16374
|
-
}, {
|
|
16375
|
-
compute_object_metadata_args: Record<string, unknown>;
|
|
16376
|
-
object_id?: null | undefined;
|
|
16377
|
-
}>]>>, z.ZodUnion<[z.ZodObject<{
|
|
16378
|
-
row_id: z.ZodString;
|
|
16379
|
-
span_id: z.ZodString;
|
|
16380
|
-
root_span_id: z.ZodString;
|
|
16381
|
-
}, "strip", z.ZodTypeAny, {
|
|
16382
|
-
span_id: string;
|
|
16383
|
-
root_span_id: string;
|
|
16384
|
-
row_id: string;
|
|
16385
|
-
}, {
|
|
16386
|
-
span_id: string;
|
|
16387
|
-
root_span_id: string;
|
|
16388
|
-
row_id: string;
|
|
16389
|
-
}>, z.ZodObject<{
|
|
16390
|
-
row_id: z.ZodOptional<z.ZodNull>;
|
|
16391
|
-
span_id: z.ZodOptional<z.ZodNull>;
|
|
16392
|
-
root_span_id: z.ZodOptional<z.ZodNull>;
|
|
16393
|
-
}, "strip", z.ZodTypeAny, {
|
|
16394
|
-
span_id?: null | undefined;
|
|
16395
|
-
root_span_id?: null | undefined;
|
|
16396
|
-
row_id?: null | undefined;
|
|
16397
|
-
}, {
|
|
16398
|
-
span_id?: null | undefined;
|
|
16399
|
-
root_span_id?: null | undefined;
|
|
16400
|
-
row_id?: null | undefined;
|
|
16401
|
-
}>]>>;
|
|
16402
|
-
type SpanComponentsV3Data = z.infer<typeof spanComponentsV3Schema>;
|
|
16403
|
-
declare class SpanComponentsV3 {
|
|
16404
|
-
data: SpanComponentsV3Data;
|
|
16405
|
-
constructor(data: SpanComponentsV3Data);
|
|
16406
|
-
toStr(): string;
|
|
16407
|
-
static fromStr(s: string): SpanComponentsV3;
|
|
16408
|
-
objectIdFields(): ParentExperimentIds | ParentProjectLogIds | ParentPlaygroundLogIds;
|
|
16409
|
-
export(): Promise<string>;
|
|
16410
|
-
private static fromJsonObj;
|
|
16411
|
-
}
|
|
16412
|
-
|
|
16413
|
-
/**
|
|
16414
|
-
* The result returned by a classifier function. Unlike `Score`, `id` is
|
|
16415
|
-
* required and the span will be recorded as a classifier span.
|
|
16416
|
-
*/
|
|
16417
|
-
interface Classification {
|
|
16418
|
-
/**
|
|
16419
|
-
* The name of this classification result. Used as the key in the
|
|
16420
|
-
* `classifications` log record. If omitted, defaults to the classifier
|
|
16421
|
-
* function's name.
|
|
16422
|
-
*/
|
|
16423
|
-
name: string;
|
|
16424
|
-
/**
|
|
16425
|
-
* A machine-readable identifier for the classification outcome
|
|
16426
|
-
* (e.g. `"positive"`, `"negative"`, `"neutral"`). This value is stored
|
|
16427
|
-
* in the log and used for programmatic analysis.
|
|
16428
|
-
*/
|
|
16429
|
-
id: string;
|
|
16430
|
-
/**
|
|
16431
|
-
* An optional human-readable display label for this outcome. If omitted,
|
|
16432
|
-
* defaults to `id`. Use this when you want a friendlier label in the UI
|
|
16433
|
-
* while keeping a stable `id` for programmatic use.
|
|
16434
|
-
*/
|
|
16435
|
-
label?: string;
|
|
16436
|
-
/**
|
|
16437
|
-
* Optional arbitrary metadata to attach to this classification result.
|
|
16438
|
-
*/
|
|
16439
|
-
metadata?: Record<string, unknown>;
|
|
16440
|
-
}
|
|
16441
|
-
/**
|
|
16442
|
-
* The serialized form of a classification stored in the `classifications` log record.
|
|
16443
|
-
*/
|
|
16444
|
-
interface ClassificationItem {
|
|
16445
|
-
id: string;
|
|
16446
|
-
label: string;
|
|
16447
|
-
metadata?: Record<string, unknown>;
|
|
16448
|
-
}
|
|
16449
|
-
interface Score {
|
|
16450
|
-
name: string;
|
|
16451
|
-
score: number | null;
|
|
16452
|
-
metadata?: Record<string, unknown>;
|
|
16453
|
-
/**
|
|
16454
|
-
* @deprecated
|
|
16455
|
-
*/
|
|
16456
|
-
error?: unknown;
|
|
16457
|
-
}
|
|
16458
|
-
|
|
16459
|
-
declare const spanComponentsV4Schema: z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
|
|
16460
|
-
object_type: z.ZodNativeEnum<typeof SpanObjectTypeV3>;
|
|
16461
|
-
propagated_event: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
16462
|
-
}, "strip", z.ZodTypeAny, {
|
|
16463
|
-
object_type: SpanObjectTypeV3;
|
|
16464
|
-
propagated_event?: Record<string, unknown> | null | undefined;
|
|
16465
|
-
}, {
|
|
16466
|
-
object_type: SpanObjectTypeV3;
|
|
16467
|
-
propagated_event?: Record<string, unknown> | null | undefined;
|
|
16468
|
-
}>, z.ZodUnion<[z.ZodObject<{
|
|
16469
|
-
object_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16470
|
-
compute_object_metadata_args: z.ZodOptional<z.ZodNull>;
|
|
16471
|
-
}, "strip", z.ZodTypeAny, {
|
|
16472
|
-
object_id?: string | null | undefined;
|
|
16473
|
-
compute_object_metadata_args?: null | undefined;
|
|
16474
|
-
}, {
|
|
16475
|
-
object_id?: string | null | undefined;
|
|
16476
|
-
compute_object_metadata_args?: null | undefined;
|
|
16477
|
-
}>, z.ZodObject<{
|
|
16478
|
-
object_id: z.ZodOptional<z.ZodNull>;
|
|
16479
|
-
compute_object_metadata_args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16480
|
-
}, "strip", z.ZodTypeAny, {
|
|
16481
|
-
compute_object_metadata_args: Record<string, unknown>;
|
|
16482
|
-
object_id?: null | undefined;
|
|
16483
|
-
}, {
|
|
16484
|
-
compute_object_metadata_args: Record<string, unknown>;
|
|
16485
|
-
object_id?: null | undefined;
|
|
16486
|
-
}>]>>, z.ZodUnion<[z.ZodObject<{
|
|
16487
|
-
row_id: z.ZodString;
|
|
16488
|
-
span_id: z.ZodString;
|
|
16489
|
-
root_span_id: z.ZodString;
|
|
16490
|
-
}, "strip", z.ZodTypeAny, {
|
|
16491
|
-
span_id: string;
|
|
16492
|
-
root_span_id: string;
|
|
16493
|
-
row_id: string;
|
|
16494
|
-
}, {
|
|
16495
|
-
span_id: string;
|
|
16496
|
-
root_span_id: string;
|
|
16497
|
-
row_id: string;
|
|
16498
|
-
}>, z.ZodObject<{
|
|
16499
|
-
row_id: z.ZodOptional<z.ZodNull>;
|
|
16500
|
-
span_id: z.ZodOptional<z.ZodNull>;
|
|
16501
|
-
root_span_id: z.ZodOptional<z.ZodNull>;
|
|
16502
|
-
}, "strip", z.ZodTypeAny, {
|
|
16503
|
-
span_id?: null | undefined;
|
|
16504
|
-
root_span_id?: null | undefined;
|
|
16505
|
-
row_id?: null | undefined;
|
|
16506
|
-
}, {
|
|
16507
|
-
span_id?: null | undefined;
|
|
16508
|
-
root_span_id?: null | undefined;
|
|
16509
|
-
row_id?: null | undefined;
|
|
16510
|
-
}>]>>;
|
|
16511
|
-
type SpanComponentsV4Data = z.infer<typeof spanComponentsV4Schema>;
|
|
16512
|
-
declare class SpanComponentsV4 {
|
|
16513
|
-
data: SpanComponentsV4Data;
|
|
16514
|
-
constructor(data: SpanComponentsV4Data);
|
|
16515
|
-
toStr(): string;
|
|
16516
|
-
static fromStr(s: string): SpanComponentsV4;
|
|
16517
|
-
objectIdFields(): ParentExperimentIds | ParentProjectLogIds | ParentPlaygroundLogIds;
|
|
16518
|
-
export(): Promise<string>;
|
|
16519
|
-
private static fromJsonObj;
|
|
16520
|
-
}
|
|
16521
|
-
|
|
16522
|
-
declare const spanTypeAttributeValues: readonly ["llm", "score", "function", "eval", "task", "tool", "automation", "facet", "preprocessor", "classifier", "review"];
|
|
16523
|
-
type SpanType = (typeof spanTypeAttributeValues)[number];
|
|
16524
|
-
|
|
16525
|
-
declare class LazyValue<T> {
|
|
16526
|
-
private callable;
|
|
16527
|
-
private resolvedValue;
|
|
16528
|
-
private value;
|
|
16529
|
-
constructor(callable: () => Promise<T>);
|
|
16530
|
-
get(): Promise<T>;
|
|
16531
|
-
getSync(): {
|
|
16532
|
-
resolved: boolean;
|
|
16533
|
-
value: T | undefined;
|
|
16534
|
-
};
|
|
16535
|
-
get hasSucceeded(): boolean;
|
|
16536
|
-
}
|
|
16537
|
-
declare function addAzureBlobHeaders(headers: Record<string, string>, url: string): void;
|
|
16538
|
-
|
|
16539
|
-
type TemplateFormat = "mustache" | "nunjucks" | "none";
|
|
16540
|
-
interface TemplateRenderer {
|
|
16541
|
-
render: (template: string, variables: Record<string, unknown>, escape: (v: unknown) => string, strict: boolean) => string;
|
|
16542
|
-
lint?: (template: string, variables: Record<string, unknown>) => void;
|
|
16543
|
-
}
|
|
16544
|
-
/**
|
|
16545
|
-
* A template renderer plugin that can be registered with Braintrust.
|
|
16546
|
-
*
|
|
16547
|
-
* Plugins provide support for different template engines (e.g., Nunjucks).
|
|
16548
|
-
* They use a factory pattern where the plugin is registered once, then activated with specific
|
|
16549
|
-
* configuration options when needed.
|
|
16550
|
-
*
|
|
16551
|
-
* @example
|
|
16552
|
-
* ```typescript
|
|
16553
|
-
* import type { TemplateRendererPlugin } from "braintrust";
|
|
16554
|
-
*
|
|
16555
|
-
* export const myPlugin: TemplateRendererPlugin = {
|
|
16556
|
-
* name: "my-template-engine",
|
|
16557
|
-
* version: "1.0.0",
|
|
16558
|
-
* defaultOptions: { strict: false },
|
|
16559
|
-
* createRenderer(options?: unknown) {
|
|
16560
|
-
* const opts = options ?? this.defaultOptions;
|
|
16561
|
-
* return {
|
|
16562
|
-
* render(template, variables, escape, strict) {
|
|
16563
|
-
* // Your rendering logic here
|
|
16564
|
-
* }
|
|
16565
|
-
* };
|
|
16566
|
-
* }
|
|
16567
|
-
* };
|
|
16568
|
-
* ```
|
|
16569
|
-
*/
|
|
16570
|
-
interface TemplateRendererPlugin {
|
|
16571
|
-
/**
|
|
16572
|
-
* Unique identifier for this plugin.
|
|
16573
|
-
* Must match the format string used in `templateFormat` option.
|
|
16574
|
-
*/
|
|
16575
|
-
name: string;
|
|
16576
|
-
/**
|
|
16577
|
-
* Factory function that creates a renderer instance.
|
|
16578
|
-
*
|
|
16579
|
-
* @param options - If not provided, `defaultOptions` is used.
|
|
16580
|
-
* @returns A configured TemplateRenderer instance
|
|
16581
|
-
*/
|
|
16582
|
-
createRenderer: () => TemplateRenderer;
|
|
16583
|
-
/**
|
|
16584
|
-
* Default configuration options for this plugin.
|
|
16585
|
-
*/
|
|
16586
|
-
defaultOptions?: unknown;
|
|
16587
|
-
}
|
|
16588
|
-
declare class TemplatePluginRegistry {
|
|
16589
|
-
private plugins;
|
|
16590
|
-
register(plugin: TemplateRendererPlugin): void;
|
|
16591
|
-
getAvailable(): string[];
|
|
16592
|
-
get(name: string): TemplateRenderer | undefined;
|
|
16593
|
-
isRegistered(name: string): boolean;
|
|
16594
|
-
}
|
|
16595
|
-
declare const templateRegistry: TemplatePluginRegistry;
|
|
16596
|
-
/**
|
|
16597
|
-
* Register a template plugin and optionally activate it
|
|
16598
|
-
*
|
|
16599
|
-
* If `options` is provided it will be used to create the active renderer.
|
|
16600
|
-
* If `options` is omitted but the plugin defines `defaultOptions`, the
|
|
16601
|
-
* registry will activate the renderer using those defaults.
|
|
16602
|
-
*/
|
|
16603
|
-
declare const registerTemplatePlugin: (plugin: TemplateRendererPlugin) => void;
|
|
16604
|
-
/**
|
|
16605
|
-
* Gets an active template renderer by name.
|
|
16606
|
-
*
|
|
16607
|
-
* Returns `undefined` if the renderer is not active.
|
|
16608
|
-
*
|
|
16609
|
-
* @param name - Name of the renderer to retrieve
|
|
16610
|
-
* @returns The active renderer, or undefined if not activated
|
|
16611
|
-
*
|
|
16612
|
-
* @example
|
|
16613
|
-
* ```typescript
|
|
16614
|
-
* import { getTemplateRenderer } from "braintrust";
|
|
16615
|
-
*
|
|
16616
|
-
* const renderer = getTemplateRenderer("nunjucks");
|
|
16617
|
-
* if (renderer) {
|
|
16618
|
-
* const output = renderer.render(template, variables, escape, strict);
|
|
16619
|
-
* }
|
|
16620
|
-
* ```
|
|
16621
|
-
*/
|
|
16622
|
-
declare const getTemplateRenderer: (name: string) => TemplateRenderer | undefined;
|
|
16623
|
-
|
|
16624
16776
|
/**
|
|
16625
16777
|
* Options for configuring an LRUCache instance.
|
|
16626
16778
|
*/
|
|
@@ -18662,6 +18814,8 @@ type InferParameters<T extends EvalParameters> = {
|
|
|
18662
18814
|
[K in keyof T]: InferParameterValue<T[K]>;
|
|
18663
18815
|
};
|
|
18664
18816
|
|
|
18817
|
+
/// <reference lib="dom" />
|
|
18818
|
+
|
|
18665
18819
|
declare const LOGS3_OVERFLOW_REFERENCE_TYPE = "logs3_overflow";
|
|
18666
18820
|
declare const RESET_CONTEXT_MANAGER_STATE: unique symbol;
|
|
18667
18821
|
declare const DEFAULT_MAX_REQUEST_SIZE: number;
|
|
@@ -18715,32 +18869,32 @@ declare const parametersRowSchema: z.ZodObject<{
|
|
|
18715
18869
|
metadata: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodNull]>>;
|
|
18716
18870
|
}, "strip", z.ZodTypeAny, {
|
|
18717
18871
|
id: string;
|
|
18872
|
+
project_id: string;
|
|
18718
18873
|
name: string;
|
|
18874
|
+
slug: string;
|
|
18719
18875
|
function_type: "parameters";
|
|
18720
|
-
project_id: string;
|
|
18721
18876
|
_xact_id: string;
|
|
18722
|
-
slug: string;
|
|
18723
18877
|
function_data: {
|
|
18724
18878
|
type: "parameters";
|
|
18725
18879
|
__schema: Record<string, unknown>;
|
|
18726
18880
|
data?: Record<string, unknown> | undefined;
|
|
18727
18881
|
};
|
|
18728
|
-
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
18729
18882
|
description?: string | null | undefined;
|
|
18883
|
+
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
18730
18884
|
}, {
|
|
18731
18885
|
id: string;
|
|
18886
|
+
project_id: string;
|
|
18732
18887
|
name: string;
|
|
18888
|
+
slug: string;
|
|
18733
18889
|
function_type: "parameters";
|
|
18734
|
-
project_id: string;
|
|
18735
18890
|
_xact_id: string;
|
|
18736
|
-
slug: string;
|
|
18737
18891
|
function_data: {
|
|
18738
18892
|
type: "parameters";
|
|
18739
18893
|
__schema: Record<string, unknown>;
|
|
18740
18894
|
data?: Record<string, unknown> | undefined;
|
|
18741
18895
|
};
|
|
18742
|
-
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
18743
18896
|
description?: string | null | undefined;
|
|
18897
|
+
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
18744
18898
|
}>;
|
|
18745
18899
|
type ParametersRow = z.infer<typeof parametersRowSchema>;
|
|
18746
18900
|
|
|
@@ -18761,7 +18915,12 @@ type StartSpanArgs = {
|
|
|
18761
18915
|
type?: SpanType;
|
|
18762
18916
|
spanAttributes?: Record<any, any>;
|
|
18763
18917
|
startTime?: number;
|
|
18764
|
-
|
|
18918
|
+
/**
|
|
18919
|
+
* The parent to start this span under. May be an exported span slug string
|
|
18920
|
+
* (from `span.export()`) or an opaque W3C trace-context (from
|
|
18921
|
+
* {@link extractTraceContextFromHeaders}).
|
|
18922
|
+
*/
|
|
18923
|
+
parent?: string | PropagationContext;
|
|
18765
18924
|
event?: StartSpanEventArgs;
|
|
18766
18925
|
propagatedEvent?: StartSpanEventArgs;
|
|
18767
18926
|
spanId?: string;
|
|
@@ -18863,6 +19022,24 @@ interface Span extends Exportable {
|
|
|
18863
19022
|
* @returns Serialized representation of this span's identifiers.
|
|
18864
19023
|
*/
|
|
18865
19024
|
export(): Promise<string>;
|
|
19025
|
+
/**
|
|
19026
|
+
* Inject W3C trace-context headers (`traceparent` and `baggage`) for this span
|
|
19027
|
+
* into a carrier, for distributed tracing across service boundaries.
|
|
19028
|
+
*
|
|
19029
|
+
* Adds `traceparent` (trace identity) and, when this span's Braintrust parent
|
|
19030
|
+
* is known, a `baggage` entry `braintrust.parent=<parent>` (merged with any
|
|
19031
|
+
* pre-existing baggage). Propagation is best-effort and never throws; if the
|
|
19032
|
+
* span's ids are not W3C-shaped hex (e.g. legacy UUID mode), `traceparent` is
|
|
19033
|
+
* omitted.
|
|
19034
|
+
*
|
|
19035
|
+
* @param carrier Optional existing carrier (e.g. outbound HTTP headers) to
|
|
19036
|
+
* mutate and return. Supports plain objects, Web `Headers`, Node-style
|
|
19037
|
+
* `setHeader` carriers, framework `header` carriers, and mutable
|
|
19038
|
+
* `HeadersInit` tuple arrays. A new object is created if not provided.
|
|
19039
|
+
* @returns The carrier with propagation headers injected.
|
|
19040
|
+
*/
|
|
19041
|
+
inject(): Record<string, string>;
|
|
19042
|
+
inject<T extends TraceContextCarrier>(carrier: T): T;
|
|
18866
19043
|
/**
|
|
18867
19044
|
* Format a permalink to the Braintrust application for viewing this span.
|
|
18868
19045
|
*
|
|
@@ -18955,6 +19132,8 @@ declare class NoopSpan implements Span {
|
|
|
18955
19132
|
startSpan(_1?: StartSpanArgs): this;
|
|
18956
19133
|
end(args?: EndSpanArgs): number;
|
|
18957
19134
|
export(): Promise<string>;
|
|
19135
|
+
inject(): Record<string, string>;
|
|
19136
|
+
inject<T extends TraceContextCarrier>(carrier: T): T;
|
|
18958
19137
|
permalink(): Promise<string>;
|
|
18959
19138
|
link(): string;
|
|
18960
19139
|
flush(): Promise<void>;
|
|
@@ -19026,7 +19205,7 @@ declare class BraintrustState {
|
|
|
19026
19205
|
id: string;
|
|
19027
19206
|
currentExperiment: Experiment | undefined;
|
|
19028
19207
|
currentLogger: Logger<false> | undefined;
|
|
19029
|
-
currentParent: IsoAsyncLocalStorage<string>;
|
|
19208
|
+
currentParent: IsoAsyncLocalStorage<string | PropagationContext>;
|
|
19030
19209
|
currentSpan: IsoAsyncLocalStorage<Span>;
|
|
19031
19210
|
private _bgLogger;
|
|
19032
19211
|
private _overrideBgLogger;
|
|
@@ -19433,6 +19612,15 @@ declare class JSONAttachment extends Attachment {
|
|
|
19433
19612
|
declare function updateSpan({ exported, state, ...event }: {
|
|
19434
19613
|
exported: string;
|
|
19435
19614
|
} & Omit<Partial<ExperimentEvent>, "id" | "root_span_id" | "span_id"> & OptionalStateArg): void;
|
|
19615
|
+
/**
|
|
19616
|
+
* An opaque W3C trace-context, as returned by
|
|
19617
|
+
* {@link extractTraceContextFromHeaders}.
|
|
19618
|
+
*
|
|
19619
|
+
* Carries the relevant W3C headers (`traceparent`, `baggage`, `tracestate`).
|
|
19620
|
+
* Callers MUST treat it as opaque and pass it straight to
|
|
19621
|
+
* `startSpan({ parent })`.
|
|
19622
|
+
*/
|
|
19623
|
+
type PropagationContext = Record<string, string>;
|
|
19436
19624
|
interface ParentSpanIds {
|
|
19437
19625
|
spanId: string;
|
|
19438
19626
|
rootSpanId: string;
|
|
@@ -19550,6 +19738,12 @@ declare class Logger<IsAsyncFlush extends boolean> implements Exportable {
|
|
|
19550
19738
|
* Resolution order: state -> linkArgs -> env var
|
|
19551
19739
|
*/
|
|
19552
19740
|
_getLinkBaseUrl(): string | null;
|
|
19741
|
+
/**
|
|
19742
|
+
* Return this logger's Braintrust parent string (`project_id:<id>` or
|
|
19743
|
+
* `project_name:<name>`) for the `braintrust.parent` baggage entry, or
|
|
19744
|
+
* undefined when it cannot be determined synchronously.
|
|
19745
|
+
*/
|
|
19746
|
+
_getOtelParent(): string | undefined;
|
|
19553
19747
|
}
|
|
19554
19748
|
declare const logs3OverflowUploadSchema: z.ZodObject<{
|
|
19555
19749
|
method: z.ZodEnum<["PUT", "POST"]>;
|
|
@@ -19763,6 +19957,9 @@ declare function withLogger<IsAsyncFlush extends boolean = false, R = void>(call
|
|
|
19763
19957
|
type UseOutputOption<IsLegacyDataset extends boolean> = {
|
|
19764
19958
|
useOutput?: IsLegacyDataset;
|
|
19765
19959
|
};
|
|
19960
|
+
declare global {
|
|
19961
|
+
var __bt_eval_internal_btql: Record<string, unknown> | undefined;
|
|
19962
|
+
}
|
|
19766
19963
|
type InitDatasetOptions<IsLegacyDataset extends boolean> = FullLoginOptions & {
|
|
19767
19964
|
dataset?: string;
|
|
19768
19965
|
description?: string;
|
|
@@ -20054,11 +20251,60 @@ declare function currentLogger<IsAsyncFlush extends boolean>(options?: AsyncFlus
|
|
|
20054
20251
|
declare function currentSpan(options?: OptionalStateArg): Span;
|
|
20055
20252
|
/**
|
|
20056
20253
|
* Mainly for internal use. Return the parent object for starting a span in a global context.
|
|
20057
|
-
* Applies precedence: current span > propagated parent
|
|
20254
|
+
* Applies precedence: current span > propagated parent > experiment > logger.
|
|
20255
|
+
*
|
|
20256
|
+
* `parent` may be an exported slug string or an opaque W3C trace-context (from
|
|
20257
|
+
* {@link extractTraceContextFromHeaders}).
|
|
20058
20258
|
*/
|
|
20059
20259
|
declare function getSpanParentObject<IsAsyncFlush extends boolean>(options?: AsyncFlushArg<IsAsyncFlush> & OptionalStateArg & {
|
|
20060
|
-
parent?: string;
|
|
20260
|
+
parent?: string | PropagationContext;
|
|
20061
20261
|
}): SpanComponentsV3 | SpanComponentsV4 | Span | Experiment | Logger<IsAsyncFlush>;
|
|
20262
|
+
/**
|
|
20263
|
+
* Inject W3C trace-context headers for the current (or given) span into a
|
|
20264
|
+
* carrier.
|
|
20265
|
+
*
|
|
20266
|
+
* This is the free-function form of {@link Span.inject}, and the send-side
|
|
20267
|
+
* counterpart of {@link extractTraceContextFromHeaders}. If no span is
|
|
20268
|
+
* provided, the currently-active span is used. Propagation is best-effort and
|
|
20269
|
+
* never throws.
|
|
20270
|
+
*
|
|
20271
|
+
* @param carrier Optional carrier (e.g. outbound HTTP headers) to mutate.
|
|
20272
|
+
* Supports plain objects, Web `Headers`, Node-style `setHeader` carriers,
|
|
20273
|
+
* framework `header` carriers, and mutable `HeadersInit` tuple arrays.
|
|
20274
|
+
* @param options.span Optional span to inject. Defaults to the current span.
|
|
20275
|
+
* @returns The carrier with propagation headers injected.
|
|
20276
|
+
*/
|
|
20277
|
+
declare function injectTraceContext(carrier?: undefined, options?: OptionalStateArg & {
|
|
20278
|
+
span?: Span;
|
|
20279
|
+
}): Record<string, string>;
|
|
20280
|
+
declare function injectTraceContext<T extends TraceContextCarrier>(carrier: T, options?: OptionalStateArg & {
|
|
20281
|
+
span?: Span;
|
|
20282
|
+
}): T;
|
|
20283
|
+
/**
|
|
20284
|
+
* Extract an opaque W3C trace-context from inbound request headers.
|
|
20285
|
+
*
|
|
20286
|
+
* This is the receive-side counterpart of {@link Span.inject} /
|
|
20287
|
+
* {@link injectTraceContext}. The return value is an opaque propagation context
|
|
20288
|
+
* that can be passed as `parent` to `startSpan`:
|
|
20289
|
+
*
|
|
20290
|
+
* ```ts
|
|
20291
|
+
* const ctx = extractTraceContextFromHeaders(request.headers);
|
|
20292
|
+
* traced((span) => { ... }, { name: "handler", parent: ctx });
|
|
20293
|
+
* ```
|
|
20294
|
+
*
|
|
20295
|
+
* Only the W3C Trace Context headers are interpreted (`traceparent`, `baggage`,
|
|
20296
|
+
* `tracestate`); header lookups are case-insensitive. If no valid `traceparent`
|
|
20297
|
+
* is present, returns undefined (the caller starts a fresh root span). The
|
|
20298
|
+
* Braintrust container the trace is routed under is resolved when the span is
|
|
20299
|
+
* created: from the `braintrust.parent` baggage entry, or else the
|
|
20300
|
+
* currently-active logger/experiment.
|
|
20301
|
+
*
|
|
20302
|
+
* Callers should treat the return value as opaque.
|
|
20303
|
+
*
|
|
20304
|
+
* @param headers Inbound request headers (e.g. an HTTP framework's headers).
|
|
20305
|
+
* @returns An opaque context for `startSpan({ parent })`, or undefined.
|
|
20306
|
+
*/
|
|
20307
|
+
declare function extractTraceContextFromHeaders(headers: TraceContextHeaders | null | undefined): PropagationContext | undefined;
|
|
20062
20308
|
declare function logError(span: Span, error: unknown): void;
|
|
20063
20309
|
/**
|
|
20064
20310
|
* Toplevel function for starting a span. It checks the following (in precedence order):
|
|
@@ -20148,7 +20394,7 @@ declare function setFetch(fetch: typeof globalThis.fetch): void;
|
|
|
20148
20394
|
* Runs the provided callback with the span as the current span.
|
|
20149
20395
|
*/
|
|
20150
20396
|
declare function withCurrent<R>(span: Span, callback: (span: Span) => R, state?: BraintrustState | undefined): R;
|
|
20151
|
-
declare function withParent<R>(parent: string, callback: () => R, state?: BraintrustState | undefined): R;
|
|
20397
|
+
declare function withParent<R>(parent: string | PropagationContext, callback: () => R, state?: BraintrustState | undefined): R;
|
|
20152
20398
|
declare function validateTags(tags: readonly string[]): void;
|
|
20153
20399
|
/**
|
|
20154
20400
|
* Creates a deep copy of the given event. Replaces references to user objects
|
|
@@ -20175,8 +20421,9 @@ declare class ObjectFetcher<RecordType> implements AsyncIterable<WithTransaction
|
|
|
20175
20421
|
private pinnedVersion;
|
|
20176
20422
|
private mutateRecord?;
|
|
20177
20423
|
private _internal_btql?;
|
|
20424
|
+
private _internalBrainstoreRealtime;
|
|
20178
20425
|
private _fetchedData;
|
|
20179
|
-
constructor(objectType: "dataset" | "experiment" | "project_logs" | "playground_logs", pinnedVersion: string | undefined, mutateRecord?: ((r: any) => WithTransactionId<RecordType>) | undefined, _internal_btql?: Record<string, unknown> | undefined);
|
|
20426
|
+
constructor(objectType: "dataset" | "experiment" | "project_logs" | "playground_logs", pinnedVersion: string | undefined, mutateRecord?: ((r: any) => WithTransactionId<RecordType>) | undefined, _internal_btql?: Record<string, unknown> | undefined, _internalBrainstoreRealtime?: boolean);
|
|
20180
20427
|
get id(): Promise<string>;
|
|
20181
20428
|
protected getState(): Promise<BraintrustState>;
|
|
20182
20429
|
protected getPinnedVersion(): string | undefined;
|
|
@@ -20204,7 +20451,7 @@ declare class ObjectFetcher<RecordType> implements AsyncIterable<WithTransaction
|
|
|
20204
20451
|
}
|
|
20205
20452
|
type BaseMetadata = Record<string, unknown> | void;
|
|
20206
20453
|
type DefaultMetadataType = void;
|
|
20207
|
-
type EvalCaseOrigin = ObjectReferenceType
|
|
20454
|
+
type EvalCaseOrigin = ObjectReferenceType;
|
|
20208
20455
|
type EvalCase<Input, Expected, Metadata> = {
|
|
20209
20456
|
input: Input;
|
|
20210
20457
|
tags?: string[];
|
|
@@ -20329,6 +20576,12 @@ declare class Experiment extends ObjectFetcher<ExperimentEvent> implements Expor
|
|
|
20329
20576
|
* See {@link Span.startSpan} for more details.
|
|
20330
20577
|
*/
|
|
20331
20578
|
export(): Promise<string>;
|
|
20579
|
+
/**
|
|
20580
|
+
* Return this experiment's Braintrust parent string (`experiment_id:<id>`) for
|
|
20581
|
+
* the `braintrust.parent` baggage entry, or undefined when it cannot be
|
|
20582
|
+
* determined synchronously.
|
|
20583
|
+
*/
|
|
20584
|
+
_getOtelParent(): string | undefined;
|
|
20332
20585
|
/**
|
|
20333
20586
|
* Flush any pending rows to the server.
|
|
20334
20587
|
*/
|
|
@@ -20371,6 +20624,7 @@ declare class SpanImpl implements Span {
|
|
|
20371
20624
|
private _spanId;
|
|
20372
20625
|
private _rootSpanId;
|
|
20373
20626
|
private _spanParents;
|
|
20627
|
+
private _propagatedState;
|
|
20374
20628
|
kind: "span";
|
|
20375
20629
|
constructor(args: {
|
|
20376
20630
|
state: BraintrustState;
|
|
@@ -20380,6 +20634,7 @@ declare class SpanImpl implements Span {
|
|
|
20380
20634
|
parentSpanIds: ParentSpanIds | MultiParentSpanIds | undefined;
|
|
20381
20635
|
defaultRootType?: SpanType;
|
|
20382
20636
|
spanId?: string;
|
|
20637
|
+
propagatedState?: PropagatedState | undefined;
|
|
20383
20638
|
} & Omit<StartSpanArgs, "parent">);
|
|
20384
20639
|
getParentInfo(): {
|
|
20385
20640
|
objectType: SpanObjectTypeV3;
|
|
@@ -20402,6 +20657,14 @@ declare class SpanImpl implements Span {
|
|
|
20402
20657
|
startSpanWithParents(spanId: string, spanParents: string[], args?: StartSpanArgs): Span;
|
|
20403
20658
|
end(args?: EndSpanArgs): number;
|
|
20404
20659
|
export(): Promise<string>;
|
|
20660
|
+
/**
|
|
20661
|
+
* Return this span's Braintrust parent string (`project_id:<id>`,
|
|
20662
|
+
* `project_name:<name>`, or `experiment_id:<id>`) for the `braintrust.parent`
|
|
20663
|
+
* baggage entry, or undefined when it cannot be determined synchronously.
|
|
20664
|
+
*/
|
|
20665
|
+
_getOtelParent(): string | undefined;
|
|
20666
|
+
inject(): Record<string, string>;
|
|
20667
|
+
inject<T extends TraceContextCarrier>(carrier: T): T;
|
|
20405
20668
|
permalink(): Promise<string>;
|
|
20406
20669
|
link(): string;
|
|
20407
20670
|
_link(baseUrl: string): string;
|
|
@@ -20467,7 +20730,7 @@ declare class Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY
|
|
|
20467
20730
|
readonly metadata?: Record<string, unknown>;
|
|
20468
20731
|
readonly id?: string;
|
|
20469
20732
|
readonly output?: unknown;
|
|
20470
|
-
readonly origin?: ObjectReferenceType
|
|
20733
|
+
readonly origin?: ObjectReferenceType;
|
|
20471
20734
|
}): string;
|
|
20472
20735
|
/**
|
|
20473
20736
|
* Update fields of a single record in the dataset. The updated fields will be batched and uploaded behind the scenes.
|
|
@@ -20759,7 +21022,7 @@ declare const _exportsForTestingOnly: {
|
|
|
20759
21022
|
isAsyncGeneratorFunction: typeof isAsyncGeneratorFunction;
|
|
20760
21023
|
resetIdGenStateForTests: typeof resetIdGenStateForTests;
|
|
20761
21024
|
validateTags: typeof validateTags;
|
|
20762
|
-
isomorph:
|
|
21025
|
+
isomorph: any;
|
|
20763
21026
|
};
|
|
20764
21027
|
|
|
20765
21028
|
/**
|
|
@@ -21487,6 +21750,7 @@ interface AISDKV7TelemetryOptions {
|
|
|
21487
21750
|
recordOutputs?: boolean;
|
|
21488
21751
|
functionId?: string;
|
|
21489
21752
|
}
|
|
21753
|
+
declare const BRAINTRUST_AI_SDK_V7_OPERATION_KEY: unique symbol;
|
|
21490
21754
|
interface AISDKV7ModelInfo {
|
|
21491
21755
|
provider?: string;
|
|
21492
21756
|
modelId?: string;
|
|
@@ -21494,10 +21758,12 @@ interface AISDKV7ModelInfo {
|
|
|
21494
21758
|
interface AISDKV7OperationEvent extends AISDKV7TelemetryOptions, AISDKV7ModelInfo {
|
|
21495
21759
|
callId: string;
|
|
21496
21760
|
operationId: string;
|
|
21761
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21497
21762
|
[key: string]: unknown;
|
|
21498
21763
|
}
|
|
21499
21764
|
interface AISDKV7LanguageModelCallStartEvent extends AISDKV7TelemetryOptions, AISDKV7ModelInfo {
|
|
21500
21765
|
callId: string;
|
|
21766
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21501
21767
|
[key: string]: unknown;
|
|
21502
21768
|
}
|
|
21503
21769
|
interface AISDKV7LanguageModelCallEndEvent extends AISDKV7TelemetryOptions, AISDKV7ModelInfo {
|
|
@@ -21506,12 +21772,14 @@ interface AISDKV7LanguageModelCallEndEvent extends AISDKV7TelemetryOptions, AISD
|
|
|
21506
21772
|
finishReason?: unknown;
|
|
21507
21773
|
responseId?: string;
|
|
21508
21774
|
usage?: unknown;
|
|
21775
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21509
21776
|
[key: string]: unknown;
|
|
21510
21777
|
}
|
|
21511
21778
|
interface AISDKV7ObjectStepStartEvent extends AISDKV7TelemetryOptions, AISDKV7ModelInfo {
|
|
21512
21779
|
callId: string;
|
|
21513
21780
|
promptMessages?: unknown;
|
|
21514
21781
|
stepNumber?: number;
|
|
21782
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21515
21783
|
[key: string]: unknown;
|
|
21516
21784
|
}
|
|
21517
21785
|
interface AISDKV7ObjectStepEndEvent extends AISDKV7TelemetryOptions, AISDKV7ModelInfo {
|
|
@@ -21524,6 +21792,7 @@ interface AISDKV7ObjectStepEndEvent extends AISDKV7TelemetryOptions, AISDKV7Mode
|
|
|
21524
21792
|
response?: unknown;
|
|
21525
21793
|
usage?: unknown;
|
|
21526
21794
|
warnings?: unknown;
|
|
21795
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21527
21796
|
[key: string]: unknown;
|
|
21528
21797
|
}
|
|
21529
21798
|
interface AISDKV7EmbedStartEvent extends AISDKV7TelemetryOptions, AISDKV7ModelInfo {
|
|
@@ -21531,6 +21800,7 @@ interface AISDKV7EmbedStartEvent extends AISDKV7TelemetryOptions, AISDKV7ModelIn
|
|
|
21531
21800
|
embedCallId: string;
|
|
21532
21801
|
operationId: string;
|
|
21533
21802
|
values: unknown[];
|
|
21803
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21534
21804
|
[key: string]: unknown;
|
|
21535
21805
|
}
|
|
21536
21806
|
interface AISDKV7EmbedEndEvent extends AISDKV7TelemetryOptions, AISDKV7ModelInfo {
|
|
@@ -21540,6 +21810,7 @@ interface AISDKV7EmbedEndEvent extends AISDKV7TelemetryOptions, AISDKV7ModelInfo
|
|
|
21540
21810
|
embeddings?: unknown[];
|
|
21541
21811
|
usage?: unknown;
|
|
21542
21812
|
values?: unknown[];
|
|
21813
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21543
21814
|
[key: string]: unknown;
|
|
21544
21815
|
}
|
|
21545
21816
|
interface AISDKV7RerankStartEvent extends AISDKV7TelemetryOptions, AISDKV7ModelInfo {
|
|
@@ -21547,6 +21818,7 @@ interface AISDKV7RerankStartEvent extends AISDKV7TelemetryOptions, AISDKV7ModelI
|
|
|
21547
21818
|
documents?: unknown[];
|
|
21548
21819
|
query?: string;
|
|
21549
21820
|
topN?: number;
|
|
21821
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21550
21822
|
[key: string]: unknown;
|
|
21551
21823
|
}
|
|
21552
21824
|
interface AISDKV7RerankEndEvent extends AISDKV7TelemetryOptions, AISDKV7ModelInfo {
|
|
@@ -21555,6 +21827,7 @@ interface AISDKV7RerankEndEvent extends AISDKV7TelemetryOptions, AISDKV7ModelInf
|
|
|
21555
21827
|
index?: number;
|
|
21556
21828
|
relevanceScore?: number;
|
|
21557
21829
|
}>;
|
|
21830
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21558
21831
|
[key: string]: unknown;
|
|
21559
21832
|
}
|
|
21560
21833
|
interface AISDKV7ToolCall {
|
|
@@ -21564,9 +21837,10 @@ interface AISDKV7ToolCall {
|
|
|
21564
21837
|
[key: string]: unknown;
|
|
21565
21838
|
}
|
|
21566
21839
|
interface AISDKV7ToolExecutionStartEvent extends AISDKV7TelemetryOptions {
|
|
21567
|
-
callId
|
|
21840
|
+
callId?: string;
|
|
21568
21841
|
toolCall: AISDKV7ToolCall;
|
|
21569
21842
|
toolContext?: unknown;
|
|
21843
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21570
21844
|
[key: string]: unknown;
|
|
21571
21845
|
}
|
|
21572
21846
|
interface AISDKV7ToolOutput {
|
|
@@ -21576,10 +21850,14 @@ interface AISDKV7ToolOutput {
|
|
|
21576
21850
|
[key: string]: unknown;
|
|
21577
21851
|
}
|
|
21578
21852
|
interface AISDKV7ToolExecutionEndEvent extends AISDKV7TelemetryOptions {
|
|
21579
|
-
callId
|
|
21853
|
+
callId?: string;
|
|
21580
21854
|
durationMs?: number;
|
|
21855
|
+
error?: unknown;
|
|
21856
|
+
output?: unknown;
|
|
21857
|
+
success?: boolean;
|
|
21581
21858
|
toolCall: AISDKV7ToolCall;
|
|
21582
21859
|
toolOutput?: AISDKV7ToolOutput;
|
|
21860
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21583
21861
|
[key: string]: unknown;
|
|
21584
21862
|
}
|
|
21585
21863
|
interface AISDKV7ChunkEvent {
|
|
@@ -21595,21 +21873,24 @@ interface AISDKV7Telemetry {
|
|
|
21595
21873
|
onLanguageModelCallStart?: (event: AISDKV7LanguageModelCallStartEvent) => void | PromiseLike<void>;
|
|
21596
21874
|
onLanguageModelCallEnd?: (event: AISDKV7LanguageModelCallEndEvent) => void | PromiseLike<void>;
|
|
21597
21875
|
onObjectStepStart?: (event: AISDKV7ObjectStepStartEvent) => void | PromiseLike<void>;
|
|
21598
|
-
|
|
21876
|
+
onObjectStepEnd?: (event: AISDKV7ObjectStepEndEvent) => void | PromiseLike<void>;
|
|
21599
21877
|
onEmbedStart?: (event: AISDKV7EmbedStartEvent) => void | PromiseLike<void>;
|
|
21600
|
-
|
|
21878
|
+
onEmbedEnd?: (event: AISDKV7EmbedEndEvent) => void | PromiseLike<void>;
|
|
21601
21879
|
onRerankStart?: (event: AISDKV7RerankStartEvent) => void | PromiseLike<void>;
|
|
21602
|
-
|
|
21880
|
+
onRerankEnd?: (event: AISDKV7RerankEndEvent) => void | PromiseLike<void>;
|
|
21603
21881
|
onToolExecutionStart?: (event: AISDKV7ToolExecutionStartEvent) => void | PromiseLike<void>;
|
|
21604
21882
|
onToolExecutionEnd?: (event: AISDKV7ToolExecutionEndEvent) => void | PromiseLike<void>;
|
|
21605
21883
|
onChunk?: (event: AISDKV7ChunkEvent) => void | PromiseLike<void>;
|
|
21884
|
+
onStepEnd?: (event: unknown) => void | PromiseLike<void>;
|
|
21606
21885
|
onStepFinish?: (event: unknown) => void | PromiseLike<void>;
|
|
21607
|
-
|
|
21886
|
+
onEnd?: (event: AISDKV7OperationEvent) => void | PromiseLike<void>;
|
|
21887
|
+
onAbort?: (event: unknown) => void | PromiseLike<void>;
|
|
21608
21888
|
onError?: (event: unknown) => void | PromiseLike<void>;
|
|
21609
21889
|
executeTool?: <T>(options: {
|
|
21610
21890
|
callId: string;
|
|
21611
21891
|
toolCallId: string;
|
|
21612
21892
|
execute: () => PromiseLike<T>;
|
|
21893
|
+
[BRAINTRUST_AI_SDK_V7_OPERATION_KEY]?: string;
|
|
21613
21894
|
}) => PromiseLike<T>;
|
|
21614
21895
|
}
|
|
21615
21896
|
|
|
@@ -22605,7 +22886,7 @@ declare class SpanFetcher extends ObjectFetcher<SpanRecord> {
|
|
|
22605
22886
|
private readonly rootSpanId;
|
|
22606
22887
|
private readonly _state;
|
|
22607
22888
|
private readonly spanTypeFilter?;
|
|
22608
|
-
constructor(objectType: "experiment" | "project_logs" | "playground_logs", _objectId: string, rootSpanId: string, _state: BraintrustState, spanTypeFilter?: string[] | undefined, includeScorers?: boolean);
|
|
22889
|
+
constructor(objectType: "experiment" | "project_logs" | "playground_logs", _objectId: string, rootSpanId: string, _state: BraintrustState, spanTypeFilter?: string[] | undefined, includeScorers?: boolean, brainstoreRealtime?: boolean);
|
|
22609
22890
|
private static buildFilter;
|
|
22610
22891
|
get id(): Promise<string>;
|
|
22611
22892
|
protected getState(): Promise<BraintrustState>;
|
|
@@ -22640,7 +22921,7 @@ declare class CachedSpanFetcher {
|
|
|
22640
22921
|
private spanCache;
|
|
22641
22922
|
private allFetched;
|
|
22642
22923
|
private fetchFn;
|
|
22643
|
-
constructor(objectType: "experiment" | "project_logs" | "playground_logs", objectId: string, rootSpanId: string, getState: () => Promise<BraintrustState
|
|
22924
|
+
constructor(objectType: "experiment" | "project_logs" | "playground_logs", objectId: string, rootSpanId: string, getState: () => Promise<BraintrustState>, brainstoreRealtime?: boolean);
|
|
22644
22925
|
constructor(fetchFn: SpanFetchFn);
|
|
22645
22926
|
getSpans({ spanType, includeScorers, }?: {
|
|
22646
22927
|
spanType?: string[];
|
|
@@ -26993,18 +27274,21 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
|
|
|
26993
27274
|
choice_scores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
26994
27275
|
choice: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26995
27276
|
allow_no_match: z.ZodOptional<z.ZodBoolean>;
|
|
27277
|
+
allow_skip: z.ZodOptional<z.ZodBoolean>;
|
|
26996
27278
|
}, "strip", z.ZodTypeAny, {
|
|
26997
27279
|
type: "llm_classifier";
|
|
26998
27280
|
use_cot: boolean;
|
|
26999
27281
|
choice_scores?: Record<string, number> | undefined;
|
|
27000
27282
|
choice?: string[] | undefined;
|
|
27001
27283
|
allow_no_match?: boolean | undefined;
|
|
27284
|
+
allow_skip?: boolean | undefined;
|
|
27002
27285
|
}, {
|
|
27003
27286
|
type: "llm_classifier";
|
|
27004
27287
|
use_cot: boolean;
|
|
27005
27288
|
choice_scores?: Record<string, number> | undefined;
|
|
27006
27289
|
choice?: string[] | undefined;
|
|
27007
27290
|
allow_no_match?: boolean | undefined;
|
|
27291
|
+
allow_skip?: boolean | undefined;
|
|
27008
27292
|
}>, z.ZodNull]>>;
|
|
27009
27293
|
tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
27010
27294
|
type: z.ZodLiteral<"function">;
|
|
@@ -27304,6 +27588,7 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
|
|
|
27304
27588
|
choice_scores?: Record<string, number> | undefined;
|
|
27305
27589
|
choice?: string[] | undefined;
|
|
27306
27590
|
allow_no_match?: boolean | undefined;
|
|
27591
|
+
allow_skip?: boolean | undefined;
|
|
27307
27592
|
} | null | undefined;
|
|
27308
27593
|
tool_functions?: ({
|
|
27309
27594
|
type: "function";
|
|
@@ -27554,6 +27839,7 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
|
|
|
27554
27839
|
choice_scores?: Record<string, number> | undefined;
|
|
27555
27840
|
choice?: string[] | undefined;
|
|
27556
27841
|
allow_no_match?: boolean | undefined;
|
|
27842
|
+
allow_skip?: boolean | undefined;
|
|
27557
27843
|
} | null | undefined;
|
|
27558
27844
|
tool_functions?: ({
|
|
27559
27845
|
type: "function";
|
|
@@ -27809,6 +28095,7 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
|
|
|
27809
28095
|
choice_scores?: Record<string, number> | undefined;
|
|
27810
28096
|
choice?: string[] | undefined;
|
|
27811
28097
|
allow_no_match?: boolean | undefined;
|
|
28098
|
+
allow_skip?: boolean | undefined;
|
|
27812
28099
|
} | null | undefined;
|
|
27813
28100
|
tool_functions?: ({
|
|
27814
28101
|
type: "function";
|
|
@@ -28063,6 +28350,7 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
|
|
|
28063
28350
|
choice_scores?: Record<string, number> | undefined;
|
|
28064
28351
|
choice?: string[] | undefined;
|
|
28065
28352
|
allow_no_match?: boolean | undefined;
|
|
28353
|
+
allow_skip?: boolean | undefined;
|
|
28066
28354
|
} | null | undefined;
|
|
28067
28355
|
tool_functions?: ({
|
|
28068
28356
|
type: "function";
|
|
@@ -29416,18 +29704,21 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
29416
29704
|
choice_scores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
29417
29705
|
choice: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
29418
29706
|
allow_no_match: z.ZodOptional<z.ZodBoolean>;
|
|
29707
|
+
allow_skip: z.ZodOptional<z.ZodBoolean>;
|
|
29419
29708
|
}, "strip", z.ZodTypeAny, {
|
|
29420
29709
|
type: "llm_classifier";
|
|
29421
29710
|
use_cot: boolean;
|
|
29422
29711
|
choice_scores?: Record<string, number> | undefined;
|
|
29423
29712
|
choice?: string[] | undefined;
|
|
29424
29713
|
allow_no_match?: boolean | undefined;
|
|
29714
|
+
allow_skip?: boolean | undefined;
|
|
29425
29715
|
}, {
|
|
29426
29716
|
type: "llm_classifier";
|
|
29427
29717
|
use_cot: boolean;
|
|
29428
29718
|
choice_scores?: Record<string, number> | undefined;
|
|
29429
29719
|
choice?: string[] | undefined;
|
|
29430
29720
|
allow_no_match?: boolean | undefined;
|
|
29721
|
+
allow_skip?: boolean | undefined;
|
|
29431
29722
|
}>, z.ZodNull]>>;
|
|
29432
29723
|
tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
29433
29724
|
type: z.ZodLiteral<"function">;
|
|
@@ -29727,6 +30018,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
29727
30018
|
choice_scores?: Record<string, number> | undefined;
|
|
29728
30019
|
choice?: string[] | undefined;
|
|
29729
30020
|
allow_no_match?: boolean | undefined;
|
|
30021
|
+
allow_skip?: boolean | undefined;
|
|
29730
30022
|
} | null | undefined;
|
|
29731
30023
|
tool_functions?: ({
|
|
29732
30024
|
type: "function";
|
|
@@ -29977,6 +30269,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
29977
30269
|
choice_scores?: Record<string, number> | undefined;
|
|
29978
30270
|
choice?: string[] | undefined;
|
|
29979
30271
|
allow_no_match?: boolean | undefined;
|
|
30272
|
+
allow_skip?: boolean | undefined;
|
|
29980
30273
|
} | null | undefined;
|
|
29981
30274
|
tool_functions?: ({
|
|
29982
30275
|
type: "function";
|
|
@@ -30232,6 +30525,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
30232
30525
|
choice_scores?: Record<string, number> | undefined;
|
|
30233
30526
|
choice?: string[] | undefined;
|
|
30234
30527
|
allow_no_match?: boolean | undefined;
|
|
30528
|
+
allow_skip?: boolean | undefined;
|
|
30235
30529
|
} | null | undefined;
|
|
30236
30530
|
tool_functions?: ({
|
|
30237
30531
|
type: "function";
|
|
@@ -30486,6 +30780,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
30486
30780
|
choice_scores?: Record<string, number> | undefined;
|
|
30487
30781
|
choice?: string[] | undefined;
|
|
30488
30782
|
allow_no_match?: boolean | undefined;
|
|
30783
|
+
allow_skip?: boolean | undefined;
|
|
30489
30784
|
} | null | undefined;
|
|
30490
30785
|
tool_functions?: ({
|
|
30491
30786
|
type: "function";
|
|
@@ -30771,6 +31066,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
30771
31066
|
choice_scores?: Record<string, number> | undefined;
|
|
30772
31067
|
choice?: string[] | undefined;
|
|
30773
31068
|
allow_no_match?: boolean | undefined;
|
|
31069
|
+
allow_skip?: boolean | undefined;
|
|
30774
31070
|
} | null | undefined;
|
|
30775
31071
|
tool_functions?: ({
|
|
30776
31072
|
type: "function";
|
|
@@ -31038,6 +31334,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
31038
31334
|
choice_scores?: Record<string, number> | undefined;
|
|
31039
31335
|
choice?: string[] | undefined;
|
|
31040
31336
|
allow_no_match?: boolean | undefined;
|
|
31337
|
+
allow_skip?: boolean | undefined;
|
|
31041
31338
|
} | null | undefined;
|
|
31042
31339
|
tool_functions?: ({
|
|
31043
31340
|
type: "function";
|
|
@@ -32283,18 +32580,21 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
32283
32580
|
choice_scores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
32284
32581
|
choice: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
32285
32582
|
allow_no_match: z.ZodOptional<z.ZodBoolean>;
|
|
32583
|
+
allow_skip: z.ZodOptional<z.ZodBoolean>;
|
|
32286
32584
|
}, "strip", z.ZodTypeAny, {
|
|
32287
32585
|
type: "llm_classifier";
|
|
32288
32586
|
use_cot: boolean;
|
|
32289
32587
|
choice_scores?: Record<string, number> | undefined;
|
|
32290
32588
|
choice?: string[] | undefined;
|
|
32291
32589
|
allow_no_match?: boolean | undefined;
|
|
32590
|
+
allow_skip?: boolean | undefined;
|
|
32292
32591
|
}, {
|
|
32293
32592
|
type: "llm_classifier";
|
|
32294
32593
|
use_cot: boolean;
|
|
32295
32594
|
choice_scores?: Record<string, number> | undefined;
|
|
32296
32595
|
choice?: string[] | undefined;
|
|
32297
32596
|
allow_no_match?: boolean | undefined;
|
|
32597
|
+
allow_skip?: boolean | undefined;
|
|
32298
32598
|
}>, z.ZodNull]>>;
|
|
32299
32599
|
tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
32300
32600
|
type: z.ZodLiteral<"function">;
|
|
@@ -32594,6 +32894,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
32594
32894
|
choice_scores?: Record<string, number> | undefined;
|
|
32595
32895
|
choice?: string[] | undefined;
|
|
32596
32896
|
allow_no_match?: boolean | undefined;
|
|
32897
|
+
allow_skip?: boolean | undefined;
|
|
32597
32898
|
} | null | undefined;
|
|
32598
32899
|
tool_functions?: ({
|
|
32599
32900
|
type: "function";
|
|
@@ -32844,6 +33145,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
32844
33145
|
choice_scores?: Record<string, number> | undefined;
|
|
32845
33146
|
choice?: string[] | undefined;
|
|
32846
33147
|
allow_no_match?: boolean | undefined;
|
|
33148
|
+
allow_skip?: boolean | undefined;
|
|
32847
33149
|
} | null | undefined;
|
|
32848
33150
|
tool_functions?: ({
|
|
32849
33151
|
type: "function";
|
|
@@ -33099,6 +33401,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
33099
33401
|
choice_scores?: Record<string, number> | undefined;
|
|
33100
33402
|
choice?: string[] | undefined;
|
|
33101
33403
|
allow_no_match?: boolean | undefined;
|
|
33404
|
+
allow_skip?: boolean | undefined;
|
|
33102
33405
|
} | null | undefined;
|
|
33103
33406
|
tool_functions?: ({
|
|
33104
33407
|
type: "function";
|
|
@@ -33353,6 +33656,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
33353
33656
|
choice_scores?: Record<string, number> | undefined;
|
|
33354
33657
|
choice?: string[] | undefined;
|
|
33355
33658
|
allow_no_match?: boolean | undefined;
|
|
33659
|
+
allow_skip?: boolean | undefined;
|
|
33356
33660
|
} | null | undefined;
|
|
33357
33661
|
tool_functions?: ({
|
|
33358
33662
|
type: "function";
|
|
@@ -33650,6 +33954,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
33650
33954
|
choice_scores?: Record<string, number> | undefined;
|
|
33651
33955
|
choice?: string[] | undefined;
|
|
33652
33956
|
allow_no_match?: boolean | undefined;
|
|
33957
|
+
allow_skip?: boolean | undefined;
|
|
33653
33958
|
} | null | undefined;
|
|
33654
33959
|
tool_functions?: ({
|
|
33655
33960
|
type: "function";
|
|
@@ -33930,6 +34235,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
33930
34235
|
choice_scores?: Record<string, number> | undefined;
|
|
33931
34236
|
choice?: string[] | undefined;
|
|
33932
34237
|
allow_no_match?: boolean | undefined;
|
|
34238
|
+
allow_skip?: boolean | undefined;
|
|
33933
34239
|
} | null | undefined;
|
|
33934
34240
|
tool_functions?: ({
|
|
33935
34241
|
type: "function";
|
|
@@ -34203,6 +34509,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
34203
34509
|
choice_scores?: Record<string, number> | undefined;
|
|
34204
34510
|
choice?: string[] | undefined;
|
|
34205
34511
|
allow_no_match?: boolean | undefined;
|
|
34512
|
+
allow_skip?: boolean | undefined;
|
|
34206
34513
|
} | null | undefined;
|
|
34207
34514
|
tool_functions?: ({
|
|
34208
34515
|
type: "function";
|
|
@@ -34483,6 +34790,7 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
|
|
|
34483
34790
|
choice_scores?: Record<string, number> | undefined;
|
|
34484
34791
|
choice?: string[] | undefined;
|
|
34485
34792
|
allow_no_match?: boolean | undefined;
|
|
34793
|
+
allow_skip?: boolean | undefined;
|
|
34486
34794
|
} | null | undefined;
|
|
34487
34795
|
tool_functions?: ({
|
|
34488
34796
|
type: "function";
|
|
@@ -35807,18 +36115,21 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
35807
36115
|
choice_scores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
35808
36116
|
choice: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
35809
36117
|
allow_no_match: z.ZodOptional<z.ZodBoolean>;
|
|
36118
|
+
allow_skip: z.ZodOptional<z.ZodBoolean>;
|
|
35810
36119
|
}, "strip", z.ZodTypeAny, {
|
|
35811
36120
|
type: "llm_classifier";
|
|
35812
36121
|
use_cot: boolean;
|
|
35813
36122
|
choice_scores?: Record<string, number> | undefined;
|
|
35814
36123
|
choice?: string[] | undefined;
|
|
35815
36124
|
allow_no_match?: boolean | undefined;
|
|
36125
|
+
allow_skip?: boolean | undefined;
|
|
35816
36126
|
}, {
|
|
35817
36127
|
type: "llm_classifier";
|
|
35818
36128
|
use_cot: boolean;
|
|
35819
36129
|
choice_scores?: Record<string, number> | undefined;
|
|
35820
36130
|
choice?: string[] | undefined;
|
|
35821
36131
|
allow_no_match?: boolean | undefined;
|
|
36132
|
+
allow_skip?: boolean | undefined;
|
|
35822
36133
|
}>, z.ZodNull]>>;
|
|
35823
36134
|
tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
35824
36135
|
type: z.ZodLiteral<"function">;
|
|
@@ -36118,6 +36429,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
36118
36429
|
choice_scores?: Record<string, number> | undefined;
|
|
36119
36430
|
choice?: string[] | undefined;
|
|
36120
36431
|
allow_no_match?: boolean | undefined;
|
|
36432
|
+
allow_skip?: boolean | undefined;
|
|
36121
36433
|
} | null | undefined;
|
|
36122
36434
|
tool_functions?: ({
|
|
36123
36435
|
type: "function";
|
|
@@ -36368,6 +36680,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
36368
36680
|
choice_scores?: Record<string, number> | undefined;
|
|
36369
36681
|
choice?: string[] | undefined;
|
|
36370
36682
|
allow_no_match?: boolean | undefined;
|
|
36683
|
+
allow_skip?: boolean | undefined;
|
|
36371
36684
|
} | null | undefined;
|
|
36372
36685
|
tool_functions?: ({
|
|
36373
36686
|
type: "function";
|
|
@@ -36623,6 +36936,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
36623
36936
|
choice_scores?: Record<string, number> | undefined;
|
|
36624
36937
|
choice?: string[] | undefined;
|
|
36625
36938
|
allow_no_match?: boolean | undefined;
|
|
36939
|
+
allow_skip?: boolean | undefined;
|
|
36626
36940
|
} | null | undefined;
|
|
36627
36941
|
tool_functions?: ({
|
|
36628
36942
|
type: "function";
|
|
@@ -36877,6 +37191,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
36877
37191
|
choice_scores?: Record<string, number> | undefined;
|
|
36878
37192
|
choice?: string[] | undefined;
|
|
36879
37193
|
allow_no_match?: boolean | undefined;
|
|
37194
|
+
allow_skip?: boolean | undefined;
|
|
36880
37195
|
} | null | undefined;
|
|
36881
37196
|
tool_functions?: ({
|
|
36882
37197
|
type: "function";
|
|
@@ -37162,6 +37477,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
37162
37477
|
choice_scores?: Record<string, number> | undefined;
|
|
37163
37478
|
choice?: string[] | undefined;
|
|
37164
37479
|
allow_no_match?: boolean | undefined;
|
|
37480
|
+
allow_skip?: boolean | undefined;
|
|
37165
37481
|
} | null | undefined;
|
|
37166
37482
|
tool_functions?: ({
|
|
37167
37483
|
type: "function";
|
|
@@ -37429,6 +37745,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
37429
37745
|
choice_scores?: Record<string, number> | undefined;
|
|
37430
37746
|
choice?: string[] | undefined;
|
|
37431
37747
|
allow_no_match?: boolean | undefined;
|
|
37748
|
+
allow_skip?: boolean | undefined;
|
|
37432
37749
|
} | null | undefined;
|
|
37433
37750
|
tool_functions?: ({
|
|
37434
37751
|
type: "function";
|
|
@@ -38674,18 +38991,21 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
38674
38991
|
choice_scores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
38675
38992
|
choice: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
38676
38993
|
allow_no_match: z.ZodOptional<z.ZodBoolean>;
|
|
38994
|
+
allow_skip: z.ZodOptional<z.ZodBoolean>;
|
|
38677
38995
|
}, "strip", z.ZodTypeAny, {
|
|
38678
38996
|
type: "llm_classifier";
|
|
38679
38997
|
use_cot: boolean;
|
|
38680
38998
|
choice_scores?: Record<string, number> | undefined;
|
|
38681
38999
|
choice?: string[] | undefined;
|
|
38682
39000
|
allow_no_match?: boolean | undefined;
|
|
39001
|
+
allow_skip?: boolean | undefined;
|
|
38683
39002
|
}, {
|
|
38684
39003
|
type: "llm_classifier";
|
|
38685
39004
|
use_cot: boolean;
|
|
38686
39005
|
choice_scores?: Record<string, number> | undefined;
|
|
38687
39006
|
choice?: string[] | undefined;
|
|
38688
39007
|
allow_no_match?: boolean | undefined;
|
|
39008
|
+
allow_skip?: boolean | undefined;
|
|
38689
39009
|
}>, z.ZodNull]>>;
|
|
38690
39010
|
tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
38691
39011
|
type: z.ZodLiteral<"function">;
|
|
@@ -38985,6 +39305,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
38985
39305
|
choice_scores?: Record<string, number> | undefined;
|
|
38986
39306
|
choice?: string[] | undefined;
|
|
38987
39307
|
allow_no_match?: boolean | undefined;
|
|
39308
|
+
allow_skip?: boolean | undefined;
|
|
38988
39309
|
} | null | undefined;
|
|
38989
39310
|
tool_functions?: ({
|
|
38990
39311
|
type: "function";
|
|
@@ -39235,6 +39556,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
39235
39556
|
choice_scores?: Record<string, number> | undefined;
|
|
39236
39557
|
choice?: string[] | undefined;
|
|
39237
39558
|
allow_no_match?: boolean | undefined;
|
|
39559
|
+
allow_skip?: boolean | undefined;
|
|
39238
39560
|
} | null | undefined;
|
|
39239
39561
|
tool_functions?: ({
|
|
39240
39562
|
type: "function";
|
|
@@ -39490,6 +39812,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
39490
39812
|
choice_scores?: Record<string, number> | undefined;
|
|
39491
39813
|
choice?: string[] | undefined;
|
|
39492
39814
|
allow_no_match?: boolean | undefined;
|
|
39815
|
+
allow_skip?: boolean | undefined;
|
|
39493
39816
|
} | null | undefined;
|
|
39494
39817
|
tool_functions?: ({
|
|
39495
39818
|
type: "function";
|
|
@@ -39744,6 +40067,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
39744
40067
|
choice_scores?: Record<string, number> | undefined;
|
|
39745
40068
|
choice?: string[] | undefined;
|
|
39746
40069
|
allow_no_match?: boolean | undefined;
|
|
40070
|
+
allow_skip?: boolean | undefined;
|
|
39747
40071
|
} | null | undefined;
|
|
39748
40072
|
tool_functions?: ({
|
|
39749
40073
|
type: "function";
|
|
@@ -40041,6 +40365,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
40041
40365
|
choice_scores?: Record<string, number> | undefined;
|
|
40042
40366
|
choice?: string[] | undefined;
|
|
40043
40367
|
allow_no_match?: boolean | undefined;
|
|
40368
|
+
allow_skip?: boolean | undefined;
|
|
40044
40369
|
} | null | undefined;
|
|
40045
40370
|
tool_functions?: ({
|
|
40046
40371
|
type: "function";
|
|
@@ -40321,6 +40646,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
40321
40646
|
choice_scores?: Record<string, number> | undefined;
|
|
40322
40647
|
choice?: string[] | undefined;
|
|
40323
40648
|
allow_no_match?: boolean | undefined;
|
|
40649
|
+
allow_skip?: boolean | undefined;
|
|
40324
40650
|
} | null | undefined;
|
|
40325
40651
|
tool_functions?: ({
|
|
40326
40652
|
type: "function";
|
|
@@ -40594,6 +40920,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
40594
40920
|
choice_scores?: Record<string, number> | undefined;
|
|
40595
40921
|
choice?: string[] | undefined;
|
|
40596
40922
|
allow_no_match?: boolean | undefined;
|
|
40923
|
+
allow_skip?: boolean | undefined;
|
|
40597
40924
|
} | null | undefined;
|
|
40598
40925
|
tool_functions?: ({
|
|
40599
40926
|
type: "function";
|
|
@@ -40874,6 +41201,7 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
40874
41201
|
choice_scores?: Record<string, number> | undefined;
|
|
40875
41202
|
choice?: string[] | undefined;
|
|
40876
41203
|
allow_no_match?: boolean | undefined;
|
|
41204
|
+
allow_skip?: boolean | undefined;
|
|
40877
41205
|
} | null | undefined;
|
|
40878
41206
|
tool_functions?: ({
|
|
40879
41207
|
type: "function";
|
|
@@ -41220,7 +41548,7 @@ type EvalClassifier<Input, Output, Expected, Metadata extends BaseMetadata = Def
|
|
|
41220
41548
|
type EvalResult<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = EvalCase<Input, Expected, Metadata> & {
|
|
41221
41549
|
output: Output;
|
|
41222
41550
|
error: unknown;
|
|
41223
|
-
origin?: ObjectReferenceType
|
|
41551
|
+
origin?: ObjectReferenceType;
|
|
41224
41552
|
scores: Record<string, number | null>;
|
|
41225
41553
|
classifications?: Record<string, ClassificationItem[]>;
|
|
41226
41554
|
};
|
|
@@ -41483,6 +41811,174 @@ type ScoreAccumulator = {
|
|
|
41483
41811
|
declare function buildLocalSummary(evaluator: EvaluatorDef<any, any, any, any>, results: EvalResult<any, any, any, any>[], precomputedScores?: ScoreAccumulator): ExperimentSummary;
|
|
41484
41812
|
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;
|
|
41485
41813
|
|
|
41814
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
41815
|
+
type AssertionMatcher = RegExp | ((value: unknown) => boolean) | readonly AssertionMatcher[] | {
|
|
41816
|
+
[key: string]: AssertionMatcher;
|
|
41817
|
+
} | string | number | boolean | null | undefined;
|
|
41818
|
+
interface ToolCallAssertionOptions {
|
|
41819
|
+
/**
|
|
41820
|
+
* Match against the tool call input. Objects are matched partially, arrays
|
|
41821
|
+
* are matched recursively, regular expressions match raw strings as-is and
|
|
41822
|
+
* formatted non-string values, and functions are treated as predicates.
|
|
41823
|
+
*/
|
|
41824
|
+
input?: AssertionMatcher;
|
|
41825
|
+
/**
|
|
41826
|
+
* Match against the tool call output. Objects are matched partially, arrays
|
|
41827
|
+
* are matched recursively, regular expressions match raw strings as-is and
|
|
41828
|
+
* formatted non-string values, and functions are treated as predicates.
|
|
41829
|
+
*/
|
|
41830
|
+
output?: AssertionMatcher;
|
|
41831
|
+
/** If set, require the matching tool call to have, or not have, an error. */
|
|
41832
|
+
isError?: boolean;
|
|
41833
|
+
/** If set, require exactly this many matching calls. */
|
|
41834
|
+
times?: number;
|
|
41835
|
+
}
|
|
41836
|
+
interface AgentAssertion {
|
|
41837
|
+
name: string;
|
|
41838
|
+
evaluate: (resources: AgentAssertionResources) => MaybePromise<{
|
|
41839
|
+
passed: boolean;
|
|
41840
|
+
failure?: string;
|
|
41841
|
+
}>;
|
|
41842
|
+
requiresTrace?: boolean;
|
|
41843
|
+
}
|
|
41844
|
+
interface AgentAssertionHelpers {
|
|
41845
|
+
/**
|
|
41846
|
+
* Assert that two values are deeply equal.
|
|
41847
|
+
*
|
|
41848
|
+
* @param actual - The value produced by the task or derived by the scorer.
|
|
41849
|
+
* @param expected - The value to compare against.
|
|
41850
|
+
* @param name - Optional assertion name. Defaults to `"equals"`.
|
|
41851
|
+
*/
|
|
41852
|
+
equals: (actual: unknown, expected: unknown, name?: string) => AgentAssertion;
|
|
41853
|
+
/**
|
|
41854
|
+
* Assert that two values are not deeply equal.
|
|
41855
|
+
*
|
|
41856
|
+
* @param actual - The value produced by the task or derived by the scorer.
|
|
41857
|
+
* @param expected - The value that should not be returned.
|
|
41858
|
+
* @param name - Optional assertion name. Defaults to `"not equals"`.
|
|
41859
|
+
*/
|
|
41860
|
+
notEquals: (actual: unknown, expected: unknown, name?: string) => AgentAssertion;
|
|
41861
|
+
/**
|
|
41862
|
+
* Assert that a value contains a substring or matches a regular expression.
|
|
41863
|
+
* Regular expressions test raw strings as-is and formatted non-string values.
|
|
41864
|
+
*
|
|
41865
|
+
* @param value - The value to inspect.
|
|
41866
|
+
* @param expected - The substring or regular expression to find.
|
|
41867
|
+
* @param name - Optional assertion name. Defaults to `"contains"`.
|
|
41868
|
+
*/
|
|
41869
|
+
contains: (value: unknown, expected: string | RegExp, name?: string) => AgentAssertion;
|
|
41870
|
+
/**
|
|
41871
|
+
* Assert that a value matches a schema.
|
|
41872
|
+
*
|
|
41873
|
+
* Supports schemas with `safeParse` or `parse`, such as Zod, and Standard
|
|
41874
|
+
* Schema `~standard.validate`, used by libraries such as Valibot and ArkType.
|
|
41875
|
+
*
|
|
41876
|
+
* @param value - The value to validate.
|
|
41877
|
+
* @param schema - The schema to validate against.
|
|
41878
|
+
* @param name - Optional assertion name. Defaults to `"matches schema"`.
|
|
41879
|
+
*/
|
|
41880
|
+
matches: (value: unknown, schema: SchemaLike, name?: string) => AgentAssertion;
|
|
41881
|
+
/**
|
|
41882
|
+
* Assert that a tool was called, optionally constrained by input, output,
|
|
41883
|
+
* error state, or exact call count.
|
|
41884
|
+
*
|
|
41885
|
+
* @param toolName - The tool name to find in trace spans.
|
|
41886
|
+
* @param options - Optional constraints for matching calls.
|
|
41887
|
+
* @param name - Optional assertion name. Defaults to `"called tool ${toolName}"`.
|
|
41888
|
+
*/
|
|
41889
|
+
calledTool: (toolName: string, options?: ToolCallAssertionOptions, name?: string) => AgentAssertion;
|
|
41890
|
+
/**
|
|
41891
|
+
* Assert that a tool was not called.
|
|
41892
|
+
*
|
|
41893
|
+
* @param toolName - The tool name to reject in trace spans.
|
|
41894
|
+
* @param name - Optional assertion name. Defaults to `"did not call tool ${toolName}"`.
|
|
41895
|
+
*/
|
|
41896
|
+
notCalledTool: (toolName: string, name?: string) => AgentAssertion;
|
|
41897
|
+
/**
|
|
41898
|
+
* Assert that tools were called in the given relative order.
|
|
41899
|
+
*
|
|
41900
|
+
* The tools do not need to be adjacent. Extra tool calls between them are
|
|
41901
|
+
* allowed.
|
|
41902
|
+
*
|
|
41903
|
+
* @param toolNames - The ordered list of tool names to find.
|
|
41904
|
+
* @param name - Optional assertion name. Defaults to `"tool order"`.
|
|
41905
|
+
*/
|
|
41906
|
+
toolOrder: (toolNames: string[], name?: string) => AgentAssertion;
|
|
41907
|
+
/**
|
|
41908
|
+
* Assert that the task made no tool calls.
|
|
41909
|
+
*
|
|
41910
|
+
* @param name - Optional assertion name. Defaults to `"used no tools"`.
|
|
41911
|
+
*/
|
|
41912
|
+
usedNoTools: (name?: string) => AgentAssertion;
|
|
41913
|
+
/**
|
|
41914
|
+
* Assert that the task made no more than `max` tool calls.
|
|
41915
|
+
*
|
|
41916
|
+
* @param max - The maximum number of allowed tool calls.
|
|
41917
|
+
* @param name - Optional assertion name. Defaults to `"at most ${max} tool calls"`.
|
|
41918
|
+
*/
|
|
41919
|
+
maxToolCalls: (max: number, name?: string) => AgentAssertion;
|
|
41920
|
+
}
|
|
41921
|
+
type AgentAssertionScorerCallback<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = (args: AgentAssertionScorerCallbackArgs<Input, Output, Expected, Metadata>) => MaybePromise<AgentAssertion[]>;
|
|
41922
|
+
type AgentAssertionScorerCallbackArgs<Input, Output, Expected, Metadata extends BaseMetadata> = Omit<EvalScorerArgs<Input, Output, Expected, Metadata>, "metadata" | "trace"> & {
|
|
41923
|
+
/**
|
|
41924
|
+
* Row metadata passed to the Eval scorer. Defaults to an empty object when
|
|
41925
|
+
* the Eval row does not have typed metadata.
|
|
41926
|
+
*/
|
|
41927
|
+
metadata: Metadata extends void ? Record<string, unknown> : Metadata;
|
|
41928
|
+
/** Helpers for building assertions from Eval inputs, outputs, and traces. */
|
|
41929
|
+
assert: AgentAssertionHelpers;
|
|
41930
|
+
};
|
|
41931
|
+
interface AgentAssertionResources {
|
|
41932
|
+
spans?: SpanData[];
|
|
41933
|
+
}
|
|
41934
|
+
type SchemaLike = {
|
|
41935
|
+
safeParse: (value: unknown) => {
|
|
41936
|
+
success: boolean;
|
|
41937
|
+
error?: unknown;
|
|
41938
|
+
};
|
|
41939
|
+
} | {
|
|
41940
|
+
parse: (value: unknown) => unknown;
|
|
41941
|
+
} | {
|
|
41942
|
+
"~standard": {
|
|
41943
|
+
validate: (value: unknown) => MaybePromise<unknown>;
|
|
41944
|
+
};
|
|
41945
|
+
};
|
|
41946
|
+
/**
|
|
41947
|
+
* Create an Eval scorer that will evaluate an agent based on assertions on the
|
|
41948
|
+
* generated trace.
|
|
41949
|
+
*
|
|
41950
|
+
* The callback receives `input`, `output`, `expected`, `metadata` plus an `assert`
|
|
41951
|
+
* helper object. It should return the assertions to evaluate the agent against.
|
|
41952
|
+
*
|
|
41953
|
+
* **Important**: Tool-call assertions require Braintrust tracing to be set up
|
|
41954
|
+
* during the Eval so the scorer can read tool spans from the trace.
|
|
41955
|
+
*
|
|
41956
|
+
* The score emitted by this scorer is the fraction of assertions that passed. If there are no
|
|
41957
|
+
* assertions, the score is `1`. The score metadata includes every assertion's name and
|
|
41958
|
+
* pass/fail state, plus human-readable failure messages.
|
|
41959
|
+
*
|
|
41960
|
+
* @example
|
|
41961
|
+
* ```ts
|
|
41962
|
+
* import { Eval, agentAssertionScorer } from "braintrust";
|
|
41963
|
+
*
|
|
41964
|
+
* await Eval("agent-eval", {
|
|
41965
|
+
* data: () => [{ input: "What is the capital of Estonia?" }],
|
|
41966
|
+
* task: async () => ({ answer: "Tallinn is the capital of Estonia." }),
|
|
41967
|
+
* scores: [
|
|
41968
|
+
* agentAssertionScorer(({ output, assert }) => [
|
|
41969
|
+
* assert.contains(output.answer, /Tallinn/i, "mentions Tallinn"),
|
|
41970
|
+
* assert.calledTool("web_search", { times: 1 }, "searched once"),
|
|
41971
|
+
* assert.maxToolCalls(3, "bounded tool use"),
|
|
41972
|
+
* ]),
|
|
41973
|
+
* ],
|
|
41974
|
+
* });
|
|
41975
|
+
* ```
|
|
41976
|
+
*/
|
|
41977
|
+
declare function agentAssertionScorer<Input, Output, Expected = void, Metadata extends BaseMetadata = DefaultMetadataType>(callback: AgentAssertionScorerCallback<Input, Output, Expected, Metadata>, options?: {
|
|
41978
|
+
/** The score name to emit. Defaults to `"assertions"`. */
|
|
41979
|
+
name?: string;
|
|
41980
|
+
}): EvalScorer<Input, Output, Expected, Metadata>;
|
|
41981
|
+
|
|
41486
41982
|
type DatasetPipelineRow = {
|
|
41487
41983
|
input?: unknown;
|
|
41488
41984
|
expected?: unknown;
|
|
@@ -41742,8 +42238,10 @@ type exports$1_Attachment = Attachment;
|
|
|
41742
42238
|
declare const exports$1_Attachment: typeof Attachment;
|
|
41743
42239
|
type exports$1_AttachmentParams = AttachmentParams;
|
|
41744
42240
|
declare const exports$1_AttachmentReference: typeof AttachmentReference;
|
|
42241
|
+
declare const exports$1_BAGGAGE_HEADER: typeof BAGGAGE_HEADER;
|
|
41745
42242
|
declare const exports$1_BRAINTRUST_CURRENT_SPAN_STORE: typeof BRAINTRUST_CURRENT_SPAN_STORE;
|
|
41746
42243
|
declare const exports$1_BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME: typeof BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME;
|
|
42244
|
+
declare const exports$1_BRAINTRUST_PARENT_KEY: typeof BRAINTRUST_PARENT_KEY;
|
|
41747
42245
|
type exports$1_BackgroundLoggerOpts = BackgroundLoggerOpts;
|
|
41748
42246
|
type exports$1_BaseAttachment = BaseAttachment;
|
|
41749
42247
|
declare const exports$1_BaseAttachment: typeof BaseAttachment;
|
|
@@ -41860,6 +42358,8 @@ declare const exports$1_NOOP_SPAN: typeof NOOP_SPAN;
|
|
|
41860
42358
|
declare const exports$1_NOOP_SPAN_PERMALINK: typeof NOOP_SPAN_PERMALINK;
|
|
41861
42359
|
type exports$1_NoopSpan = NoopSpan;
|
|
41862
42360
|
declare const exports$1_NoopSpan: typeof NoopSpan;
|
|
42361
|
+
type exports$1_OTELIDGenerator = OTELIDGenerator;
|
|
42362
|
+
declare const exports$1_OTELIDGenerator: typeof OTELIDGenerator;
|
|
41863
42363
|
type exports$1_ObjectFetcher<RecordType> = ObjectFetcher<RecordType>;
|
|
41864
42364
|
declare const exports$1_ObjectFetcher: typeof ObjectFetcher;
|
|
41865
42365
|
type exports$1_ObjectMetadata = ObjectMetadata;
|
|
@@ -41867,6 +42367,7 @@ type exports$1_OtherExperimentLogFields = OtherExperimentLogFields;
|
|
|
41867
42367
|
type exports$1_ParametersSource = ParametersSource;
|
|
41868
42368
|
type exports$1_ParentExperimentIds = ParentExperimentIds;
|
|
41869
42369
|
type exports$1_ParentProjectLogIds = ParentProjectLogIds;
|
|
42370
|
+
type exports$1_ParsedTraceparent = ParsedTraceparent;
|
|
41870
42371
|
type exports$1_Project = Project;
|
|
41871
42372
|
declare const exports$1_Project: typeof Project;
|
|
41872
42373
|
type exports$1_ProjectNameIdMap = ProjectNameIdMap;
|
|
@@ -41881,6 +42382,8 @@ type exports$1_PromptDefinition = PromptDefinition;
|
|
|
41881
42382
|
type exports$1_PromptDefinitionWithTools = PromptDefinitionWithTools;
|
|
41882
42383
|
type exports$1_PromptOpts<HasId extends boolean, HasVersion extends boolean, HasTools extends boolean = true, HasNoTrace extends boolean = true> = PromptOpts<HasId, HasVersion, HasTools, HasNoTrace>;
|
|
41883
42384
|
type exports$1_PromptRowWithId<HasId extends boolean = true, HasVersion extends boolean = true> = PromptRowWithId<HasId, HasVersion>;
|
|
42385
|
+
type exports$1_PropagatedState = PropagatedState;
|
|
42386
|
+
type exports$1_PropagationContext = PropagationContext;
|
|
41884
42387
|
type exports$1_ReadonlyAttachment = ReadonlyAttachment;
|
|
41885
42388
|
declare const exports$1_ReadonlyAttachment: typeof ReadonlyAttachment;
|
|
41886
42389
|
type exports$1_ReadonlyExperiment = ReadonlyExperiment;
|
|
@@ -41904,6 +42407,8 @@ declare const exports$1_SpanFetcher: typeof SpanFetcher;
|
|
|
41904
42407
|
type exports$1_SpanImpl = SpanImpl;
|
|
41905
42408
|
declare const exports$1_SpanImpl: typeof SpanImpl;
|
|
41906
42409
|
type exports$1_StartSpanArgs = StartSpanArgs;
|
|
42410
|
+
declare const exports$1_TRACEPARENT_HEADER: typeof TRACEPARENT_HEADER;
|
|
42411
|
+
declare const exports$1_TRACESTATE_HEADER: typeof TRACESTATE_HEADER;
|
|
41907
42412
|
type exports$1_TemplateFormat = TemplateFormat;
|
|
41908
42413
|
type exports$1_TemplateRenderer = TemplateRenderer;
|
|
41909
42414
|
type exports$1_TemplateRendererPlugin = TemplateRendererPlugin;
|
|
@@ -41912,6 +42417,8 @@ declare const exports$1_TestBackgroundLogger: typeof TestBackgroundLogger;
|
|
|
41912
42417
|
type exports$1_ToolBuilder = ToolBuilder;
|
|
41913
42418
|
declare const exports$1_ToolBuilder: typeof ToolBuilder;
|
|
41914
42419
|
type exports$1_Trace = Trace;
|
|
42420
|
+
type exports$1_TraceContextCarrier = TraceContextCarrier;
|
|
42421
|
+
type exports$1_TraceContextHeaders = TraceContextHeaders;
|
|
41915
42422
|
type exports$1_UUIDGenerator = UUIDGenerator;
|
|
41916
42423
|
declare const exports$1_UUIDGenerator: typeof UUIDGenerator;
|
|
41917
42424
|
type exports$1_WithTransactionId<R> = WithTransactionId<R>;
|
|
@@ -41920,6 +42427,7 @@ declare const exports$1__exportsForTestingOnly: typeof _exportsForTestingOnly;
|
|
|
41920
42427
|
declare const exports$1__internalGetGlobalState: typeof _internalGetGlobalState;
|
|
41921
42428
|
declare const exports$1__internalSetInitialState: typeof _internalSetInitialState;
|
|
41922
42429
|
declare const exports$1_addAzureBlobHeaders: typeof addAzureBlobHeaders;
|
|
42430
|
+
declare const exports$1_agentAssertionScorer: typeof agentAssertionScorer;
|
|
41923
42431
|
declare const exports$1_braintrustAISDKTelemetry: typeof braintrustAISDKTelemetry;
|
|
41924
42432
|
declare const exports$1_braintrustFlueInstrumentation: typeof braintrustFlueInstrumentation;
|
|
41925
42433
|
declare const exports$1_braintrustFlueObserver: typeof braintrustFlueObserver;
|
|
@@ -41937,6 +42445,7 @@ declare const exports$1_deserializePlainStringAsJSON: typeof deserializePlainStr
|
|
|
41937
42445
|
declare const exports$1_devNullWritableStream: typeof devNullWritableStream;
|
|
41938
42446
|
declare const exports$1_evaluatorDefinitionSchema: typeof evaluatorDefinitionSchema;
|
|
41939
42447
|
declare const exports$1_evaluatorDefinitionsSchema: typeof evaluatorDefinitionsSchema;
|
|
42448
|
+
declare const exports$1_extractTraceContextFromHeaders: typeof extractTraceContextFromHeaders;
|
|
41940
42449
|
declare const exports$1_flush: typeof flush;
|
|
41941
42450
|
declare const exports$1_getContextManager: typeof getContextManager;
|
|
41942
42451
|
declare const exports$1_getIdGenerator: typeof getIdGenerator;
|
|
@@ -41949,6 +42458,7 @@ declare const exports$1_initExperiment: typeof initExperiment;
|
|
|
41949
42458
|
declare const exports$1_initFunction: typeof initFunction;
|
|
41950
42459
|
declare const exports$1_initLogger: typeof initLogger;
|
|
41951
42460
|
declare const exports$1_initNodeTestSuite: typeof initNodeTestSuite;
|
|
42461
|
+
declare const exports$1_injectTraceContext: typeof injectTraceContext;
|
|
41952
42462
|
declare const exports$1_invoke: typeof invoke;
|
|
41953
42463
|
declare const exports$1_isTemplateFormat: typeof isTemplateFormat;
|
|
41954
42464
|
declare const exports$1_loadParameters: typeof loadParameters;
|
|
@@ -42018,7 +42528,7 @@ declare const exports$1_wrapStrandsAgentSDK: typeof wrapStrandsAgentSDK;
|
|
|
42018
42528
|
declare const exports$1_wrapTraced: typeof wrapTraced;
|
|
42019
42529
|
declare const exports$1_wrapVitest: typeof wrapVitest;
|
|
42020
42530
|
declare namespace exports$1 {
|
|
42021
|
-
export { type exports$1_AnyDataset as AnyDataset, exports$1_Attachment as Attachment, type exports$1_AttachmentParams as AttachmentParams, exports$1_AttachmentReference as AttachmentReference, exports$1_BRAINTRUST_CURRENT_SPAN_STORE as BRAINTRUST_CURRENT_SPAN_STORE, exports$1_BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME as BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME, type exports$1_BackgroundLoggerOpts as BackgroundLoggerOpts, exports$1_BaseAttachment as BaseAttachment, exports$1_BaseExperiment as BaseExperiment, type exports$1_BaseMetadata as BaseMetadata, exports$1_BraintrustLangChainCallbackHandler as BraintrustLangChainCallbackHandler, exports$1_BraintrustMiddleware as BraintrustMiddleware, exports$1_BraintrustObservabilityExporter as BraintrustObservabilityExporter, exports$1_BraintrustState as BraintrustState, exports$1_BraintrustStream as BraintrustStream, type exports$1_BraintrustStreamChunk as BraintrustStreamChunk, exports$1_CachedSpanFetcher as CachedSpanFetcher, type exports$1_ChatPrompt as ChatPrompt, exports$1_CodeFunction as CodeFunction, type exports$1_CodeOpts as CodeOpts, exports$1_CodePrompt as CodePrompt, type exports$1_CommentEvent as CommentEvent, type exports$1_CompiledPrompt as CompiledPrompt, type exports$1_CompiledPromptParams as CompiledPromptParams, type exports$1_CompletionPrompt as CompletionPrompt, exports$1_ContextManager as ContextManager, type exports$1_ContextParentSpanIds as ContextParentSpanIds, type exports$1_CreateProjectOpts as CreateProjectOpts, type exports$1_CurrentSpanStore as CurrentSpanStore, exports$1_DEFAULT_FETCH_BATCH_SIZE as DEFAULT_FETCH_BATCH_SIZE, exports$1_DEFAULT_MAX_REQUEST_SIZE as DEFAULT_MAX_REQUEST_SIZE, type exports$1_DataSummary as DataSummary, exports$1_Dataset as Dataset, exports$1_DatasetPipeline as DatasetPipeline, type exports$1_DatasetRecord as DatasetRecord, type exports$1_DatasetRestorePreviewResult as DatasetRestorePreviewResult, type exports$1_DatasetRestoreResult as DatasetRestoreResult, type DatasetSnapshotType as DatasetSnapshot, type exports$1_DatasetSummary as DatasetSummary, type exports$1_DefaultMetadataType as DefaultMetadataType, type exports$1_DefaultPromptArgs as DefaultPromptArgs, exports$1_ERR_PERMALINK as ERR_PERMALINK, type exports$1_EndSpanArgs as EndSpanArgs, exports$1_Eval as Eval, type exports$1_EvalCase as EvalCase, type exports$1_EvalClassifier as EvalClassifier, type exports$1_EvalHooks as EvalHooks, type exports$1_EvalParameterSerializedSchema as EvalParameterSerializedSchema, type exports$1_EvalParameters as EvalParameters, type exports$1_EvalResult as EvalResult, exports$1_EvalResultWithSummary as EvalResultWithSummary, type exports$1_EvalScorer as EvalScorer, type exports$1_EvalScorerArgs as EvalScorerArgs, type exports$1_EvalTask as EvalTask, type exports$1_Evaluator as Evaluator, type exports$1_EvaluatorDef as EvaluatorDef, type exports$1_EvaluatorDefinition as EvaluatorDefinition, type exports$1_EvaluatorDefinitions as EvaluatorDefinitions, type exports$1_EvaluatorFile as EvaluatorFile, type exports$1_EvaluatorManifest as EvaluatorManifest, exports$1_Experiment as Experiment, type exports$1_ExperimentLogFullArgs as ExperimentLogFullArgs, type exports$1_ExperimentLogPartialArgs as ExperimentLogPartialArgs, type exports$1_ExperimentSummary as ExperimentSummary, type exports$1_Exportable as Exportable, exports$1_ExternalAttachment as ExternalAttachment, type exports$1_ExternalAttachmentParams as ExternalAttachmentParams, exports$1_FailedHTTPResponse as FailedHTTPResponse, type exports$1_FullInitDatasetOptions as FullInitDatasetOptions, type exports$1_FullInitOptions as FullInitOptions, type exports$1_FullLoginOptions as FullLoginOptions, type exports$1_FunctionEvent as FunctionEvent, type exports$1_GetThreadOptions as GetThreadOptions, exports$1_IDGenerator as IDGenerator, type exports$1_IdField as IdField, type exports$1_InitDatasetOptions as InitDatasetOptions, type exports$1_InitLoggerOptions as InitLoggerOptions, type exports$1_InitOptions as InitOptions, type exports$1_InputField as InputField, type exports$1_InstrumentationConfig as InstrumentationConfig, type exports$1_InvokeFunctionArgs as InvokeFunctionArgs, type exports$1_InvokeReturn as InvokeReturn, exports$1_JSONAttachment as JSONAttachment, exports$1_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, exports$1_LOGS3_OVERFLOW_REFERENCE_TYPE as LOGS3_OVERFLOW_REFERENCE_TYPE, type exports$1_LangChainCallbackHandlerOptions as LangChainCallbackHandlerOptions, exports$1_LazyValue as LazyValue, type exports$1_LoadPromptOptions as LoadPromptOptions, exports$1_LocalTrace as LocalTrace, type exports$1_LogCommentFullArgs as LogCommentFullArgs, type exports$1_LogFeedbackFullArgs as LogFeedbackFullArgs, type exports$1_LogOptions as LogOptions, exports$1_Logger as Logger, exports$1_LoginInvalidOrgError as LoginInvalidOrgError, type exports$1_LoginOptions as LoginOptions, type exports$1_Logs3OverflowInputRow as Logs3OverflowInputRow, type exports$1_Logs3OverflowUpload as Logs3OverflowUpload, type exports$1_MastraObservabilityExporter as MastraObservabilityExporter, type exports$1_MetricSummary as MetricSummary, exports$1_NOOP_SPAN as NOOP_SPAN, exports$1_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, exports$1_NoopSpan as NoopSpan, exports$1_ObjectFetcher as ObjectFetcher, type exports$1_ObjectMetadata as ObjectMetadata, type exports$1_OtherExperimentLogFields as OtherExperimentLogFields, type exports$1_ParametersSource as ParametersSource, type exports$1_ParentExperimentIds as ParentExperimentIds, type exports$1_ParentProjectLogIds as ParentProjectLogIds, exports$1_Project as Project, exports$1_ProjectNameIdMap as ProjectNameIdMap, type exports$1_PromiseUnless as PromiseUnless, exports$1_Prompt as Prompt, exports$1_PromptBuilder as PromptBuilder, type exports$1_PromptContents as PromptContents, type exports$1_PromptDefinition as PromptDefinition, type exports$1_PromptDefinitionWithTools as PromptDefinitionWithTools, type exports$1_PromptOpts as PromptOpts, type exports$1_PromptRowWithId as PromptRowWithId, exports$1_ReadonlyAttachment as ReadonlyAttachment, exports$1_ReadonlyExperiment as ReadonlyExperiment, type exports$1_RegisterSandboxOptions as RegisterSandboxOptions, type exports$1_RegisterSandboxResult as RegisterSandboxResult, exports$1_Reporter as Reporter, type exports$1_ReporterBody as ReporterBody, type exports$1_SandboxConfig as SandboxConfig, type exports$1_ScoreSummary as ScoreSummary, exports$1_ScorerBuilder as ScorerBuilder, type exports$1_ScorerOpts as ScorerOpts, type exports$1_SerializedBraintrustState as SerializedBraintrustState, type exports$1_SetCurrentArg as SetCurrentArg, type exports$1_Span as Span, type exports$1_SpanContext as SpanContext, type exports$1_SpanData as SpanData, exports$1_SpanFetcher as SpanFetcher, exports$1_SpanImpl as SpanImpl, type exports$1_StartSpanArgs as StartSpanArgs, type exports$1_TemplateFormat as TemplateFormat, type exports$1_TemplateRenderer as TemplateRenderer, type exports$1_TemplateRendererPlugin as TemplateRendererPlugin, exports$1_TestBackgroundLogger as TestBackgroundLogger, exports$1_ToolBuilder as ToolBuilder, type exports$1_Trace as Trace, exports$1_UUIDGenerator as UUIDGenerator, type exports$1_WithTransactionId as WithTransactionId, exports$1_X_CACHED_HEADER as X_CACHED_HEADER, exports$1__exportsForTestingOnly as _exportsForTestingOnly, exports$1__internalGetGlobalState as _internalGetGlobalState, iso as _internalIso, exports$1__internalSetInitialState as _internalSetInitialState, exports$1_addAzureBlobHeaders as addAzureBlobHeaders, exports$1_braintrustAISDKTelemetry as braintrustAISDKTelemetry, exports$1_braintrustFlueInstrumentation as braintrustFlueInstrumentation, exports$1_braintrustFlueObserver as braintrustFlueObserver, exports$1_braintrustStreamChunkSchema as braintrustStreamChunkSchema, exports$1_buildLocalSummary as buildLocalSummary, exports$1_configureInstrumentation as configureInstrumentation, exports$1_constructLogs3OverflowRequest as constructLogs3OverflowRequest, exports$1_createFinalValuePassThroughStream as createFinalValuePassThroughStream, exports$1_currentExperiment as currentExperiment, exports$1_currentLogger as currentLogger, exports$1_currentSpan as currentSpan, exports$1_deepCopyEvent as deepCopyEvent, exports$1_defaultErrorScoreHandler as defaultErrorScoreHandler, exports$1_deserializePlainStringAsJSON as deserializePlainStringAsJSON, exports$1_devNullWritableStream as devNullWritableStream, exports$1_evaluatorDefinitionSchema as evaluatorDefinitionSchema, exports$1_evaluatorDefinitionsSchema as evaluatorDefinitionsSchema, exports$1_flush as flush, exports$1_getContextManager as getContextManager, exports$1_getIdGenerator as getIdGenerator, exports$1_getPromptVersions as getPromptVersions, exports$1_getSpanParentObject as getSpanParentObject, exports$1_getTemplateRenderer as getTemplateRenderer, graphFramework as graph, exports$1_init as init, exports$1_initDataset as initDataset, exports$1_initExperiment as initExperiment, exports$1_initFunction as initFunction, exports$1_initLogger as initLogger, exports$1_initNodeTestSuite as initNodeTestSuite, exports$1_invoke as invoke, exports$1_isTemplateFormat as isTemplateFormat, exports$1_loadParameters as loadParameters, exports$1_loadPrompt as loadPrompt, exports$1_log as log, exports$1_logError as logError, exports$1_login as login, exports$1_loginToState as loginToState, exports$1_logs3OverflowUploadSchema as logs3OverflowUploadSchema, exports$1_newId as newId, exports$1_parseCachedHeader as parseCachedHeader, exports$1_parseTemplateFormat as parseTemplateFormat, exports$1_permalink as permalink, exports$1_pickLogs3OverflowObjectIds as pickLogs3OverflowObjectIds, exports$1_projects as projects, exports$1_promptContentsSchema as promptContentsSchema, exports$1_promptDefinitionSchema as promptDefinitionSchema, exports$1_promptDefinitionToPromptData as promptDefinitionToPromptData, exports$1_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, exports$1_registerOtelFlush as registerOtelFlush, exports$1_registerSandbox as registerSandbox, exports$1_registerTemplatePlugin as registerTemplatePlugin, exports$1_renderMessage as renderMessage, exports$1_renderPromptParams as renderPromptParams, exports$1_renderTemplateContent as renderTemplateContent, exports$1_reportFailures as reportFailures, exports$1_runEvaluator as runEvaluator, exports$1_setFetch as setFetch, exports$1_setMaskingFunction as setMaskingFunction, exports$1_spanComponentsToObjectId as spanComponentsToObjectId, exports$1_startSpan as startSpan, exports$1_summarize as summarize, exports$1_templateRegistry as templateRegistry, ToolFunctionDefinition as toolFunctionDefinitionSchema, exports$1_traceable as traceable, exports$1_traced as traced, exports$1_updateSpan as updateSpan, exports$1_uploadLogs3OverflowPayload as uploadLogs3OverflowPayload, exports$1_utf8ByteLength as utf8ByteLength, exports$1_withCurrent as withCurrent, exports$1_withDataset as withDataset, exports$1_withExperiment as withExperiment, exports$1_withLogger as withLogger, exports$1_withParent as withParent, exports$1_wrapAISDK as wrapAISDK, exports$1_wrapAISDKModel as wrapAISDKModel, exports$1_wrapAgentClass as wrapAgentClass, exports$1_wrapAnthropic as wrapAnthropic, exports$1_wrapBedrockRuntime as wrapBedrockRuntime, exports$1_wrapClaudeAgentSDK as wrapClaudeAgentSDK, exports$1_wrapCohere as wrapCohere, exports$1_wrapCopilotClient as wrapCopilotClient, exports$1_wrapCursorSDK as wrapCursorSDK, exports$1_wrapGenkit as wrapGenkit, exports$1_wrapGoogleADK as wrapGoogleADK, exports$1_wrapGoogleGenAI as wrapGoogleGenAI, exports$1_wrapGroq as wrapGroq, exports$1_wrapHuggingFace as wrapHuggingFace, exports$1_wrapMastraAgent as wrapMastraAgent, exports$1_wrapMistral as wrapMistral, exports$1_wrapOpenAI as wrapOpenAI, exports$1_wrapOpenAICodexSDK as wrapOpenAICodexSDK, exports$1_wrapOpenAIv4 as wrapOpenAIv4, exports$1_wrapOpenRouter as wrapOpenRouter, exports$1_wrapOpenRouterAgent as wrapOpenRouterAgent, exports$1_wrapPiCodingAgentSDK as wrapPiCodingAgentSDK, exports$1_wrapStrandsAgentSDK as wrapStrandsAgentSDK, exports$1_wrapTraced as wrapTraced, exports$1_wrapVitest as wrapVitest };
|
|
42531
|
+
export { type exports$1_AnyDataset as AnyDataset, exports$1_Attachment as Attachment, type exports$1_AttachmentParams as AttachmentParams, exports$1_AttachmentReference as AttachmentReference, exports$1_BAGGAGE_HEADER as BAGGAGE_HEADER, exports$1_BRAINTRUST_CURRENT_SPAN_STORE as BRAINTRUST_CURRENT_SPAN_STORE, exports$1_BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME as BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME, exports$1_BRAINTRUST_PARENT_KEY as BRAINTRUST_PARENT_KEY, type exports$1_BackgroundLoggerOpts as BackgroundLoggerOpts, exports$1_BaseAttachment as BaseAttachment, exports$1_BaseExperiment as BaseExperiment, type exports$1_BaseMetadata as BaseMetadata, exports$1_BraintrustLangChainCallbackHandler as BraintrustLangChainCallbackHandler, exports$1_BraintrustMiddleware as BraintrustMiddleware, exports$1_BraintrustObservabilityExporter as BraintrustObservabilityExporter, exports$1_BraintrustState as BraintrustState, exports$1_BraintrustStream as BraintrustStream, type exports$1_BraintrustStreamChunk as BraintrustStreamChunk, exports$1_CachedSpanFetcher as CachedSpanFetcher, type exports$1_ChatPrompt as ChatPrompt, exports$1_CodeFunction as CodeFunction, type exports$1_CodeOpts as CodeOpts, exports$1_CodePrompt as CodePrompt, type exports$1_CommentEvent as CommentEvent, type exports$1_CompiledPrompt as CompiledPrompt, type exports$1_CompiledPromptParams as CompiledPromptParams, type exports$1_CompletionPrompt as CompletionPrompt, exports$1_ContextManager as ContextManager, type exports$1_ContextParentSpanIds as ContextParentSpanIds, type exports$1_CreateProjectOpts as CreateProjectOpts, type exports$1_CurrentSpanStore as CurrentSpanStore, exports$1_DEFAULT_FETCH_BATCH_SIZE as DEFAULT_FETCH_BATCH_SIZE, exports$1_DEFAULT_MAX_REQUEST_SIZE as DEFAULT_MAX_REQUEST_SIZE, type exports$1_DataSummary as DataSummary, exports$1_Dataset as Dataset, exports$1_DatasetPipeline as DatasetPipeline, type exports$1_DatasetRecord as DatasetRecord, type exports$1_DatasetRestorePreviewResult as DatasetRestorePreviewResult, type exports$1_DatasetRestoreResult as DatasetRestoreResult, type DatasetSnapshotType as DatasetSnapshot, type exports$1_DatasetSummary as DatasetSummary, type exports$1_DefaultMetadataType as DefaultMetadataType, type exports$1_DefaultPromptArgs as DefaultPromptArgs, exports$1_ERR_PERMALINK as ERR_PERMALINK, type exports$1_EndSpanArgs as EndSpanArgs, exports$1_Eval as Eval, type exports$1_EvalCase as EvalCase, type exports$1_EvalClassifier as EvalClassifier, type exports$1_EvalHooks as EvalHooks, type exports$1_EvalParameterSerializedSchema as EvalParameterSerializedSchema, type exports$1_EvalParameters as EvalParameters, type exports$1_EvalResult as EvalResult, exports$1_EvalResultWithSummary as EvalResultWithSummary, type exports$1_EvalScorer as EvalScorer, type exports$1_EvalScorerArgs as EvalScorerArgs, type exports$1_EvalTask as EvalTask, type exports$1_Evaluator as Evaluator, type exports$1_EvaluatorDef as EvaluatorDef, type exports$1_EvaluatorDefinition as EvaluatorDefinition, type exports$1_EvaluatorDefinitions as EvaluatorDefinitions, type exports$1_EvaluatorFile as EvaluatorFile, type exports$1_EvaluatorManifest as EvaluatorManifest, exports$1_Experiment as Experiment, type exports$1_ExperimentLogFullArgs as ExperimentLogFullArgs, type exports$1_ExperimentLogPartialArgs as ExperimentLogPartialArgs, type exports$1_ExperimentSummary as ExperimentSummary, type exports$1_Exportable as Exportable, exports$1_ExternalAttachment as ExternalAttachment, type exports$1_ExternalAttachmentParams as ExternalAttachmentParams, exports$1_FailedHTTPResponse as FailedHTTPResponse, type exports$1_FullInitDatasetOptions as FullInitDatasetOptions, type exports$1_FullInitOptions as FullInitOptions, type exports$1_FullLoginOptions as FullLoginOptions, type exports$1_FunctionEvent as FunctionEvent, type exports$1_GetThreadOptions as GetThreadOptions, exports$1_IDGenerator as IDGenerator, type exports$1_IdField as IdField, type exports$1_InitDatasetOptions as InitDatasetOptions, type exports$1_InitLoggerOptions as InitLoggerOptions, type exports$1_InitOptions as InitOptions, type exports$1_InputField as InputField, type exports$1_InstrumentationConfig as InstrumentationConfig, type exports$1_InvokeFunctionArgs as InvokeFunctionArgs, type exports$1_InvokeReturn as InvokeReturn, exports$1_JSONAttachment as JSONAttachment, exports$1_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, exports$1_LOGS3_OVERFLOW_REFERENCE_TYPE as LOGS3_OVERFLOW_REFERENCE_TYPE, type exports$1_LangChainCallbackHandlerOptions as LangChainCallbackHandlerOptions, exports$1_LazyValue as LazyValue, type exports$1_LoadPromptOptions as LoadPromptOptions, exports$1_LocalTrace as LocalTrace, type exports$1_LogCommentFullArgs as LogCommentFullArgs, type exports$1_LogFeedbackFullArgs as LogFeedbackFullArgs, type exports$1_LogOptions as LogOptions, exports$1_Logger as Logger, exports$1_LoginInvalidOrgError as LoginInvalidOrgError, type exports$1_LoginOptions as LoginOptions, type exports$1_Logs3OverflowInputRow as Logs3OverflowInputRow, type exports$1_Logs3OverflowUpload as Logs3OverflowUpload, type exports$1_MastraObservabilityExporter as MastraObservabilityExporter, type exports$1_MetricSummary as MetricSummary, exports$1_NOOP_SPAN as NOOP_SPAN, exports$1_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, exports$1_NoopSpan as NoopSpan, exports$1_OTELIDGenerator as OTELIDGenerator, exports$1_ObjectFetcher as ObjectFetcher, type exports$1_ObjectMetadata as ObjectMetadata, type exports$1_OtherExperimentLogFields as OtherExperimentLogFields, type exports$1_ParametersSource as ParametersSource, type exports$1_ParentExperimentIds as ParentExperimentIds, type exports$1_ParentProjectLogIds as ParentProjectLogIds, type exports$1_ParsedTraceparent as ParsedTraceparent, exports$1_Project as Project, exports$1_ProjectNameIdMap as ProjectNameIdMap, type exports$1_PromiseUnless as PromiseUnless, exports$1_Prompt as Prompt, exports$1_PromptBuilder as PromptBuilder, type exports$1_PromptContents as PromptContents, type exports$1_PromptDefinition as PromptDefinition, type exports$1_PromptDefinitionWithTools as PromptDefinitionWithTools, type exports$1_PromptOpts as PromptOpts, type exports$1_PromptRowWithId as PromptRowWithId, type exports$1_PropagatedState as PropagatedState, type exports$1_PropagationContext as PropagationContext, exports$1_ReadonlyAttachment as ReadonlyAttachment, exports$1_ReadonlyExperiment as ReadonlyExperiment, type exports$1_RegisterSandboxOptions as RegisterSandboxOptions, type exports$1_RegisterSandboxResult as RegisterSandboxResult, exports$1_Reporter as Reporter, type exports$1_ReporterBody as ReporterBody, type exports$1_SandboxConfig as SandboxConfig, type exports$1_ScoreSummary as ScoreSummary, exports$1_ScorerBuilder as ScorerBuilder, type exports$1_ScorerOpts as ScorerOpts, type exports$1_SerializedBraintrustState as SerializedBraintrustState, type exports$1_SetCurrentArg as SetCurrentArg, type exports$1_Span as Span, type exports$1_SpanContext as SpanContext, type exports$1_SpanData as SpanData, exports$1_SpanFetcher as SpanFetcher, exports$1_SpanImpl as SpanImpl, type exports$1_StartSpanArgs as StartSpanArgs, exports$1_TRACEPARENT_HEADER as TRACEPARENT_HEADER, exports$1_TRACESTATE_HEADER as TRACESTATE_HEADER, type exports$1_TemplateFormat as TemplateFormat, type exports$1_TemplateRenderer as TemplateRenderer, type exports$1_TemplateRendererPlugin as TemplateRendererPlugin, exports$1_TestBackgroundLogger as TestBackgroundLogger, exports$1_ToolBuilder as ToolBuilder, type exports$1_Trace as Trace, type exports$1_TraceContextCarrier as TraceContextCarrier, type exports$1_TraceContextHeaders as TraceContextHeaders, exports$1_UUIDGenerator as UUIDGenerator, type exports$1_WithTransactionId as WithTransactionId, exports$1_X_CACHED_HEADER as X_CACHED_HEADER, exports$1__exportsForTestingOnly as _exportsForTestingOnly, exports$1__internalGetGlobalState as _internalGetGlobalState, iso as _internalIso, exports$1__internalSetInitialState as _internalSetInitialState, exports$1_addAzureBlobHeaders as addAzureBlobHeaders, exports$1_agentAssertionScorer as agentAssertionScorer, exports$1_braintrustAISDKTelemetry as braintrustAISDKTelemetry, exports$1_braintrustFlueInstrumentation as braintrustFlueInstrumentation, exports$1_braintrustFlueObserver as braintrustFlueObserver, exports$1_braintrustStreamChunkSchema as braintrustStreamChunkSchema, exports$1_buildLocalSummary as buildLocalSummary, exports$1_configureInstrumentation as configureInstrumentation, exports$1_constructLogs3OverflowRequest as constructLogs3OverflowRequest, exports$1_createFinalValuePassThroughStream as createFinalValuePassThroughStream, exports$1_currentExperiment as currentExperiment, exports$1_currentLogger as currentLogger, exports$1_currentSpan as currentSpan, exports$1_deepCopyEvent as deepCopyEvent, exports$1_defaultErrorScoreHandler as defaultErrorScoreHandler, exports$1_deserializePlainStringAsJSON as deserializePlainStringAsJSON, exports$1_devNullWritableStream as devNullWritableStream, exports$1_evaluatorDefinitionSchema as evaluatorDefinitionSchema, exports$1_evaluatorDefinitionsSchema as evaluatorDefinitionsSchema, exports$1_extractTraceContextFromHeaders as extractTraceContextFromHeaders, exports$1_flush as flush, exports$1_getContextManager as getContextManager, exports$1_getIdGenerator as getIdGenerator, exports$1_getPromptVersions as getPromptVersions, exports$1_getSpanParentObject as getSpanParentObject, exports$1_getTemplateRenderer as getTemplateRenderer, graphFramework as graph, exports$1_init as init, exports$1_initDataset as initDataset, exports$1_initExperiment as initExperiment, exports$1_initFunction as initFunction, exports$1_initLogger as initLogger, exports$1_initNodeTestSuite as initNodeTestSuite, exports$1_injectTraceContext as injectTraceContext, exports$1_invoke as invoke, exports$1_isTemplateFormat as isTemplateFormat, exports$1_loadParameters as loadParameters, exports$1_loadPrompt as loadPrompt, exports$1_log as log, exports$1_logError as logError, exports$1_login as login, exports$1_loginToState as loginToState, exports$1_logs3OverflowUploadSchema as logs3OverflowUploadSchema, exports$1_newId as newId, exports$1_parseCachedHeader as parseCachedHeader, exports$1_parseTemplateFormat as parseTemplateFormat, exports$1_permalink as permalink, exports$1_pickLogs3OverflowObjectIds as pickLogs3OverflowObjectIds, exports$1_projects as projects, exports$1_promptContentsSchema as promptContentsSchema, exports$1_promptDefinitionSchema as promptDefinitionSchema, exports$1_promptDefinitionToPromptData as promptDefinitionToPromptData, exports$1_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, exports$1_registerOtelFlush as registerOtelFlush, exports$1_registerSandbox as registerSandbox, exports$1_registerTemplatePlugin as registerTemplatePlugin, exports$1_renderMessage as renderMessage, exports$1_renderPromptParams as renderPromptParams, exports$1_renderTemplateContent as renderTemplateContent, exports$1_reportFailures as reportFailures, exports$1_runEvaluator as runEvaluator, exports$1_setFetch as setFetch, exports$1_setMaskingFunction as setMaskingFunction, exports$1_spanComponentsToObjectId as spanComponentsToObjectId, exports$1_startSpan as startSpan, exports$1_summarize as summarize, exports$1_templateRegistry as templateRegistry, ToolFunctionDefinition as toolFunctionDefinitionSchema, exports$1_traceable as traceable, exports$1_traced as traced, exports$1_updateSpan as updateSpan, exports$1_uploadLogs3OverflowPayload as uploadLogs3OverflowPayload, exports$1_utf8ByteLength as utf8ByteLength, exports$1_withCurrent as withCurrent, exports$1_withDataset as withDataset, exports$1_withExperiment as withExperiment, exports$1_withLogger as withLogger, exports$1_withParent as withParent, exports$1_wrapAISDK as wrapAISDK, exports$1_wrapAISDKModel as wrapAISDKModel, exports$1_wrapAgentClass as wrapAgentClass, exports$1_wrapAnthropic as wrapAnthropic, exports$1_wrapBedrockRuntime as wrapBedrockRuntime, exports$1_wrapClaudeAgentSDK as wrapClaudeAgentSDK, exports$1_wrapCohere as wrapCohere, exports$1_wrapCopilotClient as wrapCopilotClient, exports$1_wrapCursorSDK as wrapCursorSDK, exports$1_wrapGenkit as wrapGenkit, exports$1_wrapGoogleADK as wrapGoogleADK, exports$1_wrapGoogleGenAI as wrapGoogleGenAI, exports$1_wrapGroq as wrapGroq, exports$1_wrapHuggingFace as wrapHuggingFace, exports$1_wrapMastraAgent as wrapMastraAgent, exports$1_wrapMistral as wrapMistral, exports$1_wrapOpenAI as wrapOpenAI, exports$1_wrapOpenAICodexSDK as wrapOpenAICodexSDK, exports$1_wrapOpenAIv4 as wrapOpenAIv4, exports$1_wrapOpenRouter as wrapOpenRouter, exports$1_wrapOpenRouterAgent as wrapOpenRouterAgent, exports$1_wrapPiCodingAgentSDK as wrapPiCodingAgentSDK, exports$1_wrapStrandsAgentSDK as wrapStrandsAgentSDK, exports$1_wrapTraced as wrapTraced, exports$1_wrapVitest as wrapVitest };
|
|
42022
42532
|
}
|
|
42023
42533
|
|
|
42024
|
-
export { type AnyDataset, Attachment, type AttachmentParams, AttachmentReference, BRAINTRUST_CURRENT_SPAN_STORE, BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustLangChainCallbackHandler, BraintrustMiddleware, BraintrustObservabilityExporter, BraintrustState, BraintrustStream, type BraintrustStreamChunk, CachedSpanFetcher, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, ContextManager, type ContextParentSpanIds, type CreateProjectOpts, type CurrentSpanStore, DEFAULT_FETCH_BATCH_SIZE, DEFAULT_MAX_REQUEST_SIZE, type DataSummary, Dataset, DatasetPipeline, type DatasetRecord, type DatasetRestorePreviewResult, type DatasetRestoreResult, type DatasetSnapshotType as DatasetSnapshot, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalClassifier, 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, type GetThreadOptions, IDGenerator, type IdField, type InitDatasetOptions, type InitLoggerOptions, type InitOptions, type InputField, type InstrumentationConfig, type InvokeFunctionArgs, type InvokeReturn, JSONAttachment, LEGACY_CACHED_HEADER, LOGS3_OVERFLOW_REFERENCE_TYPE, type LangChainCallbackHandlerOptions, LazyValue, type LoadPromptOptions, LocalTrace, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, LoginInvalidOrgError, type LoginOptions, type Logs3OverflowInputRow, type Logs3OverflowUpload, type MastraObservabilityExporter, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, ObjectFetcher, type ObjectMetadata, type OtherExperimentLogFields, type ParametersSource, type ParentExperimentIds, type ParentProjectLogIds, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, type RegisterSandboxOptions, type RegisterSandboxResult, Reporter, type ReporterBody, type SandboxConfig, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span, type SpanContext, type SpanData, SpanFetcher, SpanImpl, type StartSpanArgs, type TemplateFormat, type TemplateRenderer, type TemplateRendererPlugin, TestBackgroundLogger, ToolBuilder, type Trace, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, iso as _internalIso, _internalSetInitialState, addAzureBlobHeaders, braintrustAISDKTelemetry, braintrustFlueInstrumentation, braintrustFlueObserver, braintrustStreamChunkSchema, buildLocalSummary, configureInstrumentation, constructLogs3OverflowRequest, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, exports$1 as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getContextManager, getIdGenerator, getPromptVersions, getSpanParentObject, getTemplateRenderer, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, initNodeTestSuite, invoke, isTemplateFormat, loadParameters, loadPrompt, log, logError, login, loginToState, logs3OverflowUploadSchema, newId, parseCachedHeader, parseTemplateFormat, permalink, pickLogs3OverflowObjectIds, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, registerOtelFlush, registerSandbox, registerTemplatePlugin, renderMessage, renderPromptParams, renderTemplateContent, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, templateRegistry, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, uploadLogs3OverflowPayload, utf8ByteLength, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAgentClass, wrapAnthropic, wrapBedrockRuntime, wrapClaudeAgentSDK, wrapCohere, wrapCopilotClient, wrapCursorSDK, wrapGenkit, wrapGoogleADK, wrapGoogleGenAI, wrapGroq, wrapHuggingFace, wrapMastraAgent, wrapMistral, wrapOpenAI, wrapOpenAICodexSDK, wrapOpenAIv4, wrapOpenRouter, wrapOpenRouterAgent, wrapPiCodingAgentSDK, wrapStrandsAgentSDK, wrapTraced, wrapVitest };
|
|
42534
|
+
export { type AnyDataset, Attachment, type AttachmentParams, AttachmentReference, BAGGAGE_HEADER, BRAINTRUST_CURRENT_SPAN_STORE, BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME, BRAINTRUST_PARENT_KEY, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustLangChainCallbackHandler, BraintrustMiddleware, BraintrustObservabilityExporter, BraintrustState, BraintrustStream, type BraintrustStreamChunk, CachedSpanFetcher, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, ContextManager, type ContextParentSpanIds, type CreateProjectOpts, type CurrentSpanStore, DEFAULT_FETCH_BATCH_SIZE, DEFAULT_MAX_REQUEST_SIZE, type DataSummary, Dataset, DatasetPipeline, type DatasetRecord, type DatasetRestorePreviewResult, type DatasetRestoreResult, type DatasetSnapshotType as DatasetSnapshot, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalClassifier, 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, type GetThreadOptions, IDGenerator, type IdField, type InitDatasetOptions, type InitLoggerOptions, type InitOptions, type InputField, type InstrumentationConfig, type InvokeFunctionArgs, type InvokeReturn, JSONAttachment, LEGACY_CACHED_HEADER, LOGS3_OVERFLOW_REFERENCE_TYPE, type LangChainCallbackHandlerOptions, LazyValue, type LoadPromptOptions, LocalTrace, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, LoginInvalidOrgError, type LoginOptions, type Logs3OverflowInputRow, type Logs3OverflowUpload, type MastraObservabilityExporter, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, OTELIDGenerator, ObjectFetcher, type ObjectMetadata, type OtherExperimentLogFields, type ParametersSource, type ParentExperimentIds, type ParentProjectLogIds, type ParsedTraceparent, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, type PropagatedState, type PropagationContext, ReadonlyAttachment, ReadonlyExperiment, type RegisterSandboxOptions, type RegisterSandboxResult, Reporter, type ReporterBody, type SandboxConfig, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span, type SpanContext, type SpanData, SpanFetcher, SpanImpl, type StartSpanArgs, TRACEPARENT_HEADER, TRACESTATE_HEADER, type TemplateFormat, type TemplateRenderer, type TemplateRendererPlugin, TestBackgroundLogger, ToolBuilder, type Trace, type TraceContextCarrier, type TraceContextHeaders, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, iso as _internalIso, _internalSetInitialState, addAzureBlobHeaders, agentAssertionScorer, braintrustAISDKTelemetry, braintrustFlueInstrumentation, braintrustFlueObserver, braintrustStreamChunkSchema, buildLocalSummary, configureInstrumentation, constructLogs3OverflowRequest, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, exports$1 as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, extractTraceContextFromHeaders, flush, getContextManager, getIdGenerator, getPromptVersions, getSpanParentObject, getTemplateRenderer, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, initNodeTestSuite, injectTraceContext, invoke, isTemplateFormat, loadParameters, loadPrompt, log, logError, login, loginToState, logs3OverflowUploadSchema, newId, parseCachedHeader, parseTemplateFormat, permalink, pickLogs3OverflowObjectIds, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, registerOtelFlush, registerSandbox, registerTemplatePlugin, renderMessage, renderPromptParams, renderTemplateContent, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, templateRegistry, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, uploadLogs3OverflowPayload, utf8ByteLength, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAgentClass, wrapAnthropic, wrapBedrockRuntime, wrapClaudeAgentSDK, wrapCohere, wrapCopilotClient, wrapCursorSDK, wrapGenkit, wrapGoogleADK, wrapGoogleGenAI, wrapGroq, wrapHuggingFace, wrapMastraAgent, wrapMistral, wrapOpenAI, wrapOpenAICodexSDK, wrapOpenAIv4, wrapOpenRouter, wrapOpenRouterAgent, wrapPiCodingAgentSDK, wrapStrandsAgentSDK, wrapTraced, wrapVitest };
|