inital commit

This commit is contained in:
Ned Halksworth
2026-05-04 19:31:46 +01:00
commit e0f2eedcd9
14 changed files with 3718 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
"""Pydantic models for sFetch's API."""
from __future__ import annotations
from pydantic import BaseModel, Field
class SearchResult(BaseModel):
id: int
url: str
title: str
snippet: str
indexed_at: str
class ImageResult(BaseModel):
id: int
url: str
page_url: str
alt_text: str
indexed_at: str
class VideoResult(BaseModel):
id: int
url: str
page_url: str
title: str
indexed_at: str
class SearchResponse(BaseModel):
query: str
type: str = "web"
total: int
results: list[SearchResult] | list[ImageResult] | list[VideoResult]
class CrawlRequest(BaseModel):
seed_urls: list[str] = Field(min_length=1)
max_depth: int = Field(default=2, ge=0, le=5)
max_pages_per_domain: int = Field(default=50, ge=1, le=500)
same_domain_only: bool = True