/** * Data capture modes for controlling automatic capture behavior. */ type DataCaptureMode = "none" | "input" | "output" | "all"; /** * Context provided to data capture predicates for making decisions. */ interface DataCaptureContext { /** Type of span (e.g., "llm", "chain", "tool", "retriever") */ spanType: string; /** Name of the operation being performed */ operationName: string; /** Any additional attributes set on the span */ spanAttributes: Record; /** Environment (development, staging, production) */ environment?: string; } /** * Predicate function for dynamic capture decisions. * * @param context - Context about the span and operation * @returns Capture mode to use for this specific operation */ type DataCapturePredicate = (context: DataCaptureContext) => DataCaptureMode; /** * Configuration for what data should be captured in spans. * * This provides simple control over input/output data capture * by LangWatch instrumentations. */ interface DataCaptureConfig { /** * Controls data capture behavior. * * @default "all" */ mode?: DataCaptureMode; } /** * Union type for all supported data capture configuration formats. */ type DataCaptureOptions = DataCaptureMode | DataCaptureConfig; export type { DataCaptureOptions as D, DataCaptureMode as a, DataCaptureConfig as b, DataCaptureContext as c, DataCapturePredicate as d };