Edit on GitHub

agent_search_gateway.providers.defaults

Built-in first-version web provider registrations.

  1"""Built-in first-version web provider registrations."""
  2
  3from .contracts import ProviderCapabilities
  4from .registry import ProviderRegistry, WebProviderRegistration
  5from .web.anysearch import AnySearchAdapter
  6from .web.brave import BraveAdapter
  7from .web.brightdata import BrightDataAdapter
  8from .web.decodo import DecodoAdapter
  9from .web.exa import ExaAdapter
 10from .web.firecrawl import FirecrawlAdapter
 11from .web.jina import JinaReaderAdapter
 12from .web.linkup import LinkupAdapter
 13from .web.parallel import ParallelAdapter
 14from .web.scrape_do import ScrapeDoAdapter
 15from .web.scrapegraphai import ScrapeGraphAIAdapter
 16from .web.scraperapi import ScraperAPIAdapter
 17from .web.scrapingant import ScrapingAntAdapter
 18from .web.scrapingdog import ScrapingDogAdapter
 19from .web.serpapi import SerpApiAdapter
 20from .web.tavily import TavilyAdapter
 21from .web.tinyfish import TinyFishAdapter
 22from .web.zenrows import ZenRowsAdapter
 23
 24
 25def build_default_registry() -> ProviderRegistry:
 26    registry = ProviderRegistry()
 27    registrations = (
 28        WebProviderRegistration(
 29            "tavily",
 30            ProviderCapabilities(search=True, fetch=True),
 31            TavilyAdapter,
 32            frozenset({"api_url"}),
 33        ),
 34        WebProviderRegistration(
 35            "firecrawl",
 36            ProviderCapabilities(search=True, fetch=True),
 37            FirecrawlAdapter,
 38            frozenset({"api_url"}),
 39        ),
 40        WebProviderRegistration(
 41            "exa",
 42            ProviderCapabilities(search=True, fetch=True),
 43            ExaAdapter,
 44            frozenset({"api_url"}),
 45        ),
 46        WebProviderRegistration(
 47            "linkup",
 48            ProviderCapabilities(search=True, fetch=True),
 49            LinkupAdapter,
 50            frozenset({"api_url"}),
 51        ),
 52        WebProviderRegistration(
 53            "brave",
 54            ProviderCapabilities(search=True, fetch=False),
 55            BraveAdapter,
 56            frozenset({"api_url"}),
 57        ),
 58        WebProviderRegistration(
 59            "anysearch",
 60            ProviderCapabilities(search=True, fetch=False),
 61            AnySearchAdapter,
 62            frozenset({"api_url"}),
 63        ),
 64        WebProviderRegistration(
 65            "tinyfish",
 66            ProviderCapabilities(search=True, fetch=True),
 67            TinyFishAdapter,
 68            frozenset({"search_api_url", "fetch_api_url"}),
 69        ),
 70        WebProviderRegistration(
 71            "parallel",
 72            ProviderCapabilities(search=True, fetch=True),
 73            ParallelAdapter,
 74            frozenset({"api_url", "mode", "search_fetch_policy", "extract_fetch_policy"}),
 75        ),
 76        WebProviderRegistration(
 77            "brightdata",
 78            ProviderCapabilities(search=True, fetch=True),
 79            BrightDataAdapter,
 80            frozenset({"api_url", "search_zone", "fetch_zone"}),
 81        ),
 82        WebProviderRegistration(
 83            "scrape_do",
 84            ProviderCapabilities(search=True, fetch=True),
 85            ScrapeDoAdapter,
 86            frozenset({"api_url"}),
 87        ),
 88        WebProviderRegistration(
 89            "zenrows",
 90            ProviderCapabilities(search=False, fetch=True),
 91            ZenRowsAdapter,
 92            frozenset({"api_url"}),
 93        ),
 94        WebProviderRegistration(
 95            "decodo",
 96            ProviderCapabilities(search=True, fetch=True),
 97            DecodoAdapter,
 98            frozenset({"api_url"}),
 99        ),
100        WebProviderRegistration(
101            "scrapingdog",
102            ProviderCapabilities(search=True, fetch=True),
103            ScrapingDogAdapter,
104            frozenset({"api_url"}),
105        ),
106        WebProviderRegistration(
107            "scrapegraphai",
108            ProviderCapabilities(search=True, fetch=True),
109            ScrapeGraphAIAdapter,
110            frozenset({"api_url"}),
111        ),
112        WebProviderRegistration(
113            "scraperapi",
114            ProviderCapabilities(search=True, fetch=True),
115            ScraperAPIAdapter,
116            frozenset({"api_url"}),
117        ),
118        WebProviderRegistration(
119            "scrapingant",
120            ProviderCapabilities(search=False, fetch=True),
121            ScrapingAntAdapter,
122            frozenset({"api_url"}),
123        ),
124        WebProviderRegistration(
125            "serpapi",
126            ProviderCapabilities(search=True, fetch=False),
127            SerpApiAdapter,
128            frozenset({"api_url"}),
129        ),
130        WebProviderRegistration(
131            "jina",
132            ProviderCapabilities(search=False, fetch=True),
133            JinaReaderAdapter,
134            frozenset({"api_url"}),
135            requires_api_key=False,
136        ),
137    )
138    for registration in registrations:
139        registry.register(registration)
140    return registry
def build_default_registry() -> agent_search_gateway.providers.registry.ProviderRegistry:
 26def build_default_registry() -> ProviderRegistry:
 27    registry = ProviderRegistry()
 28    registrations = (
 29        WebProviderRegistration(
 30            "tavily",
 31            ProviderCapabilities(search=True, fetch=True),
 32            TavilyAdapter,
 33            frozenset({"api_url"}),
 34        ),
 35        WebProviderRegistration(
 36            "firecrawl",
 37            ProviderCapabilities(search=True, fetch=True),
 38            FirecrawlAdapter,
 39            frozenset({"api_url"}),
 40        ),
 41        WebProviderRegistration(
 42            "exa",
 43            ProviderCapabilities(search=True, fetch=True),
 44            ExaAdapter,
 45            frozenset({"api_url"}),
 46        ),
 47        WebProviderRegistration(
 48            "linkup",
 49            ProviderCapabilities(search=True, fetch=True),
 50            LinkupAdapter,
 51            frozenset({"api_url"}),
 52        ),
 53        WebProviderRegistration(
 54            "brave",
 55            ProviderCapabilities(search=True, fetch=False),
 56            BraveAdapter,
 57            frozenset({"api_url"}),
 58        ),
 59        WebProviderRegistration(
 60            "anysearch",
 61            ProviderCapabilities(search=True, fetch=False),
 62            AnySearchAdapter,
 63            frozenset({"api_url"}),
 64        ),
 65        WebProviderRegistration(
 66            "tinyfish",
 67            ProviderCapabilities(search=True, fetch=True),
 68            TinyFishAdapter,
 69            frozenset({"search_api_url", "fetch_api_url"}),
 70        ),
 71        WebProviderRegistration(
 72            "parallel",
 73            ProviderCapabilities(search=True, fetch=True),
 74            ParallelAdapter,
 75            frozenset({"api_url", "mode", "search_fetch_policy", "extract_fetch_policy"}),
 76        ),
 77        WebProviderRegistration(
 78            "brightdata",
 79            ProviderCapabilities(search=True, fetch=True),
 80            BrightDataAdapter,
 81            frozenset({"api_url", "search_zone", "fetch_zone"}),
 82        ),
 83        WebProviderRegistration(
 84            "scrape_do",
 85            ProviderCapabilities(search=True, fetch=True),
 86            ScrapeDoAdapter,
 87            frozenset({"api_url"}),
 88        ),
 89        WebProviderRegistration(
 90            "zenrows",
 91            ProviderCapabilities(search=False, fetch=True),
 92            ZenRowsAdapter,
 93            frozenset({"api_url"}),
 94        ),
 95        WebProviderRegistration(
 96            "decodo",
 97            ProviderCapabilities(search=True, fetch=True),
 98            DecodoAdapter,
 99            frozenset({"api_url"}),
100        ),
101        WebProviderRegistration(
102            "scrapingdog",
103            ProviderCapabilities(search=True, fetch=True),
104            ScrapingDogAdapter,
105            frozenset({"api_url"}),
106        ),
107        WebProviderRegistration(
108            "scrapegraphai",
109            ProviderCapabilities(search=True, fetch=True),
110            ScrapeGraphAIAdapter,
111            frozenset({"api_url"}),
112        ),
113        WebProviderRegistration(
114            "scraperapi",
115            ProviderCapabilities(search=True, fetch=True),
116            ScraperAPIAdapter,
117            frozenset({"api_url"}),
118        ),
119        WebProviderRegistration(
120            "scrapingant",
121            ProviderCapabilities(search=False, fetch=True),
122            ScrapingAntAdapter,
123            frozenset({"api_url"}),
124        ),
125        WebProviderRegistration(
126            "serpapi",
127            ProviderCapabilities(search=True, fetch=False),
128            SerpApiAdapter,
129            frozenset({"api_url"}),
130        ),
131        WebProviderRegistration(
132            "jina",
133            ProviderCapabilities(search=False, fetch=True),
134            JinaReaderAdapter,
135            frozenset({"api_url"}),
136            requires_api_key=False,
137        ),
138    )
139    for registration in registrations:
140        registry.register(registration)
141    return registry