Routes each agent run to one of several models with the OpenAI Decisions API (beta).
Classifies the latest human message once per run and stores the answer in
modelRoute, then uses the chosen model for every model call in that run. With
no human message, or a refusal, the agent's own model is used.
openAIModelRouterMiddleware(
options: OpenAIModelRouterMiddlewareOptions
): AgentMiddleware<ZodObject<__type, strip>, undefined, unknown, readonly ClientTool | ServerTool[], readonly []>| Name | Type | Description |
|---|---|---|
options* | OpenAIModelRouterMiddlewareOptions |