Skip to content

Validate Workers AI config & widen model types#400

Merged
threepointone merged 1 commit intomainfrom
binding-errors-wider-name
Feb 15, 2026
Merged

Validate Workers AI config & widen model types#400
threepointone merged 1 commit intomainfrom
binding-errors-wider-name

Conversation

@threepointone
Copy link
Collaborator

Add early config validation for Workers AI (validateWorkersAiConfig) that throws a clear error when neither a binding nor credentials/gateway are provided, and wire it into adapter constructors and client builders. Widen many Workers AI model type unions to accept arbitrary string values (while preserving autocomplete for known models). Apply small runtime type casts for binding.run calls and response shapes in workers-ai-provider. Add unit tests for config detection, validation, and arbitrary model strings, plus .changeset notes.

Add early config validation for Workers AI (validateWorkersAiConfig) that throws a clear error when neither a binding nor credentials/gateway are provided, and wire it into adapter constructors and client builders. Widen many Workers AI model type unions to accept arbitrary string values (while preserving autocomplete for known models). Apply small runtime type casts for binding.run calls and response shapes in workers-ai-provider. Add unit tests for config detection, validation, and arbitrary model strings, plus .changeset notes.
@changeset-bot
Copy link

changeset-bot bot commented Feb 15, 2026

🦋 Changeset detected

Latest commit: 8822603

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
workers-ai-provider Patch
@cloudflare/tanstack-ai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 15, 2026

Open in StackBlitz

npx https://pkg.pr.new/cloudflare/ai/ai-gateway-provider@400
npx https://pkg.pr.new/cloudflare/ai/@cloudflare/tanstack-ai@400
npx https://pkg.pr.new/cloudflare/ai/workers-ai-provider@400

commit: 8822603

@threepointone threepointone merged commit ff98275 into main Feb 15, 2026
3 checks passed
@threepointone threepointone deleted the binding-errors-wider-name branch February 15, 2026 09:59
@github-actions github-actions bot mentioned this pull request Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant