braintrust 0.4.0 → 0.4.1
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 +11 -0
- package/dev/dist/index.d.ts +11 -0
- package/dev/dist/index.js +7748 -5606
- package/dev/dist/index.mjs +7670 -5528
- package/dist/browser.d.mts +18 -2
- package/dist/browser.d.ts +18 -2
- package/dist/browser.js +8641 -6327
- package/dist/browser.mjs +8621 -6307
- package/dist/cli.js +7715 -5581
- package/dist/index.d.mts +27 -7
- package/dist/index.d.ts +27 -7
- package/dist/index.js +10942 -10186
- package/dist/index.mjs +10860 -10104
- package/package.json +1 -1
package/dev/dist/index.d.mts
CHANGED
|
@@ -7302,6 +7302,10 @@ declare class LazyValue<T> {
|
|
|
7302
7302
|
get hasSucceeded(): boolean;
|
|
7303
7303
|
}
|
|
7304
7304
|
|
|
7305
|
+
interface ContextParentSpanIds {
|
|
7306
|
+
rootSpanId: string;
|
|
7307
|
+
spanParents: string[];
|
|
7308
|
+
}
|
|
7305
7309
|
type SetCurrentArg = {
|
|
7306
7310
|
setCurrent?: boolean;
|
|
7307
7311
|
};
|
|
@@ -7452,6 +7456,11 @@ interface Span extends Exportable {
|
|
|
7452
7456
|
state(): BraintrustState;
|
|
7453
7457
|
kind: "span";
|
|
7454
7458
|
}
|
|
7459
|
+
declare abstract class ContextManager {
|
|
7460
|
+
abstract getParentSpanIds(): ContextParentSpanIds | undefined;
|
|
7461
|
+
abstract runInContext<R>(span: Span, callback: () => R): R;
|
|
7462
|
+
abstract getCurrentSpan(): Span | undefined;
|
|
7463
|
+
}
|
|
7455
7464
|
/**
|
|
7456
7465
|
* A fake implementation of the Span API which does nothing. This can be used as the default span.
|
|
7457
7466
|
*/
|
|
@@ -7549,10 +7558,12 @@ declare class BraintrustState {
|
|
|
7549
7558
|
private _proxyConn;
|
|
7550
7559
|
promptCache: PromptCache;
|
|
7551
7560
|
private _idGenerator;
|
|
7561
|
+
private _contextManager;
|
|
7552
7562
|
constructor(loginParams: LoginOptions);
|
|
7553
7563
|
resetLoginInfo(): void;
|
|
7554
7564
|
resetIdGenState(): void;
|
|
7555
7565
|
get idGenerator(): IDGenerator;
|
|
7566
|
+
get contextManager(): ContextManager;
|
|
7556
7567
|
copyLoginInfo(other: BraintrustState): void;
|
|
7557
7568
|
serialize(): SerializedBraintrustState;
|
|
7558
7569
|
static deserialize(serialized: unknown, opts?: LoginOptions): BraintrustState;
|
package/dev/dist/index.d.ts
CHANGED
|
@@ -7302,6 +7302,10 @@ declare class LazyValue<T> {
|
|
|
7302
7302
|
get hasSucceeded(): boolean;
|
|
7303
7303
|
}
|
|
7304
7304
|
|
|
7305
|
+
interface ContextParentSpanIds {
|
|
7306
|
+
rootSpanId: string;
|
|
7307
|
+
spanParents: string[];
|
|
7308
|
+
}
|
|
7305
7309
|
type SetCurrentArg = {
|
|
7306
7310
|
setCurrent?: boolean;
|
|
7307
7311
|
};
|
|
@@ -7452,6 +7456,11 @@ interface Span extends Exportable {
|
|
|
7452
7456
|
state(): BraintrustState;
|
|
7453
7457
|
kind: "span";
|
|
7454
7458
|
}
|
|
7459
|
+
declare abstract class ContextManager {
|
|
7460
|
+
abstract getParentSpanIds(): ContextParentSpanIds | undefined;
|
|
7461
|
+
abstract runInContext<R>(span: Span, callback: () => R): R;
|
|
7462
|
+
abstract getCurrentSpan(): Span | undefined;
|
|
7463
|
+
}
|
|
7455
7464
|
/**
|
|
7456
7465
|
* A fake implementation of the Span API which does nothing. This can be used as the default span.
|
|
7457
7466
|
*/
|
|
@@ -7549,10 +7558,12 @@ declare class BraintrustState {
|
|
|
7549
7558
|
private _proxyConn;
|
|
7550
7559
|
promptCache: PromptCache;
|
|
7551
7560
|
private _idGenerator;
|
|
7561
|
+
private _contextManager;
|
|
7552
7562
|
constructor(loginParams: LoginOptions);
|
|
7553
7563
|
resetLoginInfo(): void;
|
|
7554
7564
|
resetIdGenState(): void;
|
|
7555
7565
|
get idGenerator(): IDGenerator;
|
|
7566
|
+
get contextManager(): ContextManager;
|
|
7556
7567
|
copyLoginInfo(other: BraintrustState): void;
|
|
7557
7568
|
serialize(): SerializedBraintrustState;
|
|
7558
7569
|
static deserialize(serialized: unknown, opts?: LoginOptions): BraintrustState;
|