Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt

Use this file to discover all available pages before exploring further.


Function: log()

Call Signature

function log<T, R>(
  options: LogOptions,
  fn: (...args: T) => R,
): (...args: T) => R;
Defined in: src/wrappers.ts Wraps a function to log its execution as a span in Galileo. Supports synchronous functions, Promises, and sync/async Generators.

Type Parameters

T

T extends unknown[]

R

R

Parameters

options

LogOptions The span options.

fn

(…args: T) => R The function to wrap. Can return R, Promise<R>, Generator<R>, or AsyncGenerator<R>.

Returns

A wrapped function with the same signature and return type as fn.
(...args: T): R;

Parameters

args
T

Returns

R

Call Signature

function log<T, R>(
  options: LogOptions,
  fn: (...args: T) => Promise<R>,
): (...args: T) => Promise<R>;
Defined in: src/wrappers.ts Wraps a function to log its execution as a span in Galileo. Supports synchronous functions, Promises, and sync/async Generators.

Type Parameters

T

T extends unknown[]

R

R

Parameters

options

LogOptions The span options.

fn

(…args: T) => Promise<R> The function to wrap. Can return R, Promise<R>, Generator<R>, or AsyncGenerator<R>.

Returns

A wrapped function with the same signature and return type as fn.
(...args: T): Promise<R>;

Parameters

args
T

Returns

Promise<R>

Call Signature

function log<T, R>(
  options: LogOptions,
  fn: (...args: T) => Generator<R>,
): (...args: T) => Generator<R>;
Defined in: src/wrappers.ts Wraps a function to log its execution as a span in Galileo. Supports synchronous functions, Promises, and sync/async Generators.

Type Parameters

T

T extends unknown[]

R

R

Parameters

options

LogOptions The span options.

fn

(…args: T) => Generator<R> The function to wrap. Can return R, Promise<R>, Generator<R>, or AsyncGenerator<R>.

Returns

A wrapped function with the same signature and return type as fn.
(...args: T): Generator<R>;

Parameters

args
T

Returns

Generator<R>

Call Signature

function log<T, R>(
  options: LogOptions,
  fn: (...args: T) => AsyncGenerator<R>,
): (...args: T) => AsyncGenerator<R>;
Defined in: src/wrappers.ts Wraps a function to log its execution as a span in Galileo. Supports synchronous functions, Promises, and sync/async Generators.

Type Parameters

T

T extends unknown[]

R

R

Parameters

options

LogOptions The span options.

fn

(…args: T) => AsyncGenerator<R> The function to wrap. Can return R, Promise<R>, Generator<R>, or AsyncGenerator<R>.

Returns

A wrapped function with the same signature and return type as fn.
(...args: T): AsyncGenerator<R>;

Parameters

args
T

Returns

AsyncGenerator<R>