Factory for creating LangChain runners (chat completion and agent).

Hierarchy

  • AIProvider
    • LangChainRunnerFactory

Constructors

Properties

_logger?: LDLogger

Methods

  • Create an AgentGraphRunner for an agent graph definition.

    Override in provider subclasses to return a configured AgentGraphRunner. Default implementation returns undefined.

    Parameters

    • _graphDef: AgentGraphDefinition
    • Optional _tools: ToolRegistry
      Optional

    Returns Promise<undefined | AgentGraphRunner>

    Promise resolving to an AgentGraphRunner, or undefined if this provider does not support graph execution.

  • Create a model runner from a completion AI configuration.

    Parameters

    • config: LDAICompletionConfig

      The completion (or judge) AI configuration.

    • multiTurn: boolean = true

      Whether the runner should accumulate conversation history across successive run() calls. Defaults to true (chat semantics). Pass false for stateless runners such as judges.

    Returns Promise<LangChainModelRunner>

  • Automatically patches the ESM LangChain module for OpenTelemetry tracing when a TracerProvider is active and @traceloop/instrumentation-langchain is installed.

    Parameters

    • Optional logger: LDLogger
      Optional

    Returns Promise<void>

Generated using TypeDoc