langchain.js
    Preparing search index...

    Type Alias WrapModelCallHandler<TSchema, TContext>

    WrapModelCallHandler: (
        request: Omit<
            ModelRequest<NormalizedSchemaInput<TSchema>, TContext>,
            "systemPrompt" | "systemMessage",
        > & { systemMessage?: BaseMessage; systemPrompt?: string },
    ) => PromiseOrValue<BaseMessage>

    Handler function type for wrapping model calls. Takes a model request and returns the AI message response.

    Type Parameters

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

    Type Declaration

      • (
            request: Omit<
                ModelRequest<NormalizedSchemaInput<TSchema>, TContext>,
                "systemPrompt" | "systemMessage",
            > & { systemMessage?: BaseMessage; systemPrompt?: string },
        ): PromiseOrValue<BaseMessage>
      • Parameters

        • request: Omit<
              ModelRequest<NormalizedSchemaInput<TSchema>, TContext>,
              "systemPrompt" | "systemMessage",
          > & { systemMessage?: BaseMessage; systemPrompt?: string }

          The model request containing model, messages, systemPrompt, tools, state, and runtime

        Returns PromiseOrValue<BaseMessage>

        The AI message response from the model