You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b7c6ab9
Browse filesBrowse the repository at this point in the historyBrowse files
`createAI` (`agents/models/ai-sdk`, `agents/models/pi-ai`) takes AI Gateway dynamic routes as `ai("dynamic/<route>")`. See [docs/agents/models.md](https://github.com/cloudflare/agents/blob/main/docs/agents/models.md#dynamic-routes).
? 'install its AI SDK provider package and pass the model object, e.g. ai(anthropic("claude-opus-4-8"))'
38
42
: `install ${vendor.package} and pass the model object: ai(${vendor.call})`;
39
43
returnnewTypeError(
40
-
`"${modelId}" is not a Workers AI model id. Workers AI ids start with "@cf/", and they are the only ids this provider takes: a third-party model goes through its own provider and is only routed by AI Gateway — ${advice}.`
44
+
`"${modelId}" is not a Workers AI model id. Workers AI ids start with "@cf/"${
45
+
accepts==="workers-ai-or-route"
46
+
? ' (and AI Gateway dynamic routes with "dynamic/")'
47
+
: ""
48
+
}, and they are the only ids this provider takes: a third-party model goes through its own provider and is only routed by AI Gateway — ${advice}.`
41
49
);
42
50
}
43
51
@@ -48,10 +56,27 @@ export function notAWorkersAIId(modelId: string): TypeError {
48
56
* the line that supplied the id rather than at the request it would have made.
`"${modelId}" is an AI Gateway dynamic route, and a dynamic route is a chat model: it answers in the chat-completions shape. Use it as ai("${modelId}"); the embedding, image, speech, transcription and reranking methods take "@cf/" ids.`
0 commit comments