Skip to content
This repository was archived by the owner on Aug 24, 2026. It is now read-only.

feat: use jina ai for web context extraction - #5

Merged
Tanq16 merged 4 commits into
mainfrom
feature/jina-ai-scraper-4419090121760230004
May 23, 2026
Merged

feat: use jina ai for web context extraction#5
Tanq16 merged 4 commits into
mainfrom
feature/jina-ai-scraper-4419090121760230004

Conversation

@Tanq16

@Tanq16 Tanq16 commented May 21, 2026

Copy link
Copy Markdown
Owner

This PR updates the web scraping functionality in ai-context to use the Jina AI reader API (https://r.jina.ai/). This significantly improves context quality, bypasses paywalls, handles JavaScript rendering, and directly produces markdown, rendering the previous manual HTML parsing and cleanup logic obsolete.

Changes:

  • Replaced ProcessWebContent implementation to utilize r.jina.ai.
  • Removed old helper functions cleanHTML, findTitle, processImages, etc.
  • Removed unused dependencies (like github.com/JohannesKaufmann/html-to-markdown/v2 and golang.org/x/net/html) from go.mod via go mod tidy.

PR created automatically by Jules for task 4419090121760230004 started by @Tanq16

- Update web-context.go to use r.jina.ai for robust web scraping and md conversion.
- Removed outdated HTML parsing logic and image downloading.
- Cleaned up go.mod with go mod tidy, removing html-to-markdown dependency.

Co-authored-by: Tanq16 <37408906+Tanq16@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 3 commits May 21, 2026 19:22
…al fallback

- Update web-context.go to use r.jina.ai for robust web scraping and md conversion concurrently with the standard local HTML parsing approach.
- Prioritize Jina output and fallback to local parsing on failure.
- Introduced an `--offline` (`-o`) flag to force local fetching, disabling calls to Jina AI.

Co-authored-by: Tanq16 <37408906+Tanq16@users.noreply.github.com>
…al fallback

- Update web-context.go to use r.jina.ai for robust web scraping and md conversion concurrently with the standard local HTML parsing approach.
- Prioritize Jina output and fallback to local parsing on failure.
- Introduced an `--offline` (`-o`) flag to force local fetching, disabling calls to Jina AI.

Co-authored-by: Tanq16 <37408906+Tanq16@users.noreply.github.com>
- Added `jina-scraper` subcommand to utilize `r.jina.ai` for robust web context extraction.
- Retained original local HTML parsing logic as the default extractor behavior.
- Propagated `useJina` flag through the internal handler pipeline to differentiate behavior.

Co-authored-by: Tanq16 <37408906+Tanq16@users.noreply.github.com>
@Tanq16
Tanq16 merged commit 27ed44c into main May 23, 2026
@Tanq16
Tanq16 deleted the feature/jina-ai-scraper-4419090121760230004 branch May 23, 2026 03:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant