braintrust 0.3.8 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev/dist/index.d.mts +21 -2
- package/dev/dist/index.d.ts +21 -2
- package/dev/dist/index.js +385 -123
- package/dev/dist/index.mjs +1291 -1029
- package/dist/browser.d.mts +23 -2
- package/dist/browser.d.ts +23 -2
- package/dist/browser.js +204 -110
- package/dist/browser.mjs +1079 -985
- package/dist/cli.js +1336 -1073
- package/dist/index.d.mts +86 -4
- package/dist/index.d.ts +86 -4
- package/dist/index.js +580 -186
- package/dist/index.mjs +1436 -1042
- package/package.json +4 -3
- package/util/dist/index.d.mts +66 -3
- package/util/dist/index.d.ts +66 -3
- package/util/dist/index.js +229 -17
- package/util/dist/index.mjs +230 -18
package/dev/dist/index.d.mts
CHANGED
|
@@ -7097,6 +7097,24 @@ type ToolFunctionDefinitionType = z.infer<typeof ToolFunctionDefinition>;
|
|
|
7097
7097
|
|
|
7098
7098
|
type GenericFunction<Input, Output> = ((input: Input) => Output) | ((input: Input) => Promise<Output>);
|
|
7099
7099
|
|
|
7100
|
+
/**
|
|
7101
|
+
* Abstract base class for ID generators
|
|
7102
|
+
*/
|
|
7103
|
+
declare abstract class IDGenerator {
|
|
7104
|
+
/**
|
|
7105
|
+
* Generate a span ID
|
|
7106
|
+
*/
|
|
7107
|
+
abstract getSpanId(): string;
|
|
7108
|
+
/**
|
|
7109
|
+
* Generate a trace ID
|
|
7110
|
+
*/
|
|
7111
|
+
abstract getTraceId(): string;
|
|
7112
|
+
/**
|
|
7113
|
+
* Return true if the generator should use span_id as root_span_id for backwards compatibility
|
|
7114
|
+
*/
|
|
7115
|
+
abstract shareRootSpanId(): boolean;
|
|
7116
|
+
}
|
|
7117
|
+
|
|
7100
7118
|
interface IsoAsyncLocalStorage<T> {
|
|
7101
7119
|
enterWith(store: T): void;
|
|
7102
7120
|
run<R>(store: T | undefined, callback: () => R): R;
|
|
@@ -7284,8 +7302,6 @@ declare class LazyValue<T> {
|
|
|
7284
7302
|
get hasSucceeded(): boolean;
|
|
7285
7303
|
}
|
|
7286
7304
|
|
|
7287
|
-
/// <reference lib="dom" />
|
|
7288
|
-
|
|
7289
7305
|
type SetCurrentArg = {
|
|
7290
7306
|
setCurrent?: boolean;
|
|
7291
7307
|
};
|
|
@@ -7532,8 +7548,11 @@ declare class BraintrustState {
|
|
|
7532
7548
|
private _apiConn;
|
|
7533
7549
|
private _proxyConn;
|
|
7534
7550
|
promptCache: PromptCache;
|
|
7551
|
+
private _idGenerator;
|
|
7535
7552
|
constructor(loginParams: LoginOptions);
|
|
7536
7553
|
resetLoginInfo(): void;
|
|
7554
|
+
resetIdGenState(): void;
|
|
7555
|
+
get idGenerator(): IDGenerator;
|
|
7537
7556
|
copyLoginInfo(other: BraintrustState): void;
|
|
7538
7557
|
serialize(): SerializedBraintrustState;
|
|
7539
7558
|
static deserialize(serialized: unknown, opts?: LoginOptions): BraintrustState;
|
package/dev/dist/index.d.ts
CHANGED
|
@@ -7097,6 +7097,24 @@ type ToolFunctionDefinitionType = z.infer<typeof ToolFunctionDefinition>;
|
|
|
7097
7097
|
|
|
7098
7098
|
type GenericFunction<Input, Output> = ((input: Input) => Output) | ((input: Input) => Promise<Output>);
|
|
7099
7099
|
|
|
7100
|
+
/**
|
|
7101
|
+
* Abstract base class for ID generators
|
|
7102
|
+
*/
|
|
7103
|
+
declare abstract class IDGenerator {
|
|
7104
|
+
/**
|
|
7105
|
+
* Generate a span ID
|
|
7106
|
+
*/
|
|
7107
|
+
abstract getSpanId(): string;
|
|
7108
|
+
/**
|
|
7109
|
+
* Generate a trace ID
|
|
7110
|
+
*/
|
|
7111
|
+
abstract getTraceId(): string;
|
|
7112
|
+
/**
|
|
7113
|
+
* Return true if the generator should use span_id as root_span_id for backwards compatibility
|
|
7114
|
+
*/
|
|
7115
|
+
abstract shareRootSpanId(): boolean;
|
|
7116
|
+
}
|
|
7117
|
+
|
|
7100
7118
|
interface IsoAsyncLocalStorage<T> {
|
|
7101
7119
|
enterWith(store: T): void;
|
|
7102
7120
|
run<R>(store: T | undefined, callback: () => R): R;
|
|
@@ -7284,8 +7302,6 @@ declare class LazyValue<T> {
|
|
|
7284
7302
|
get hasSucceeded(): boolean;
|
|
7285
7303
|
}
|
|
7286
7304
|
|
|
7287
|
-
/// <reference lib="dom" />
|
|
7288
|
-
|
|
7289
7305
|
type SetCurrentArg = {
|
|
7290
7306
|
setCurrent?: boolean;
|
|
7291
7307
|
};
|
|
@@ -7532,8 +7548,11 @@ declare class BraintrustState {
|
|
|
7532
7548
|
private _apiConn;
|
|
7533
7549
|
private _proxyConn;
|
|
7534
7550
|
promptCache: PromptCache;
|
|
7551
|
+
private _idGenerator;
|
|
7535
7552
|
constructor(loginParams: LoginOptions);
|
|
7536
7553
|
resetLoginInfo(): void;
|
|
7554
|
+
resetIdGenState(): void;
|
|
7555
|
+
get idGenerator(): IDGenerator;
|
|
7537
7556
|
copyLoginInfo(other: BraintrustState): void;
|
|
7538
7557
|
serialize(): SerializedBraintrustState;
|
|
7539
7558
|
static deserialize(serialized: unknown, opts?: LoginOptions): BraintrustState;
|