langchain.js
    Preparing search index...

    Interface MiddlewareTypeConfig<TSchema, TContextSchema, TFullContext, TTools>

    Type bag that encapsulates all middleware type parameters.

    This interface bundles all the generic type parameters used throughout the middleware system into a single configuration object. This pattern simplifies type signatures and makes it easier to add new type parameters without changing multiple function signatures.

    // Define a type configuration
    type MyMiddlewareTypes = MiddlewareTypeConfig<
    typeof myStateSchema,
    typeof myContextSchema,
    MyContextType,
    typeof myTools
    >;
    interface MiddlewareTypeConfig<
        TSchema extends
            StateDefinitionInit
            | undefined = StateDefinitionInit | undefined,
        TContextSchema extends
            | BaseMessage
            | BaseMessage<BaseMessage>
            | BaseMessage<BaseMessage>
            | undefined =
            | BaseMessage
            | BaseMessage<BaseMessage>
            | BaseMessage<BaseMessage>
            | undefined,
        TFullContext = any,
        TTools extends
            readonly (BaseMessage | BaseMessage)[] = readonly (
            BaseMessage
            | BaseMessage
        )[],
    > {
        ContextSchema: TContextSchema;
        FullContext: TFullContext;
        Schema: TSchema;
        Tools: TTools;
    }

    Type Parameters

    Index

    Properties

    ContextSchema: TContextSchema

    The middleware context schema type

    FullContext: TFullContext

    The full context type

    Schema: TSchema

    The middleware state schema type

    Tools: TTools

    The tools array type