podcast_llm.config

Configuration module for podcast generation.

This module provides configuration management for the podcast generation system through the PodcastConfig class. It handles loading and validating configuration from environment variables and YAML files, setting defaults, and providing a clean interface for accessing configuration values throughout the application.

The configuration covers all aspects of podcast generation including: - API credentials for various services (OpenAI, ElevenLabs, Google, etc.) - LLM provider settings for different use cases - Text-to-speech configuration and voice mappings - Output format and directory management - Rate limiting parameters - Podcast metadata and episode structure

Example

config = PodcastConfig.load(‘config.yaml’) print(config.podcast_name) print(config.tts_provider)

The module uses environment variables for sensitive values like API keys and a YAML file for general configuration settings. It provides smart defaults while allowing full customization of all parameters.

class podcast_llm.config.config.PodcastConfig(google_api_key: str, elevenlabs_api_key: str, openai_api_key: str, tavily_api_key: str, anthropic_api_key: str, fast_llm_provider: str, long_context_llm_provider: str, embeddings_model: str, tts_provider: str, tts_settings: Dict, output_format: str, temp_audio_dir: str, output_dir: str, rate_limits: Dict, checkpoint_dir: str, podcast_name: str, intro: str, outro: str, episode_structure: List)[source]

Bases: object

Configuration class for podcast generation.

Holds all configuration parameters needed for generating podcast content, including: - API keys for various services (OpenAI, ElevenLabs, etc.) - LLM provider settings for different use cases - Text-to-speech configuration - Output format and directory settings - Rate limiting parameters - Podcast metadata and structure

The configuration can be loaded from environment variables and an optional YAML file using the load() class method.

google_api_key

API key for Google services

Type:

str

elevenlabs_api_key

API key for ElevenLabs TTS

Type:

str

openai_api_key

API key for OpenAI services

Type:

str

tavily_api_key

API key for Tavily search

Type:

str

anthropic_api_key

API key for Anthropic services

Type:

str

fast_llm_provider

Provider to use for quick LLM operations

Type:

str

long_context_llm_provider

Provider to use for long context operations

Type:

str

tts_provider

Text-to-speech service provider

Type:

str

tts_settings

Configuration settings for TTS

Type:

Dict

output_format

Format for output audio files

Type:

str

temp_audio_dir

Directory for temporary audio files

Type:

str

output_dir

Directory for final output files

Type:

str

rate_limits

Rate limiting settings for API calls

Type:

Dict

checkpoint_dir

Directory for saving checkpoints

Type:

str

podcast_name

Name of the podcast

Type:

str

intro

Template for podcast intro

Type:

str

outro

Template for podcast outro

Type:

str

episode_structure

Structure template for podcast episodes

Type:

List

anthropic_api_key: str
checkpoint_dir: str
elevenlabs_api_key: str
embeddings_model: str
episode_structure: List
property episode_structure_for_prompt

Format the episode structure as a string for use in prompts.

Converts the episode_structure list into a newline-separated string with bullet points, suitable for inclusion in LLM prompts. Each section is prefixed with a hyphen for consistent formatting.

Returns:

Bullet-pointed string representation of the episode structure

Return type:

str

fast_llm_provider: str
google_api_key: str
intro: str
classmethod load(yaml_path: str | None = None) PodcastConfig[source]

Load configuration from .env and optional yaml file

Parameters:

yaml_path – Optional path to yaml config file

Returns:

Loaded configuration object

Return type:

PodcastConfig

long_context_llm_provider: str
openai_api_key: str
output_dir: str
output_format: str
outro: str
podcast_name: str
rate_limits: Dict
tavily_api_key: str
temp_audio_dir: str
tts_provider: str
tts_settings: Dict