Runner implementation for LangChain chat models.

Implements the unified Runner protocol via run. Returned by LangChainRunnerFactory.createModel.

Hierarchy

  • LangChainModelRunner

Implements

  • Runner

Constructors

Properties

_config: LDAICompletionConfig
_llm: BaseChatModel<BaseChatModelCallOptions, AIMessageChunk<MessageStructure<MessageToolSet>>>
_logger?: LDLogger

Methods

  • Get the underlying LangChain model instance.

    Returns BaseChatModel<BaseChatModelCallOptions, AIMessageChunk<MessageStructure<MessageToolSet>>>

  • Run the LangChain model with the given user prompt.

    Prepends any messages defined in the AI config (system prompt, etc.) before the user prompt.

    Parameters

    • input: string

      The user prompt string.

    • Optional outputType: Record<string, unknown>

      Optional JSON schema for structured output. When provided, the parsed result is exposed via RunnerResult.parsed.

      Optional

    Returns Promise<RunnerResult>

Generated using TypeDoc