Implementation:ALwrity ALwrity PodcastService create project
| Knowledge Sources | |
|---|---|
| Domains | Podcast, Project_Management, Content_Generation |
| Last Updated | 2026-10-24 00:00 GMT |
Overview
Concrete tool for creating a podcast project with an embedded Podcast Bible, provided by the ALwrity podcast subsystem.
Description
The PodcastService.create_project method is stage 1 of the Podcast Creation Pipeline. It creates a PodcastProject database record (project_id, user_id, idea, duration, speakers, budget_cap, status, current_step) and, in full mode, generates a PodcastBible via PodcastBibleService.generate_bible. The Bible is embedded in the project as serialised data (host persona, audience DNA, brand DNA, visual style, audio environment, show rules). In podcast-only mode (ALWRITY_ENABLED_FEATURES=podcast), Bible generation is skipped so the project is created faster. The Bible is optional — if generation fails, the project is still created so the pipeline is fault-tolerant.
Usage
Import this service when:
- A user initiates a podcast project from an idea.
- A Podcast Bible must be generated and embedded in the project.
- The project must be persisted with draft status and create as the current step.
Code Reference
Source Location
- Repository: ALwrity
- File: backend/services/podcast_service.py (L24-59)
Signature
class PodcastService:
"""Service for managing podcast projects."""
def __init__(self, db: Session):
self.db = db
self.bible_service = PodcastBibleService()
def create_project(
self,
user_id: str,
project_id: str,
idea: str,
duration: int,
speakers: int,
budget_cap: float,
**kwargs,
) -> PodcastProject:
"""
Create a new podcast project with an optional embedded Podcast Bible.
Args:
user_id: Clerk user ID.
project_id: Unique project identifier.
idea: Podcast idea/keywords.
duration: Target episode duration (minutes).
speakers: Number of speakers.
budget_cap: Maximum budget.
**kwargs: Additional project fields.
Returns:
PodcastProject record with embedded Bible data (if generated).
"""
Import
from services.podcast_service import PodcastService
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| user_id | str | Yes | Clerk user ID |
| project_id | str | Yes | Unique project identifier |
| idea | str | Yes | Podcast idea/keywords |
| duration | int | Yes | Target episode duration (minutes) |
| speakers | int | Yes | Number of speakers |
| budget_cap | float | Yes | Maximum budget |
Outputs
| Name | Type | Description |
|---|---|---|
| return | PodcastProject | Persisted project with status='draft', current_step='create', embedded Bible |
| side effect | DB | PodcastProject row committed |
Usage Examples
Creating a podcast project
from services.podcast_service import PodcastService
service = PodcastService(db=db_session)
project = service.create_project(
user_id="clerk_user_123",
project_id="pod_001",
idea="The future of open-source AI",
duration=30,
speakers=2,
budget_cap=50.0,
)
print(f"Project {project.project_id}: {project.status}")
if project.bible:
print(f"Bible host: {project.bible['host_persona']['name']}")