Interface: CompletionRoute
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:45
What a turn asks the gateway for. Unset fields take the gateway's defaults.
Properties
apiKey?
optionalapiKey:string
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:66
Credentials for the primary only; fallback hops read the environment, as streamText's walk does. Set in the gateway defaults beside a provider or model, they are for that provider: a turn that names another provider does not take them.
baseUrl?
optionalbaseUrl:string
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:67
callOptions?
optionalcallOptions:Pick<GenerateTextOptions,"maxTokens"|"effort"|"cache">
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:69
The call's own effort, cache and output budget, from which each fallback hop's overrides are derived.
fallbackProviders?
optionalfallbackProviders:FallbackProviderEntry[]
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:60
Caller chain. Undefined builds the policy-aware chain from the environment; an empty array disables fallback. Either is resolved once, as generateText's walk resolves its chain: entries naming an excluded model or lacking an explicitly required capability are passed over, and so is the policy chain's entry for the first model.
hostPolicy?
optionalhostPolicy:HostLLMPolicy
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:53
messages
messages:
ChatMessage[]
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:49
The turn's messages so far; the last user message is the router's task hint.
modelId?
optionalmodelId:string
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:46
onFallback()?
optionalonFallback: (info) =>void
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:71
Called when the turn moves to a hop after the primary.
Parameters
info
error
Error
from
string
hop
number
to
string
Returns
void
onHopFailure()?
optionalonHopFailure: (info) =>void
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:73
Called for every hop that could not start (initialisation failure or open circuit).
Parameters
info
error
Error
hop
number
providerId
string
Returns
void
onHopSkipped()?
optionalonHopSkipped: (info) =>void
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:80
Called for every chain entry the walk passes over without an attempt: an excluded model, a missing required capability, the policy chain's entry for the first model, a refill no standing leg is owed, a Claude leg after a refusal.
Parameters
info
CompletionHopSkip
Returns
void
policyTier?
optionalpolicyTier:"safe"|"standard"|"mature"|"private-adult"
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:54
providerId?
optionalproviderId:string
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:47
router?
optionalrouter:IModelRouter
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:51
routerParams?
optionalrouterParams:Partial<ModelRouteParams>
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:52
tools?
optionaltools:ITool<any,any>[] |Record<string,unknown>[]
Defined in: packages/agentos/src/api/runtime/completionGateway.ts:50