Skip to main content

Internal Service: organize_with_llm

Uses an LLM to organize and structure the scraped website content.

Function Signature

async def organize_with_llm(
    url: str,
    scrape_result: dict,
    business_id: str,
    existing_structure: Optional[dict]
) -> dict

Parameters

ParameterTypeDescription
urlstrSource website URL
scrape_resultdictResult from scrape_website
business_idstrBusiness identifier
existing_structuredictNone for fresh generation

Purpose

The LLM analyzes the scraped content and:
  • Identifies business information
  • Extracts key products/services
  • Generates Q&A pairs
  • Structures navigation

Returns

Organized content structure for file generation.

Code Location

src/app/shared/ai_website/service.py