import type { DatasetRecord } from './types'; export type SpanType = 'llm' | 'retriever' | 'tool' | 'workflow' | 'agent'; type ParamMapper = string | ((input: Record) => unknown); type ParamMapping = Record; /** * Options for the log() wrapper. Controls span type, naming, params mapping, * dataset association, metadata/tags, and distributed tracing (traceId/parentId). */ export interface LogOptions { /** (Optional) The span type. */ spanType?: SpanType; /** (Optional) The span name. */ name?: string; /** (Optional) Mapping of parameter names or mappers to span params. */ params?: ParamMapping; /** (Optional) Dataset record for input/output/metadata. */ datasetRecord?: DatasetRecord; /** (Optional) Top-level metadata applied to the span (merged with params/args). */ metadata?: Record; /** (Optional) Top-level tags applied to the span (merged with params/args). */ tags?: string[]; /** (Optional) Distributed tracing: ID of the trace to continue. */ traceId?: string; /** (Optional) Distributed tracing: parent span ID to continue under. */ parentId?: string; } /** * Wraps a function to log its execution as a span in Galileo. * Supports synchronous functions, Promises, and sync/async Generators. * * @param options - The span options. * @param options.spanType - (Optional) The span type. * @param options.name - (Optional) The span name. * @param options.params - (Optional) Mapping of parameter names or mappers to span params. * @param options.datasetRecord - (Optional) Dataset record for input/output/metadata. * @param options.metadata - (Optional) Top-level metadata applied to the span. * @param options.tags - (Optional) Top-level tags applied to the span. * @param options.traceId - (Optional) Distributed tracing: ID of the trace to continue. * @param options.parentId - (Optional) Distributed tracing: parent span ID to continue under. * @param fn - The function to wrap. Can return R, Promise, Generator, or AsyncGenerator. * @returns A wrapped function with the same signature and return type as fn. */ export declare function log(options: LogOptions, fn: (...args: T) => R): (...args: T) => R; export declare function log(options: LogOptions, fn: (...args: T) => Promise): (...args: T) => Promise; export declare function log(options: LogOptions, fn: (...args: T) => Generator): (...args: T) => Generator; export declare function log(options: LogOptions, fn: (...args: T) => AsyncGenerator): (...args: T) => AsyncGenerator; export {};