INNER CODE UNIT · Python

KnowledgeBaseRequest

SPThole/CoexistAI · app.py:419

class KnowledgeBaseRequest(BaseModel):
    document_paths: list[str]  # List of paths to create knowledge base from

class CrawlerRequest(BaseModel):
    url_or_urls: Union[str, List[str]]  # Single URL to crawl or list of URLs to scrape
    keywords: Optional[List[str]] = [""]  # Optional keywords to filter content
    depth: Optional[int] = None  # Crawl depth for crawling (None for full website crawl)
    crawl: bool = True  # Whether to crawl (True) or process URLs directly (False)
    min_delay: float = 1.0  # Minimum delay between requests in seconds
    max_delay: float = 2.0  # Maximum delay between requests in seconds
    max_pages: int = 10000  # Maximum number of pages to collect during crawling
    url_keyword: Optional[str] = ""  # Optional keyword to filter URLs by presence in the URL string

@app.post('/clickable-elements', operation_id="get_website_structure")
async def get_website_structure(request: ClickableElementRequest):
    """
    Retrieves the top-k clickable elements from a given URL based on a query.
    This will help you to find out if there are any clickable elements on the page that match the query.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…