mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-01 08:21:50 +08:00
feat(web): add Tavily as web search/extract/crawl backend
Adds Tavily (tavily.com) as a third web backend alongside Firecrawl and Parallel using the Tavily REST API via httpx. - Backend selection via hermes tools → saved as web.backend in config.yaml - Tavily support for all three tools: search, extract, and crawl - TAVILY_API_KEY in config registry, doctor, status, setup wizard - _tavily_request() helper with error handling - Normalizer functions for search results and documents - 15 new Tavily-specific tests + 9 backend selection tests - Backward compatible — existing Firecrawl/Parallel users unaffected Co-authored-by: kshitijk4poor <kshitijk4poor@users.noreply.github.com>
This commit is contained in:
@@ -316,6 +316,38 @@ class TestSanitizeEnvLines:
|
||||
assert fixes == 0
|
||||
|
||||
|
||||
class TestOptionalEnvVarsRegistry:
|
||||
"""Verify that key env vars are registered in OPTIONAL_ENV_VARS."""
|
||||
|
||||
def test_tavily_api_key_registered(self):
|
||||
"""TAVILY_API_KEY is listed in OPTIONAL_ENV_VARS."""
|
||||
from hermes_cli.config import OPTIONAL_ENV_VARS
|
||||
assert "TAVILY_API_KEY" in OPTIONAL_ENV_VARS
|
||||
|
||||
def test_tavily_api_key_is_tool_category(self):
|
||||
"""TAVILY_API_KEY is in the 'tool' category."""
|
||||
from hermes_cli.config import OPTIONAL_ENV_VARS
|
||||
assert OPTIONAL_ENV_VARS["TAVILY_API_KEY"]["category"] == "tool"
|
||||
|
||||
def test_tavily_api_key_is_password(self):
|
||||
"""TAVILY_API_KEY is marked as password."""
|
||||
from hermes_cli.config import OPTIONAL_ENV_VARS
|
||||
assert OPTIONAL_ENV_VARS["TAVILY_API_KEY"]["password"] is True
|
||||
|
||||
def test_tavily_api_key_has_url(self):
|
||||
"""TAVILY_API_KEY has a URL."""
|
||||
from hermes_cli.config import OPTIONAL_ENV_VARS
|
||||
assert OPTIONAL_ENV_VARS["TAVILY_API_KEY"]["url"] == "https://app.tavily.com/home"
|
||||
|
||||
def test_tavily_in_env_vars_by_version(self):
|
||||
"""TAVILY_API_KEY is listed in ENV_VARS_BY_VERSION."""
|
||||
from hermes_cli.config import ENV_VARS_BY_VERSION
|
||||
all_vars = []
|
||||
for vars_list in ENV_VARS_BY_VERSION.values():
|
||||
all_vars.extend(vars_list)
|
||||
assert "TAVILY_API_KEY" in all_vars
|
||||
|
||||
|
||||
class TestAnthropicTokenMigration:
|
||||
"""Test that config version 8→9 clears ANTHROPIC_TOKEN."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user