langchain.js
    Preparing search index...

    Type Alias BeforeModelHook<TSchema, TContext>

    BeforeModelHook:
        | BeforeModelHandler<NormalizedSchemaInput<TSchema>, TContext>
        | {
            canJumpTo?: JumpToTarget[];
            hook: BeforeModelHandler<NormalizedSchemaInput<TSchema>, TContext>;
        }

    Hook type for the beforeModel lifecycle event. Can be either a handler function or an object with a handler and optional jump targets. This hook is called before each model invocation.

    Type Parameters

    • TSchema extends BaseMessage | undefined = undefined
    • TContext = unknown