Spaces:
Running
Running
Download src/models.py from spunteam/streamlit-web-crawler: direct link, hf CLI and curl.
- Browser
- Download file 1.44 kB
-
https://huggingface.co/spaces/spunteam/streamlit-web-crawler/resolve/main/src/models.py
- Command line
-
hf download hf://spaces/spunteam/streamlit-web-crawler/src/models.py
-
curl -L -o models.py https://huggingface.co/spaces/spunteam/streamlit-web-crawler/resolve/main/src/models.py
1.44 kB
| from pydantic import BaseModel, Field | |
| from typing import Optional, List, Dict | |
| from enum import StrEnum | |
| class Status(StrEnum): | |
| RELEVANT = "RELEVANT" | |
| IRRELEVANT = "IRRELEVANT" | |
| FAILED = "FAILED" | |
| class LinkOverview(BaseModel): | |
| summary: str = Field(..., description="A brief summary of the link's content, maximum 1 paragraph.") | |
| SLA: Optional[str] = Field(None, description="Service Level Agreement in days of visa, if mentioned.") | |
| required_docs: Optional[str] = Field(None, description="List of required documents as text, if mentioned.") | |
| price: Optional[str] = Field(None, description="Price or fee information, if mentioned.") | |
| details: Optional[str] = Field(None, description="Additional details about the link's content. 3-5 paragraphs max.") | |
| status: Status = Field(Status.FAILED, description="Overall status of the analysis.") | |
| class LinkNode(BaseModel): | |
| href: str = Field(..., description="The URL of the link") | |
| overview: LinkOverview = Field(..., description="Summary and details about the link's content") | |
| parent: Optional[str] = Field(None, description="The parent link, where this link was found (source).") | |
| child: List[str] = Field(..., description="List of links found on this page") | |
| depth: int = Field(..., description="Depth level in the link hierarchy (0=root, 1=child of root, etc.)") | |
| raw_text: Optional[str] = None # Field to store scraped text before analysis | |