langchain.js
    Preparing search index...

    Type Alias BeforeAgentHook<TSchema, TContext>

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

    Hook type for the beforeAgent lifecycle event. Can be either a handler function or an object with a handler and optional jump targets. This hook is called once at the start of the agent invocation.

    Type Parameters

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