mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-26 23:51:14 +02:00
feat: validate walmart scrape and reviews URLs
This commit is contained in:
parent
1996d3e54d
commit
4e4b9236c3
2 changed files with 4 additions and 2 deletions
|
|
@ -11,13 +11,14 @@ from typing import Literal
|
|||
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
from app.capabilities.core.validation import HttpUrlStr
|
||||
from app.proprietary.platforms.walmart import ReviewItem
|
||||
|
||||
MAX_WALMART_REVIEW_SOURCES = 20
|
||||
|
||||
|
||||
class ReviewsInput(BaseModel):
|
||||
urls: list[str] = Field(
|
||||
urls: list[HttpUrlStr] = Field(
|
||||
default_factory=list,
|
||||
max_length=MAX_WALMART_REVIEW_SOURCES,
|
||||
description=(
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ from urllib.parse import quote_plus
|
|||
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
from app.capabilities.core.validation import HttpUrlStr
|
||||
from app.proprietary.platforms.walmart import ProductItem
|
||||
|
||||
MAX_WALMART_SOURCES = 20
|
||||
|
|
@ -15,7 +16,7 @@ MAX_WALMART_RESULTS = 1000
|
|||
class ScrapeInput(BaseModel):
|
||||
"""Agent-facing controls for public Walmart product discovery and enrichment."""
|
||||
|
||||
urls: list[str] = Field(default_factory=list, max_length=MAX_WALMART_SOURCES)
|
||||
urls: list[HttpUrlStr] = Field(default_factory=list, max_length=MAX_WALMART_SOURCES)
|
||||
search_terms: list[str] = Field(
|
||||
default_factory=list, max_length=MAX_WALMART_SOURCES
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue