Skip to content

[wrangler] Add --parse-type to ai-search create - #14952

Merged
petebacondarwin merged 1 commit into
cloudflare:mainfrom
nelsonjsduarte:nduarte/RAG-1541-ai-search-parse-type
Aug 2, 2026
Merged

[wrangler] Add --parse-type to ai-search create#14952
petebacondarwin merged 1 commit into
cloudflare:mainfrom
nelsonjsduarte:nduarte/RAG-1541-ai-search-parse-type

Conversation

@nelsonjsduarte

@nelsonjsduarte nelsonjsduarte commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Fixes RAG-1541.

Adds a --parse-type flag to wrangler ai-search create so a website data source can be created with parse_type set to discover rather than the default sitemap.

The parse type could previously only be chosen through the interactive wizard, and that prompt was nested inside the "no --source supplied" branch — so it was unreachable whenever --source was passed, making discover impossible to set from a script. Parse-type resolution now happens in its own step, before source selection.

  • New flag --parse-type with choices sitemap / discover (sitemap reads XML sitemaps; discover follows links recursively).
  • Only valid for --type web-crawler; passing it with --type builtin or --type r2 errors, since the API stores the value for those source types but never reads it.
  • Forwarded to the API as source_params.web_crawler.parse_type.
  • The interactive web flow now offers Discover alongside Sitemap.
  • Omitted from the payload in non-interactive mode when the flag is absent, so the API default (sitemap) still applies and existing scripted invocations are unaffected.
  • AiSearchSourceParams.web_crawler.parse_type was typed as a bare string; it is now the AiSearchParseType union.

Example:

wrangler ai-search create my-instance --type web-crawler --source https://example.com --parse-type discover


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: the wrangler ai-search commands are in open beta and not yet part of the published public Wrangler command docs; this flag will be documented alongside that command set. Note that the discover parse type is itself not yet in the public AI Search API docs either, so a docs update covering both is expected to follow separately.

Open in Devin Review

@changeset-bot

changeset-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4bab1a0

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

This PR includes changesets to release 3 packages
Name Type
wrangler Minor
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers 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

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Jul 31, 2026
@workers-devprod
workers-devprod requested review from a team and petebacondarwin and removed request for a team July 31, 2026 12:50
@workers-devprod

workers-devprod commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Jul 31, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@14952

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@14952

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@14952

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14952

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14952

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14952

miniflare

npm i https://pkg.pr.new/miniflare@14952

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@14952

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14952

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14952

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14952

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14952

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14952

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14952

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14952

wrangler

npm i https://pkg.pr.new/wrangler@14952

commit: 4bab1a0

Adds a --parse-type flag to `wrangler ai-search create` so a web-crawler
instance can be created with parse_type set to `discover` rather than the
default `sitemap`.

The parse type could previously only be chosen through the interactive
wizard, and that prompt was nested inside the "no --source supplied"
branch — so it was unreachable whenever --source was passed, making
`discover` impossible to set from a script. Parse-type resolution now
happens in its own step before source selection.

- New flag --parse-type with choices `sitemap` / `discover`.
- Only valid for --type web-crawler; passing it with --type builtin or
  --type r2 errors, since the API stores the value for those source types
  but never reads it.
- Forwarded as source_params.web_crawler.parse_type.
- The interactive web flow now offers Discover alongside Sitemap.
- Omitted in non-interactive mode when the flag is absent, so the API
  default (`sitemap`) still applies and existing scripts are unaffected.
@petebacondarwin
petebacondarwin force-pushed the nduarte/RAG-1541-ai-search-parse-type branch from 3bd86ff to 4bab1a0 Compare July 31, 2026 14:07

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Aug 1, 2026
@petebacondarwin
petebacondarwin merged commit 20470fa into cloudflare:main Aug 2, 2026
98 of 108 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants