Factory for creating Vercel AI runners.

Vercel ships only a model runner; agent and graph runners are not provided because the Vercel AI SDK is a thin model layer rather than an agent framework.

Hierarchy

  • AIProvider
    • VercelRunnerFactory

Constructors

Properties

_logger?: LDLogger

Methods

  • Create a Runner for an agent AI Config.

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

    Parameters

    • _config: LDAIAgentConfig
    • Optional _tools: ToolRegistry
      Optional

    Returns Promise<undefined | Runner>

    Promise resolving to a Runner, or undefined if this provider does not support agent creation.

  • 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<VercelModelRunner>

  • Create a Vercel AI model from an AI configuration. This method auto-detects the provider and creates the model instance.

    Parameters

    • aiConfig: LDAIConfig

    Returns Promise<LanguageModel>

  • Map LaunchDarkly model parameters to Vercel AI SDK parameters.

    Parameter mappings:

    • max_tokens -> maxTokens
    • max_completion_tokens -> maxOutputTokens
    • temperature -> temperature
    • top_p -> topP
    • top_k -> topK
    • presence_penalty -> presencePenalty
    • frequency_penalty -> frequencyPenalty
    • stop -> stopSequences
    • seed -> seed

    Parameters

    • Optional parameters: {
          [index: string]: unknown;
      }
      Optional
      • [index: string]: unknown

    Returns VercelAIModelParameters

Generated using TypeDoc