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