Static Private _getLoad and return the AIProvider factory for the given provider type.
This is the single place in the codebase that knows provider package names.
Each supported provider package exports a *RunnerFactory class that
extends AIProvider; this method instantiates it directly.
One of the SUPPORTED_AI_PROVIDERS values.
Optional logger: LDLoggerOptional logger forwarded to the provider factory.
Optional A configured AIProvider instance, or undefined if the
package cannot be loaded.
Static Private _getDetermine which providers to try based on defaultAiProvider and providerName.
Mirrors Python's _get_providers_to_try helper.
Optional defaultAiProvider: "openai" | "langchain" | "vercel"Optional Optional providerName: stringOptional Static Private _withTry each provider in order and return the first non-undefined result.
Mirrors Python's _with_fallback helper. Loads each provider factory via
_getProviderFactory and calls fn with it. Returns the first
truthy result, or undefined if no provider succeeds.
Ordered list of provider types to try.
Callback that calls the appropriate factory method on the provider.
Optional logger: LDLoggerOptional logger forwarded to each provider factory.
Optional Static createCreate a Runner for an agent AI Config.
Delegates to the provider factory's AIProvider.createAgent method.
The agent AI configuration.
Optional tools: ToolRegistryOptional registry of callable tools.
Optional Optional logger: LDLoggerOptional logger forwarded to the underlying provider.
Optional Optional defaultAiProvider: "openai" | "langchain" | "vercel"Optional provider override.
Optional A configured Runner, or undefined if no suitable
provider could be loaded.
Static createCreate an AgentGraphRunner for the given agent graph definition.
Delegates to the provider factory's AIProvider.createAgentGraph method.
The agent graph definition.
Optional tools: ToolRegistryOptional registry of callable tools.
Optional Optional logger: LDLoggerOptional logger forwarded to the underlying provider.
Optional Optional defaultAiProvider: "openai" | "langchain" | "vercel"Optional provider override.
Optional A configured AgentGraphRunner, or undefined if no
suitable provider could be loaded.
Static createCreate 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.
The AI configuration (completion, agent, or judge).
Optional logger: LDLoggerOptional logger forwarded to the underlying provider.
Optional Optional defaultAiProvider: "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.
Optional A configured Runner ready to invoke the model, or
undefined if no suitable provider could be loaded.
Generated using TypeDoc
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).