feat(web): add Parallel as alternative web search/extract backend#1696
Merged
feat(web): add Parallel as alternative web search/extract backend#1696
Conversation
Adds Parallel (parallel.ai) as a drop-in alternative to Firecrawl for web_search and web_extract tools using the official parallel-web SDK. - Backend selection via WEB_SEARCH_BACKEND env var (auto/parallel/firecrawl) - Auto mode prefers Firecrawl when both keys present; Parallel when sole backend - web_crawl remains Firecrawl-only with clear error when unavailable - Lazy SDK imports, interrupt support, singleton clients - 16 new unit tests for backend selection and client config Co-authored-by: s-jag <s-jag@users.noreply.github.com>
… tests Follow-up for Parallel backend integration: - Add PARALLEL_API_KEY to OPTIONAL_ENV_VARS (hermes doctor, env blocklist) - Add to set_config_value api_keys list (hermes config set) - Add to doctor keys display - Fix 2 web_crawl policy tests that didn't set FIRECRAWL_API_KEY (needed now that web_crawl has a Firecrawl availability guard)
Replace the auto-detect backend selection with explicit user choice: - hermes tools saves WEB_SEARCH_BACKEND to .env when user picks a provider - _get_backend() reads the explicit choice first - Fallback only for manual/legacy config (uses whichever key is present) - _is_provider_active() shows [active] for the selected web backend - Updated tests, docs, and .env.example to remove 'auto' mode language
Match the TTS/browser pattern — web.backend is stored in config.yaml (set by hermes tools), not as a WEB_SEARCH_BACKEND env var. - _load_web_config() reads web: section from config.yaml - _get_backend() reads web.backend from config, falls back to key detection - _configure_provider() saves to config dict (saved to config.yaml) - _is_provider_active() reads from config dict - Removed WEB_SEARCH_BACKEND from .env.example, set_config_value, docs - Updated all tests to mock _load_web_config instead of env vars
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
Salvage of PR #1578 by @s-jag (cherry-picked onto current main with authorship preserved).
Adds Parallel as a drop-in alternative to Firecrawl for
web_searchandweb_extracttools, using the officialparallel-webPython SDK.What changed
hermes tools— user picks Firecrawl or Parallel during setup, choice saved asWEB_SEARCH_BACKENDin .env. No auto-detect guessing.WEB_SEARCH_BACKENDisn't set, falls back to whichever key is present.web_crawl_toolremains Firecrawl-only (Parallel has no crawl API) with a clear error if Firecrawl is unavailable.from parallel import Parallelinside client getters, no import-time side effects.parallel-web>=0.4.2added — zero new transitive deps (uses httpx + pydantic already in tree).Commits
PARALLEL_API_KEYin config registry, fix web_crawl policy tests for Firecrawl guardhermes toolsselection._configure_provider()savesWEB_SEARCH_BACKENDto .env,_is_provider_active()shows[active]marker.Files changed
tools/web_tools.py_get_backend()hermes_cli/tools_config.pyweb_backendkey on providers, saves WEB_SEARCH_BACKEND on selectionhermes_cli/config.pyPARALLEL_API_KEYin OPTIONAL_ENV_VARS, set_config_value, doctor keyshermes_cli/setup.pytools/environments/local.pypyproject.toml/requirements.txtparallel-web>=0.4.2tests/tools/test_web_tools_config.pytests/tools/test_website_policy.py.env.example, docsTest plan
pytest tests/tools/test_web_tools_config.py— 24/24 passpytest tests/tools/test_website_policy.py— 22/22 passCloses #1578