feat(web): add Ollama Cloud as web search/extract backend

Adds support for Ollama Cloud's built-in web search and fetch APIs as a
web backend option. This allows users with Ollama Cloud subscriptions to
use web search without additional API costs (Tavily, Exa, etc).

Changes:
- Add 'ollama' backend to _get_backend() validation and backend_candidates
- Implement _ollama_request() for authenticated API calls (Bearer token)
- Add _ollama_search() calling https://ollama.com/api/web_search
- Add _ollama_fetch() calling https://ollama.com/api/web_fetch
- Add result normalization functions matching other backends
- Wire up ollama backend in web_search_tool() and web_extract_tool()
- Add Ollama Cloud provider to hermes tools setup menu
- Update check_web_api_key() to include ollama backend

Usage:
  Set OLLAMA_API_KEY in .env (from https://ollama.com)
  Set web.backend: ollama in config.yaml

API endpoints:
  - web_search: POST https://ollama.com/api/web_search
  - web_fetch: POST https://ollama.com/api/web_fetch

Docs: https://docs.ollama.com/capabilities/web-search
This commit is contained in:
Vito Botta 2026-04-11 17:32:49 +03:00
parent af9caec44f
commit 939ae01b32
No known key found for this signature in database
2 changed files with 197 additions and 3 deletions

View file

@ -238,6 +238,14 @@ TOOL_CATEGORIES = {
{"key": "TAVILY_API_KEY", "prompt": "Tavily API key", "url": "https://app.tavily.com/home"},
],
},
{
"name": "Ollama Cloud",
"tag": "Web search and fetch (included with Ollama subscription)",
"web_backend": "ollama",
"env_vars": [
{"key": "OLLAMA_API_KEY", "prompt": "Ollama API key", "url": "https://ollama.com"},
],
},
{
"name": "Firecrawl Self-Hosted",
"tag": "Free - run your own instance",