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.
@@ -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;
@@ -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;