File size: 1,436 Bytes
e3a58b9
2c76fa0
e3a58b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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