Add /extract/batch path for batch URL extraction#39
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e430584324
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Thanks fot the PR! I pushed two small fixes to your branch to get CI green: quoted description in openapi.yaml (broke YAML parsing), and exempted A few minor things I'll handle myself after merge (per-URL errors for invalid URLs, parameter parity with /extract). |
Summary
I was testing for various search engines / content extractors for Open WebUI / Hermes and OpenSERP worked the best! However I found out that for content extraction, OpenWebUI has a different format for request
https://github.com/open-webui/open-webui/blob/main/backend/open_webui/retrieval/loaders/external_web.py
I added /extract/batch endpoint and tested with OpenWebUI, works beautifully. However, it can also be used simply when needed a method for batched data extraction.
NOTE: I used agentic coding to make the changes, as I am myself not proficient in Go (mainly use Python/C++). I made sure to review the changes myself to the possible extend and roast the agent to remove all possible unnecessary changes and conform to original style. PR description above is typed manually.
Testing
make test— PASS (go test -race -count=1 github.all packages pass via Docker)make lint— PASS (go vet github.clean,golangci-lintclean, both via Docker)make test-integration— SKIP (no browser/proxy/captcha/live-engine changes)Checklist
I linked the related issue or explained why there is none.
No related issue — this adds a new
POST /extract/batchendpoint for multi-URL extraction.I updated docs or examples for changed user-facing behavior.
Updated openapi.yaml with the new
/extract/batchendpoint,BatchExtractRequest, andBatchExtractItemschemas.I kept unit tests deterministic and free of browser/network dependencies.
All batch tests use
httptest.NewServer(local in-process HTTP server) — no external network or browser required. Runs in <100ms.I removed secrets, proxy credentials, and private logs from examples.
No secrets or credentials in any added code, tests, or docs.