langchain.js
    Preparing search index...

    Type Alias TraceableConfig<Func>

    TraceableConfig: Partial<Omit<RunTreeConfig, "inputs" | "outputs">> & {
        __finalTracedIteratorKey?: string;
        aggregator?: (args: any[]) => any;
        argsConfigPath?: [number] | [number, string];
        extractAttachments?: (
            ...args: Parameters<Func>,
        ) => [Attachments | undefined, KVMap];
        getInvocationParams?: (
            ...args: Parameters<Func>,
        ) => InvocationParamsSchema | undefined;
        processInputs?: (inputs: Readonly<KVMap>) => KVMap;
        processOutputs?: (outputs: Readonly<KVMap>) => KVMap | Promise<KVMap>;
        tracer?: OTELTracer;
    }

    Type Parameters

    • Func extends (...args: any[]) => any

    Type Declaration

    • Optional__finalTracedIteratorKey?: string
    • Optionalaggregator?: (args: any[]) => any
    • OptionalargsConfigPath?: [number] | [number, string]
    • OptionalextractAttachments?: (...args: Parameters<Func>) => [Attachments | undefined, KVMap]

      Extract attachments from args and return remaining args.

    • OptionalgetInvocationParams?: (...args: Parameters<Func>) => InvocationParamsSchema | undefined

      Extract invocation parameters from the arguments of the traced function. This is useful for LangSmith to properly track common metadata like provider, model name and temperature.

    • OptionalprocessInputs?: (inputs: Readonly<KVMap>) => KVMap

      Apply transformations to the inputs before logging. This function should NOT mutate the inputs. processInputs is not inherited by nested traceable functions.

    • OptionalprocessOutputs?: (outputs: Readonly<KVMap>) => KVMap | Promise<KVMap>

      Apply transformations to the outputs before logging. This function should NOT mutate the outputs. processOutputs is not inherited by nested traceable functions.

    • Optionaltracer?: OTELTracer