langchain.js
    Preparing search index...

    Type Alias InferMiddlewareState<T>

    InferMiddlewareState: T extends AgentMiddleware<infer TSchema, any, any, any>
        ? TSchema extends BaseMessage
            ? FilterPrivateProps<BaseMessage<TSchema>>
            : TSchema extends StateDefinitionInit
                ? FilterPrivateProps<InferSchemaInput<TSchema>>
                : {}
        : {}

    Helper type to infer the state schema type from a middleware This filters out private properties (those starting with underscore) Supports both Zod schemas (InteropZodObject) and StateSchema from LangGraph

    Type Parameters