feat(capabilities): bound web.scrape batch and expose worst-case units

This commit is contained in:
CREDO23 2026-07-01 17:53:42 +02:00
parent 8fbfa5a6e1
commit c696829568

View file

@ -4,13 +4,21 @@ from __future__ import annotations
from typing import Literal
from pydantic import BaseModel
from pydantic import BaseModel, Field
MAX_SCRAPE_URLS = 20
"""Per-call batch cap: bounds a synchronous request's crawl fan-out (05)."""
class ScrapeInput(BaseModel):
urls: list[str]
urls: list[str] = Field(min_length=1, max_length=MAX_SCRAPE_URLS)
max_length: int = 50_000
@property
def estimated_units(self) -> int:
"""Worst-case billable crawls for pre-flight: one per requested URL."""
return len(self.urls)
class ScrapeRow(BaseModel):
url: str