feat: add ai_search_namespaces and ai_search binding types#13027
Open
G4brym wants to merge 1 commit intocloudflare:mainfrom
Open
feat: add ai_search_namespaces and ai_search binding types#13027G4brym wants to merge 1 commit intocloudflare:mainfrom
G4brym wants to merge 1 commit intocloudflare:mainfrom
Conversation
🦋 Changeset detectedLatest commit: f3cfb67 The changes in this PR will be included in the next version bump. 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 |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
092ea72 to
4425684
Compare
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
78ed937 to
45ee84b
Compare
45ee84b to
64e7ded
Compare
1315e92 to
52a0d3b
Compare
52a0d3b to
9be3ffc
Compare
Add two new AI Search binding types to Wrangler, Miniflare, and workers-utils: - ai_search_namespaces: namespace binding with dynamic instance CRUD - ai_search: single instance binding bound to one instance in a namespace Both are remote-only in local dev. Namespace auto-creation during deploy follows the R2 bucket provisioning pattern. The namespace field on ai_search defaults to 'default' if omitted. Changes across 3 packages: - workers-utils: config schema, runtime types, metadata/binding unions, validation, defaults, reverse mapping - wrangler: upload form with INHERIT_SYMBOL/dryRun handling, provisioning handler, API helpers, print bindings, config diffs, dev utils, miniflare mapping - miniflare: schema-only plugin with remote proxy for local dev
9be3ffc to
f3cfb67
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new AI Search binding types to Wrangler, Miniflare, and workers-utils, enabling Workers to bind directly to AI Search instances via the standalone AI Search binding (replacing
env.AI.autorag()).ai_search_namespaces— namespace binding: scoped to a namespace, supports dynamic instance CRUDai_search— single instance binding: bound to one specific instance within a namespaceBoth bindings are remote-only in local dev (like the AI binding) — no local simulation. Namespace auto-creation follows the R2 bucket provisioning pattern.
Type generation will be added in a follow-up PR once the TypeScript type definitions land in workerd.
Wrangler config
Changes across 3 packages (19 files)
@cloudflare/workers-utils(6 files)environment.ts):ai_search_namespaces+ai_searchfieldsworker.ts):CfAISearchNamespace+CfAISearchinterfacestypes.ts):ai_search_namespace+ai_searchvariantsvalidation.ts): validators, friendly names,notInheritablecalls, safe bindingsconfig.ts):[]defaultsmap-worker-metadata-bindings.ts): metadata → configwrangler(8 files, 1 new)ai-search.ts):createAISearchNamespace,getAISearchNamespacecreate-worker-upload-form.ts): extract + push both types with INHERIT_SYMBOL + dryRun handlingbindings.ts):AISearchNamespaceHandlerextendingProvisionResourceHandler(R2 bucket pattern for namespace auto-creation)miniflare/index.ts): remote-only withremoteProxyConnectionStringminiflare(2 files, 1 new)plugins/ai-search/index.ts): minimal schema-only plugin, remote proxy for local devplugins/index.ts)Tests
Tests are included in this PR:
ai_search_namespaces+ai_search— invalid types, missing fields, valid configs, additional properties, optional namespaceDocumentation
No user-facing documentation is required at this stage. This PR adds internal Wrangler/Miniflare support for the AI Search binding types. External developer documentation will be published when the full binding stack is GA (config-api endpoints, EWC binding kinds, workerd types, and this Wrangler support all need to be deployed together). The documentation PR will be opened against cloudflare-docs at that time.
Design decisions
ai-search:write,ai-search:run)