feat(search): add contentTypes filter - #101
Open
VinciGit00 wants to merge 1 commit into
Open
Conversation
Search now accepts contentTypes so callers can pick which content types get fetched. Adds application/json and text/markdown to FetchContentType to match the API enum. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
VinciGit00
force-pushed
the
marcovinciguerra/feat/search-content-types
branch
from
July 29, 2026 13:06
fbafa92 to
a23f016
Compare
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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.
Mirrors the API change from sgai-stack#955:
/api/searchnow acceptscontentTypesand, when the field is omitted, only fetches text-like results (text/html,application/json,text/markdown,text/plain) — PDFs, office documents and images are skipped.Changes
SearchRequest.content_types(serialized ascontentTypes)content_typeskwarg onScrapeGraphAI.search()andAsyncScrapeGraphAI.search()FetchContentTypegainsapplication/jsonandtext/markdown, and is reordered to match the API enum (it was missing both, socrawl(content_types=...)could not target JSON or Markdown pages either)Verification
uv run pytest -q→ 28 passed, 1 skippedSearchRequest(query="x", content_types=["text/markdown", "application/pdf"])serializes to{"contentTypes": ["text/markdown", "application/pdf"], ...}contentTypes) drops a PDF result (4/5 scraped), addingapplication/pdffetches it (5/5)🤖 Generated with Claude Code