langchain.js
    Preparing search index...

    Interface Runtime<ContextType, InterruptType, WriterType>

    interface Runtime<
        ContextType = Record<string, unknown>,
        InterruptType = unknown,
        WriterType = unknown,
    > {
        configurable?: ContextType;
        context?: ContextType;
        interrupt: IsEqual<InterruptType, unknown> extends true
            ? (value: unknown) => unknown
            : InterruptType;
        signal: AbortSignal;
        store?: any;
        writer: IsEqual<WriterType, unknown> extends true
            ? (chunk: unknown) => void
            : WriterType;
    }

    Type Parameters

    • ContextType = Record<string, unknown>
    • InterruptType = unknown
    • WriterType = unknown
    Index

    Properties

    configurable?: ContextType
    context?: ContextType

    User provided context

    interrupt: IsEqual<InterruptType, unknown> extends true
        ? (value: unknown) => unknown
        : InterruptType

    Interrupts the execution of a graph node.

    This function can be used to pause execution of a node, and return the value of the resume input when the graph is re-invoked using Command. Multiple interrupts can be called within a single node, and each will be handled sequentially.

    When an interrupt is called:

    1. If there's a resume value available (from a previous Command), it returns that value.
    2. Otherwise, it throws a GraphInterrupt with the provided value
    3. The graph can be resumed by passing a Command with a resume value

    Because the interrupt function propagates by throwing a special GraphInterrupt error, you should avoid using try/catch blocks around the interrupt function, or if you do, ensure that the GraphInterrupt error is thrown again within your catch block.

    The value to include in the interrupt.

    The resume value provided when the graph is re-invoked with a Command.

    signal: AbortSignal

    Abort signal to cancel the run.

    store?: any

    Persistent key-value store

    writer: IsEqual<WriterType, unknown> extends true
        ? (chunk: unknown) => void
        : WriterType

    Callback to send custom data chunks via the custom stream mode