Remove obsolete migration and workflow files; delete Site Builder Wizard references and related components. Update documentation to reflect the removal of the WorkflowState model and streamline the site building process.

This commit is contained in:
IGNY8 VPS (Salman)
2025-11-21 00:59:34 +00:00
parent 6bb918bad6
commit c8adfe06d1
23 changed files with 1914 additions and 3493 deletions

View File

@@ -1,7 +1,7 @@
# IGNY8 AI Framework Implementation Reference
**Last Updated:** 2025-01-XX
**Purpose:** Complete AI framework implementation reference covering architecture, code structure, all 5 AI functions, execution flow, progress tracking, cost tracking, prompt management, and model configuration.
**Last Updated:** 2025-01-XX (Added 3 missing AI functions: generate_site_structure, optimize_content, generate_page_content)
**Purpose:** Complete AI framework implementation reference covering architecture, code structure, all 8 AI functions, execution flow, progress tracking, cost tracking, prompt management, and model configuration.
---
@@ -39,6 +39,9 @@ The IGNY8 AI framework provides a unified interface for all AI operations. All A
3. **Generate Content**: Generate blog post and article content
4. **Generate Image Prompts**: Extract image prompts from content
5. **Generate Images**: Generate images using OpenAI DALL-E or Runware
6. **Generate Site Structure**: Create site/page architecture from business brief
7. **Optimize Content**: Optimize content for SEO, readability, and engagement
8. **Generate Page Content**: Generate structured page content with JSON blocks for Site Builder
---
@@ -87,6 +90,17 @@ The IGNY8 AI framework provides a unified interface for all AI operations. All A
- `get_function_instance` - Gets function instance by name
- `list_functions` - Lists all registered functions
**Registered Functions** (7 lazy-loaded):
1. `auto_cluster` - AutoClusterFunction
2. `generate_ideas` - GenerateIdeasFunction
3. `generate_content` - GenerateContentFunction
4. `generate_images` - GenerateImagesFunction
5. `generate_image_prompts` - GenerateImagePromptsFunction
6. `generate_site_structure` - GenerateSiteStructureFunction
7. `optimize_content` - OptimizeContentFunction
**Note**: `generate_page_content` exists as a function but may be called directly without registry registration.
#### AI Core Handler
**File**: `backend/igny8_core/ai/ai_core.py`
**Class**: `AICore`
@@ -111,6 +125,9 @@ The IGNY8 AI framework provides a unified interface for all AI operations. All A
- `image_prompt_extraction` - For extract_image_prompts function
- `image_prompt_template` - Template for formatting image prompts
- `negative_prompt` - Negative prompt for Runware image generation
- `site_structure_generation` - For generate_site_structure function
- `content_optimization` - For optimize_content function
- `page_content_generation` - For generate_page_content function
#### Model Settings
**File**: `backend/igny8_core/ai/settings.py`
@@ -352,6 +369,118 @@ The IGNY8 AI framework provides a unified interface for all AI operations. All A
- PARSE: "Processing image response"
- SAVE: "Saving generated image(s)"
### 6. Generate Site Structure
**Purpose**: Create site/page architecture from business brief, objectives, and style guides
**Function Class**: `GenerateSiteStructureFunction`
**File**: `backend/igny8_core/ai/functions/generate_site_structure.py`
**API Endpoint**:
- **ViewSet**: `SiteBlueprintViewSet`
- **Action**: `generate_structure`
- **Method**: POST
- **URL Path**: `/v1/site-builder/blueprints/{id}/generate_structure/`
- **Payload**: `ids` (list[int]) - Site Blueprint IDs
**Function Methods**:
- `get_name()`: Returns `'generate_site_structure'`
- `validate(payload, account)`: Validates blueprint ID exists
- `prepare(payload, account)`: Loads site blueprint with related data
- `build_prompt(data, account)`: Builds site structure generation prompt with business brief, objectives, style guides
- `parse_response(response, step_tracker)`: Parses site structure JSON (pages, blocks, navigation)
- `save_output(parsed, original_data, account, progress_tracker, step_tracker)`: Creates PageBlueprint records with blocks
**Input**: Site Blueprint ID
**Output**: PageBlueprint records created with structured blocks
**Progress Messages**:
- INIT: "Validating blueprint data…"
- PREP: "Preparing site context…"
- AI_CALL: "Generating site structure with AI…"
- PARSE: "Parsing generated blueprint…"
- SAVE: "Saving pages and blocks…"
- DONE: "Site structure ready!"
### 7. Optimize Content
**Purpose**: Optimize content for SEO, readability, and engagement
**Function Class**: `OptimizeContentFunction`
**File**: `backend/igny8_core/ai/functions/optimize_content.py`
**API Endpoint**:
- **ViewSet**: `OptimizerViewSet`
- **Action**: `optimize` or `analyze`
- **Method**: POST
- **URL Path**: `/v1/optimizer/optimize/` or `/v1/optimizer/analyze/`
- **Payload**: `ids` (list[int]) - Content IDs, `entry_point` (optional, str)
**Function Methods**:
- `get_name()`: Returns `'optimize_content'`
- `validate(payload, account)`: Validates content IDs exist
- `prepare(payload, account)`: Loads content with related data
- `build_prompt(data, account)`: Builds optimization prompt with content, SEO targets, readability goals
- `parse_response(response, step_tracker)`: Parses optimized content JSON
- `save_output(parsed, original_data, account, progress_tracker, step_tracker)`: Updates Content records with optimized content and scores
**Input**: List of content IDs
**Output**: Content records updated with optimized content, SEO scores, readability scores
**Optimization Features**:
- SEO optimization (keyword density, meta descriptions, headings)
- Readability improvements (sentence length, paragraph structure)
- Engagement enhancements (call-to-actions, internal links)
- Content scoring (SEO score, readability score, engagement score)
**Progress Messages**:
- INIT: "Validating content data…"
- PREP: "Preparing content context…"
- AI_CALL: "Optimizing content with AI…"
- PARSE: "Parsing optimized content…"
- SAVE: "Saving optimized content…"
- DONE: "Content optimized!"
### 8. Generate Page Content
**Purpose**: Generate structured page content with JSON blocks for Site Builder pages
**Function Class**: `GeneratePageContentFunction`
**File**: `backend/igny8_core/ai/functions/generate_page_content.py`
**API Endpoint**:
- **ViewSet**: `PageBlueprintViewSet`
- **Action**: `generate_content` or `regenerate`
- **Method**: POST
- **URL Path**: `/v1/site-builder/pages/{id}/generate_content/` or `/v1/site-builder/pages/{id}/regenerate/`
- **Payload**: `ids` (list[int]) - Page Blueprint IDs (max 20)
**Function Methods**:
- `get_name()`: Returns `'generate_page_content'`
- `get_max_items()`: Returns `20` (max pages per batch)
- `validate(payload, account)`: Validates page blueprint IDs exist
- `prepare(payload, account)`: Loads page blueprints with related data
- `build_prompt(data, account)`: Builds page content generation prompt optimized for Site Builder
- `parse_response(response, step_tracker)`: Parses JSON blocks format
- `save_output(parsed, original_data, account, progress_tracker, step_tracker)`: Updates PageBlueprint records with blocks_json
**Input**: List of page blueprint IDs
**Output**: PageBlueprint records updated with structured blocks_json
**Key Differences from Generate Content**:
- Outputs structured JSON blocks format instead of HTML
- Optimized prompts for site builder pages
- Supports page-specific context (site structure, navigation, related pages)
- Blocks can include: headings, paragraphs, images, CTAs, forms, etc.
**Progress Messages**:
- INIT: "Initializing page content generation..."
- PREP: "Loading page blueprint and building prompt..."
- AI_CALL: "Generating structured content with AI..."
- PARSE: "Parsing JSON blocks..."
- SAVE: "Saving blocks to page..."
- DONE: "Page content generated!"
---
## Progress Tracking
@@ -539,6 +668,9 @@ The IGNY8 AI framework provides:
8. **Database Logging**: Automatic logging to AITaskLog
9. **Extensibility**: Easy to add new AI functions
10. **Reliability**: Retry logic and error recovery
11. **8 AI Functions**: Complete coverage from planning to publishing
12. **Site Builder Integration**: Specialized functions for site structure and page content
13. **Content Optimization**: AI-powered content optimization and scoring
This architecture ensures consistency, maintainability, and extensibility while providing a robust foundation for all AI operations in the IGNY8 platform.
This architecture ensures consistency, maintainability, and extensibility while providing a robust foundation for all AI operations in the IGNY8 platform, supporting 8 AI functions across the complete content workflow.