SurfSense/surfsense_backend/app/capabilities/web/scrape/definition.py

23 lines
873 B
Python

"""``web.scrape`` capability registration."""
from __future__ import annotations
from app.capabilities.core import BillingUnit, Capability, register_capability
from app.capabilities.web.scrape.executor import build_scrape_executor
from app.capabilities.web.scrape.schemas import ScrapeInput, ScrapeOutput
WEB_SCRAPE = Capability(
name="web.scrape",
description=(
"Fetch one or more web pages and return their clean, readable content. "
"Give it the exact URLs to read (use web.discover first if you don't have "
"them). Returns one row per URL with a status (success/empty/failed), the "
"page content, and metadata such as title and description."
),
input_schema=ScrapeInput,
output_schema=ScrapeOutput,
executor=build_scrape_executor(),
billing_unit=BillingUnit.WEB_CRAWL,
)
register_capability(WEB_SCRAPE)