@launchdarkly/server-sdk-ai - v2.0.21
    Preparing search index...

    Class RunnerFactory

    Sole entry point for runner creation.

    RunnerFactory is the single factory for creating Runner and AgentGraphRunner instances. It mirrors the Python RunnerFactory pattern: it knows about supported provider packages, loads them dynamically via _getProviderFactory, and delegates creation to the factory instance methods on AIProvider.

    Provider packages subclass AIProvider and override its factory methods (createModel, createAgent, createAgentGraph).

    Index
    • Create a Runner for an agent AI Config.

      Delegates to the provider factory's AIProvider.createAgent method.

      Parameters

      • config: LDAIAgentConfig

        The agent AI configuration.

      • Optionaltools: ToolRegistry

        Optional registry of callable tools.

      • Optionallogger: LDLogger

        Optional logger forwarded to the underlying provider.

      • OptionaldefaultAiProvider: "openai" | "langchain" | "vercel"

        Optional provider override.

      Returns Promise<Runner | undefined>

      A configured Runner, or undefined if no suitable provider could be loaded.

    • Create a Runner for the given AI configuration.

      Suitable for completion, judge, and agent config modes. Dynamically loads the matching provider package via _getProviderFactory and delegates to its AIProvider.createModel method.

      Parameters

      • config: LDAIJudgeConfig | LDAICompletionConfig

        The AI configuration (completion, agent, or judge).

      • Optionallogger: LDLogger

        Optional logger forwarded to the underlying provider.

      • OptionaldefaultAiProvider: "openai" | "langchain" | "vercel"

        Optional provider override ('openai', 'langchain', 'vercel', …). When set, only that provider is tried. When omitted, providers are tried in priority order based on the provider name in the config.

      • multiTurn: boolean = true

        Whether the runner should accumulate conversation history across successive run() calls. Defaults to true (chat semantics). Judges pass false so each evaluation starts from the initial config messages.

      Returns Promise<Runner | undefined>

      A configured Runner ready to invoke the model, or undefined if no suitable provider could be loaded.