Implement Sprint 4: Content Generation
- Add ArtifactService with generation methods for 9 content types
- Add POST /generate/audio - Generate podcast
- Add POST /generate/video - Generate video
- Add POST /generate/slide-deck - Generate slides
- Add POST /generate/infographic - Generate infographic
- Add POST /generate/quiz - Generate quiz
- Add POST /generate/flashcards - Generate flashcards
- Add POST /generate/report - Generate report
- Add POST /generate/mind-map - Generate mind map (instant)
- Add POST /generate/data-table - Generate data table
- Add GET /artifacts - List artifacts
- Add GET /artifacts/{id}/status - Check artifact status
Models:
- AudioGenerationRequest, VideoGenerationRequest
- QuizGenerationRequest, FlashcardsGenerationRequest
- SlideDeckGenerationRequest, InfographicGenerationRequest
- ReportGenerationRequest, DataTableGenerationRequest
- Artifact, GenerationResponse, ArtifactList
Tests:
- 13 unit tests for ArtifactService
- 6 integration tests for generation API
- 19/19 tests passing
Related: Sprint 4 - Content Generation
170 lines
4.6 KiB
Markdown
170 lines
4.6 KiB
Markdown
# Prompt Sprint 4 - Content Generation
|
|
|
|
## 🎯 Sprint 4: Content Generation
|
|
|
|
**Iniziato**: 2026-04-06
|
|
**Stato**: 🟡 In Progress
|
|
**Assegnato**: @sprint-lead
|
|
|
|
---
|
|
|
|
## 📋 Obiettivo
|
|
|
|
Implementare la generazione di contenuti multi-formato da parte di NotebookLM. Supportare audio (podcast), video, slide, infografiche, quiz, flashcard, report, mappe mentali e tabelle dati.
|
|
|
|
---
|
|
|
|
## 🏗️ Architettura
|
|
|
|
### Pattern (stesso di Sprint 1-3)
|
|
|
|
```
|
|
API Layer (FastAPI Routes)
|
|
↓
|
|
Service Layer (ArtifactService)
|
|
↓
|
|
External Layer (notebooklm-py client)
|
|
```
|
|
|
|
### Endpoints da implementare (9 totali)
|
|
|
|
1. **POST /api/v1/notebooks/{id}/generate/audio** - Generare podcast
|
|
2. **POST /api/v1/notebooks/{id}/generate/video** - Generare video
|
|
3. **POST /api/v1/notebooks/{id}/generate/slide-deck** - Generare slide
|
|
4. **POST /api/v1/notebooks/{id}/generate/infographic** - Generare infografica
|
|
5. **POST /api/v1/notebooks/{id}/generate/quiz** - Generare quiz
|
|
6. **POST /api/v1/notebooks/{id}/generate/flashcards** - Generare flashcard
|
|
7. **POST /api/v1/notebooks/{id}/generate/report** - Generare report
|
|
8. **POST /api/v1/notebooks/{id}/generate/mind-map** - Generare mappa mentale
|
|
9. **POST /api/v1/notebooks/{id}/generate/data-table** - Generare tabella
|
|
|
|
### Endpoints gestione artifacts
|
|
|
|
10. **GET /api/v1/notebooks/{id}/artifacts** - Listare artifacts
|
|
11. **GET /api/v1/artifacts/{id}/status** - Controllare stato
|
|
12. **GET /api/v1/artifacts/{id}/download** - Scaricare artifact
|
|
|
|
---
|
|
|
|
## 📊 Task Breakdown Sprint 4
|
|
|
|
### Fase 1: Specifiche
|
|
- [ ] SPEC-007: Analisi requisiti Content Generation
|
|
- [ ] Definire parametri per ogni tipo di contenuto
|
|
- [ ] Definire stati artifact (pending, processing, completed, failed)
|
|
|
|
### Fase 2: API Design
|
|
- [ ] API-006: Modelli Pydantic per ogni tipo di generazione
|
|
- [ ] Documentazione endpoints
|
|
|
|
### Fase 3: Implementazione
|
|
- [ ] DEV-015: ArtifactService
|
|
- [ ] DEV-016: Tutti gli endpoint POST /generate/*
|
|
- [ ] DEV-017: GET /artifacts
|
|
- [ ] DEV-018: GET /artifacts/{id}/status
|
|
|
|
### Fase 4: Testing
|
|
- [ ] TEST-008: Unit tests ArtifactService
|
|
- [ ] TEST-009: Integration tests generation API
|
|
|
|
---
|
|
|
|
## 🔧 Implementazione
|
|
|
|
### ArtifactService Methods
|
|
|
|
```python
|
|
class ArtifactService:
|
|
async def generate_audio(notebook_id, instructions, format, length, language)
|
|
async def generate_video(notebook_id, instructions, style, language)
|
|
async def generate_slide_deck(notebook_id, format, length)
|
|
async def generate_infographic(notebook_id, orientation, detail, style)
|
|
async def generate_quiz(notebook_id, difficulty, quantity)
|
|
async def generate_flashcards(notebook_id, difficulty, quantity)
|
|
async def generate_report(notebook_id, format)
|
|
async def generate_mind_map(notebook_id)
|
|
async def generate_data_table(notebook_id, description)
|
|
|
|
async def list_artifacts(notebook_id)
|
|
async def get_status(artifact_id)
|
|
async def download_artifact(artifact_id)
|
|
```
|
|
|
|
### Modelli
|
|
|
|
```python
|
|
# Request models
|
|
class AudioGenerationRequest(BaseModel):
|
|
instructions: str
|
|
format: str # deep-dive, brief, critique, debate
|
|
length: str # short, default, long
|
|
language: str
|
|
|
|
class VideoGenerationRequest(BaseModel):
|
|
instructions: str
|
|
style: str # whiteboard, classic, anime, etc.
|
|
language: str
|
|
|
|
class QuizGenerationRequest(BaseModel):
|
|
difficulty: str # easy, medium, hard
|
|
quantity: str # fewer, standard, more
|
|
|
|
# Response models
|
|
class Artifact(BaseModel):
|
|
id: UUID
|
|
notebook_id: UUID
|
|
type: str # audio, video, quiz, etc.
|
|
title: str
|
|
status: str # pending, processing, completed, failed
|
|
created_at: datetime
|
|
completed_at: datetime | None
|
|
download_url: str | None
|
|
```
|
|
|
|
---
|
|
|
|
## 🎨 Content Types
|
|
|
|
### Audio (Podcast)
|
|
- Formats: deep-dive, brief, critique, debate
|
|
- Length: short, default, long
|
|
- Languages: en, it, es, fr, de
|
|
|
|
### Video
|
|
- Styles: whiteboard, classic, anime, kawaii, watercolor, etc.
|
|
- Languages: multi-language support
|
|
|
|
### Slide Deck
|
|
- Formats: detailed, presenter
|
|
- Length: default, short
|
|
|
|
### Infographic
|
|
- Orientation: landscape, portrait, square
|
|
- Detail: concise, standard, detailed
|
|
- Styles: professional, editorial, scientific, etc.
|
|
|
|
### Quiz / Flashcards
|
|
- Difficulty: easy, medium, hard
|
|
- Quantity: fewer, standard, more
|
|
|
|
### Mind Map
|
|
- Instant generation (no async)
|
|
|
|
### Data Table
|
|
- Custom description for data extraction
|
|
|
|
---
|
|
|
|
## 🚀 Prossimi Passi
|
|
|
|
1. @sprint-lead: Attivare @api-designer per API-006
|
|
2. @api-designer: Definire tutti i modelli generation
|
|
3. @tdd-developer: Iniziare implementazione ArtifactService
|
|
|
|
---
|
|
|
|
**Dipende da**: Sprint 3 (Chat) ✅
|
|
**Blocca**: Sprint 5 (Webhooks) 🔴
|
|
|
|
**Nota**: Questo è lo sprint più complesso con 12 endpoint da implementare!
|