Skip to main content

Function: resolveBatchModelForRef()

resolveBatchModelForRef(ref, options?): Promise<EngineBatchModel>

Defined in: packages/workflow-engine/src/ai/batch/resolve-ref.ts:22

The built-in transport for a stored batch ref, for a process that did not create the batch (run.cancel is the caller). The ref names the provider and the native model id. The caller selects the transport options for the ref. Without explicit options, the resolver uses the provider's default URL and environment credentials (OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY / GEMINI_API_KEY, OPENROUTER_API_KEY).

Throws when no built-in transport serves the ref's provider, when the vendor package is not installed, or when OpenRouter has no key. A key a vendor SDK cannot find surfaces on the first call, as the SDK's AI_LoadAPIKeyError.

Parameters​

ref​

EngineBatchRef

options?​

AiSdkBatchModelOptions & Pick<BatchOptions, "endpoint"> = {}

Returns​

Promise<EngineBatchModel>