### Launch Web Interface Source: https://github.com/lfnovo/podcast-creator/blob/main/CLAUDE.md Start the web interface by running `uv run podcast-creator ui`. This requires the UI to be installed. ```bash uv run podcast-creator ui ``` -------------------------------- ### Install and Launch Podcast Creator UI Source: https://github.com/lfnovo/podcast-creator/blob/main/src/podcast_creator/resources/streamlit_app/README.md Install the podcast-creator library and launch the Streamlit web interface using the CLI. This command handles all necessary setup automatically. ```bash pip install podcast-creator ``` ```bash podcast-creator ui ``` ```bash podcast-creator ui --port 8080 --host 0.0.0.0 ``` -------------------------------- ### Advanced Configuration Setup Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Demonstrates the import of `configure` and `create_podcast` for advanced setup options. ```python from podcast_creator import configure, create_podcast ``` -------------------------------- ### Install Podcast Creator Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Install the library using uv or pip. Use the '[ui]' extra for the web interface. Installation from source is also supported. ```bash # Library only (programmatic use) uv add podcast-creator # or pip install podcast-creator # Full installation with web UI uv add podcast-creator --extra ui # or pip install podcast-creator[ui] # Or install from source git clone cd podcast-creator uv sync # Don't have uv? Install it with: # curl -LsSf https://astral.sh/uv/install.sh | sh # or # pip install uv ``` -------------------------------- ### Install Podcast Creator Source: https://context7.com/lfnovo/podcast-creator/llms.txt Install the library using pip. Choose the base package or include the Streamlit UI. Installation from source is also supported. ```bash # Library only pip install podcast-creator # With Streamlit web UI pip install podcast-creator[ui] # From source git clone https://github.com/lfnovo/podcast-creator cd podcast-creator uv sync ``` -------------------------------- ### Install Project for Development Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Clone the repository and install the project in editable mode using uv. This command installs the package and all its dependencies. ```bash git clone cd podcast-creator # Install with uv (recommended) uv sync # This installs the package in editable mode # along with all dependencies ``` -------------------------------- ### Set Up Environment Variables Source: https://github.com/lfnovo/podcast-creator/blob/main/CONTRIBUTING.md Copy the example environment file and edit it to add your API keys. This is necessary for the application to function correctly with external services. ```bash cp .env.example .env # Edit .env and add your API keys ``` -------------------------------- ### Install content-core Library Source: https://github.com/lfnovo/podcast-creator/blob/main/src/podcast_creator/resources/streamlit_app/README.md Use this command to install the 'content-core' library if it's not available. Alternatively, direct text input can be used. ```bash uv add content-core ``` -------------------------------- ### Install for Development Source: https://github.com/lfnovo/podcast-creator/blob/main/CLAUDE.md Install the project in editable mode for development using `uv pip install -e .`. ```bash uv pip install -e . ``` -------------------------------- ### Install Dependencies with uv Source: https://github.com/lfnovo/podcast-creator/blob/main/CLAUDE.md Use `uv sync` to install project dependencies. This is the preferred method for managing packages. ```bash uv sync ``` -------------------------------- ### Configure API Keys Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Copy the example environment file and edit it to add your OpenAI and ElevenLabs API keys, along with any other necessary provider keys. ```bash # Copy the example environment file cp .env.example .env # Edit .env and add your API keys: # - OpenAI API key for LLM models # - ElevenLabs API key for high-quality TTS # - Other provider keys as needed ``` -------------------------------- ### Custom Paths Configuration Example Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Shows how to configure custom paths for prompts using the `configure` function. ```python configure("prompts_dir", "/path/to/templates") ``` -------------------------------- ### Show Version CLI Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Command to display the installed version of the podcast-creator. ```bash # Show version podcast-creator version ``` -------------------------------- ### Install Dependencies with pip Source: https://github.com/lfnovo/podcast-creator/blob/main/CONTRIBUTING.md Alternatively, install dependencies using pip. This involves creating a virtual environment, activating it, and then installing the project with development and UI extras. ```bash python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -e ".[dev,ui]" ``` -------------------------------- ### Launch Podcast Creator UI Source: https://context7.com/lfnovo/podcast-creator/llms.txt Start the Streamlit web UI with `podcast-creator ui`. Customization options include specifying the host and port, and skipping dependency checks. ```bash # Launch the Streamlit web UI (requires pip install podcast-creator[ui]) podcast-creator ui # Custom host and port podcast-creator ui --port 8080 --host 0.0.0.0 # Skip dependency check when launching UI podcast-creator ui --skip-init-check ``` -------------------------------- ### Install langchain_ollama Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/using_ollama.ipynb Install the `langchain_ollama` library using pip. This is the first step to enable Ollama integration. ```bash # pip install langchain_ollama ``` -------------------------------- ### Create Podcast with Detailed Parameters Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/verbose_config.ipynb Initiate podcast creation using the `create_podcast` function with a detailed briefing and specific parameters for episode name, output directory, speaker configuration, and model providers for outline and transcript generation. This example shows how to specify the number of segments for the podcast. ```python briefing = "" Create an exciting podcast on the topic of \"Large Diffusion Models\" " result = await create_podcast( content=None, briefing=briefing, episode_name="teach_me_now", output_dir="output/teach_me_now", speaker_config="solo_expert", outline_provider="perplexity", outline_model="sonar-pro", transcript_provider="perplexity", transcript_model="sonar-pro", num_segments=4 ) ``` -------------------------------- ### User Configuration Priority Example Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Illustrates how to set user configuration for templates using the `configure` function, which has the highest priority. ```python configure("templates", {"outline": "...", "transcript": "..."}) ``` -------------------------------- ### Pytest Example: Create Podcast with Episode Profile Source: https://github.com/lfnovo/podcast-creator/blob/main/CONTRIBUTING.md An example test function using pytest to verify the `create_podcast` function works correctly when provided with an episode profile. It includes Arrange, Act, and Assert steps. ```python def test_create_podcast_with_episode_profile(): """Test that create_podcast works correctly with episode profiles.""" # Arrange content = "Test content" # Act result = await create_podcast( content=content, episode_profile="tech_discussion" ) # Assert assert result is not None assert "final_output_file_path" in result ``` -------------------------------- ### Clone Repository Source: https://github.com/lfnovo/podcast-creator/blob/main/CONTRIBUTING.md Clone your forked repository to start development. Navigate into the cloned directory. ```bash git clone https://github.com/YOUR-USERNAME/podcast-creator.git cd podcast-creator ``` -------------------------------- ### Manual Installation Dependencies Source: https://github.com/lfnovo/podcast-creator/blob/main/src/podcast_creator/resources/streamlit_app/README.md Install the required dependencies manually for development purposes before running the Streamlit app. ```bash uv add streamlit pydub requests content-core ``` -------------------------------- ### Run Tests with make Source: https://github.com/lfnovo/podcast-creator/blob/main/CONTRIBUTING.md An alternative method to run tests using the make command. Ensure you have make installed and configured. ```bash make test ``` -------------------------------- ### Display Podcast Creator Version Source: https://context7.com/lfnovo/podcast-creator/llms.txt Check the installed version of the podcast-creator package using the `podcast-creator version` command. ```bash podcast-creator version ``` -------------------------------- ### Example Output Directory Structure Source: https://context7.com/lfnovo/podcast-creator/llms.txt This structure shows the typical output files generated for each episode, including the outline, transcript, individual audio clips, and the final combined podcast audio. ```text output/episode_name/ ├── outline.json # Structured outline (Outline model serialized) ├── transcript.json # Full dialogue list [{"speaker": "...", "dialogue": "..."}] ├── clips/ │ ├── 0000.mp3 # First dialogue line │ ├── 0001.mp3 │ └── ... # One file per Dialogue entry └── audio/ └── episode_name.mp3 # Final combined podcast ``` -------------------------------- ### Get Podcast Creator Configuration Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Retrieve a configuration value using its key. A default value can be provided if the key is not found. ```python value = get_config("key", default_value) ``` -------------------------------- ### Import JSON and Path for File-Based Configuration Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/episode_profiles.ipynb Imports the necessary libraries, `json` and `pathlib.Path`, for handling file-based episode configurations. This is a setup step for storing profiles in JSON files. ```python import json from pathlib import Path ``` -------------------------------- ### Extract Content from URL and Create Podcast Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/extracting_from_files_and_urls.ipynb Use the content-core library to extract content from a URL and then create a podcast using the podcast-creator library. This example shows how to specify various parameters for podcast generation, including speaker configuration and AI models. ```python from podcast_creator.graph import create_podcast from content_core import extract_content # use the content core library to extract content from a URL # You can also use file_path for many types of files # For example, to extract content from a PDF file, you can use: # content = await extract_content(file_path="path/to/your/file.pdf") content = await extract_content(dict(url="https://situational-awareness.ai/wp-content/uploads/2024/06/situationalawareness.pdf")) briefing = """ Create an exciting podcast on the topic of situational awareness. """ # Test with 2-speaker setup result = await create_podcast( content=content, briefing=briefing, episode_name="diverse_panel", output_dir="output/diverse_panel", speaker_config="diverse_panel", outline_provider="openai", outline_model="gpt-4o-mini", transcript_provider="anthropic", transcript_model="claude-3-5-sonnet-latest", num_segments=7 ) ``` -------------------------------- ### Invoke Podcast Graph Directly Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/use_graph_directly.ipynb Use `podcast_graph.ainvoke` to run the podcast generation process. Provide an initial `PodcastState` and a configuration dictionary. Ensure necessary imports and setup are done beforehand. ```python from podcast_creator import podcast_graph, load_speaker_config, PodcastState from pathlib import Path import json briefing = """ Create an exciting podcast on the topic of "Large Diffusion Models" """ # Load speaker profile speaker_profile = load_speaker_config("solo_expert") # Create output directory output_path = Path("output/teach_me_now") output_path.mkdir(exist_ok=True, parents=True) # Create initial state initial_state = PodcastState( content=None, briefing=briefing, num_segments=4, outline=None, transcript=[], audio_clips=[], final_output_file_path=None, output_dir=output_path, episode_name="teach_me_now2", speaker_profile=speaker_profile, ) # Create configuration config = { "configurable": { "outline_provider": "perplexity", "outline_model": "sonar-pro", "transcript_provider": "perplexity", "transcript_model": "sonar-pro", } } # Create and run the graph result = await podcast_graph.ainvoke(initial_state, config=config) ``` -------------------------------- ### Python Function with Docstring and Type Hints Source: https://github.com/lfnovo/podcast-creator/blob/main/CONTRIBUTING.md An example of a Python asynchronous function demonstrating good practices: clear type hints, a comprehensive docstring including Args, Returns, and Raises sections, and adherence to PEP 8. ```python async def generate_podcast_outline( content: str, briefing: str, num_segments: int = 4 ) -> Outline: """Generate a structured outline for a podcast episode. Args: content: The source content to base the podcast on briefing: Instructions for how to approach the content num_segments: Number of segments to create Returns: Outline object containing structured segments Raises: ValueError: If content is empty or num_segments < 1 """ # Implementation here ``` -------------------------------- ### Initialize Templates and Configs Source: https://github.com/lfnovo/podcast-creator/blob/main/CLAUDE.md Initialize project templates and configurations with `uv run podcast-creator init`. ```bash uv run podcast-creator init ``` -------------------------------- ### Initialize Podcast Creator Project Source: https://context7.com/lfnovo/podcast-creator/llms.txt Use the `podcast-creator init` command to set up project templates and configuration files. The `--force` flag can be used to overwrite existing files. ```bash # Initialize project templates and config files in current directory podcast-creator init # Initialize in a specific directory, overwriting existing files podcast-creator init --output-dir /path/to/project --force ``` -------------------------------- ### Initialize Podcast Creator Project Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Initialize your project to create template and configuration files, including Jinja templates for prompts, speaker configurations, and episode configurations. ```bash # Create templates and configuration files podcast-creator init # This creates: # - prompts/podcast/outline.jinja # - prompts/podcast/transcript.jinja # - speakers_config.json # - episodes_config.json # - example_usage.py ``` -------------------------------- ### Initialize Project CLI Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Commands for initializing a new podcast project. Options include specifying an output directory or forcing overwrites of existing files. ```bash # Initialize project with templates podcast-creator init # Initialize in specific directory podcast-creator init --output-dir /path/to/project # Overwrite existing files podcast-creator init --force ``` -------------------------------- ### Classic Configuration for Podcast Creation Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Create a podcast using classic configuration parameters such as content, briefing, episode name, output directory, and speaker configuration. ```python import asyncio from podcast_creator import create_podcast async def main(): result = await create_podcast( content="AI has transformed many industries...", briefing="Create an informative discussion about AI impact", episode_name="ai_impact", output_dir="output/ai_impact", speaker_config="ai_researchers" ) asyncio.run(main()) ``` -------------------------------- ### Example Conventional Commit Titles Source: https://github.com/lfnovo/podcast-creator/blob/main/CONTRIBUTING.md Examples of conventional commit titles for pull requests, illustrating different types like feature, fix, and documentation changes. ```markdown - `feat:` - New feature - `fix:` - Bug fix - `docs:` - Documentation only changes - `style:` - Code style changes (formatting, etc) - `refactor:` - Code changes that neither fix bugs nor add features - `perf:` - Performance improvements - `test:` - Adding or updating tests - `chore:` - Maintenance tasks Examples: - `feat: add support for Anthropic Claude models` - `fix: resolve audio synchronization issue in long podcasts` - `docs: improve episode profile documentation` ``` -------------------------------- ### Configure Podcast Creator with Verbose Settings Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/verbose_config.ipynb Use the `configure` function with detailed parameters to set up the podcast creator. This is useful for fine-grained control over the creation process. ```python from podcast_creator import configure configure( verbose=True, log_level="DEBUG", output_dir="./podcast_output", temp_dir="./podcast_temp", max_parallel_jobs=4, retry_attempts=3, timeout_seconds=60, user_agent="MyPodcastCreator/1.0", api_key="YOUR_API_KEY", model_name="gpt-4", embedding_model="text-embedding-ada-002", chunk_size=1000, chunk_overlap=200, temperature=0.7, max_tokens=150, prompt_template="You are a helpful assistant.", output_format="json", save_intermediate_files=True, enable_caching=False, force_rerun=False, skip_existing=True, debug_mode=True, dry_run=False, custom_config_path="./custom_config.yaml" ) ``` -------------------------------- ### CLI Integration for Episode Profiles Initialization Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/episode_profiles.ipynb Demonstrates how to initialize a new podcast project using the CLI, which automatically sets up the necessary files for episode profiles, including `episodes_config.json`. ```bash podcast-creator init # This will now create: # - prompts/podcast/outline.jinja # - prompts/podcast/transcript.jinja # - speakers_config.json # - episodes_config.json ← New! # - example_usage.py ``` -------------------------------- ### Compare Old vs. New Podcast Creation Methods Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/episode_profiles.ipynb Illustrates the reduction in parameters when using episode profiles compared to the older method of specifying all configurations inline. This highlights the benefits of reusability and conciseness. ```python # 📚 OLD WAY (still works for backward compatibility) old_way_example = """ result = await create_podcast( content="Your content here...", briefing="Create an engaging and informative discussion about technology topics. Focus on making complex concepts accessible while maintaining technical accuracy. Include diverse perspectives and practical implications.", episode_name="my_podcast", output_dir="output/my_podcast", speaker_config="ai_researchers", outline_provider="openai", outline_model="gpt-4o-mini", transcript_provider="anthropic", transcript_model="claude-3-5-sonnet-latest", num_segments=4 ) """ # 🚀 NEW WAY (with episode profiles) new_way_example = """ result = await create_podcast( content="Your content here...", episode_profile="tech_discussion", episode_name="my_podcast", output_dir="output/my_podcast" ) """ print("📚 OLD WAY (12 parameters):") print(old_way_example) print("\n🚀 NEW WAY (4 parameters):") print(new_way_example) print("\n✨ Benefits:") print(" • 67% fewer parameters to specify") print(" • Consistent, reusable configurations") print(" • Easier to share and version control") print(" • Still fully customizable when needed") ``` -------------------------------- ### Launch Web Interface CLI Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Commands to launch the podcast-creator web interface. Options include specifying a custom port and host, or skipping the initial dependency check. ```bash # Launch web interface (requires UI installation) podcast-creator ui # Launch on custom port/host podcast-creator ui --port 8080 --host 0.0.0.0 # Skip dependency check podcast-creator ui --skip-init-check ``` -------------------------------- ### Import Podcast Creator Functions Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Import necessary functions for podcast creation and configuration. This includes `configure`, `get_config`, and `create_podcast`. ```python from podcast_creator import configure, get_config, create_podcast ``` -------------------------------- ### Create Podcast with Full Configuration Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Generate a podcast using full configuration options, including content, a custom briefing, episode name, output directory, and speaker configuration. ```python import asyncio from podcast_creator import create_podcast async def main(): result = await create_podcast( content="Your content here...", briefing="Create an engaging discussion about...", episode_name="my_podcast", output_dir="output/my_podcast", speaker_config="ai_researchers" ) print(f"✅ Podcast created: {result['final_output_file_path']}") asyncio.run(main()) ``` -------------------------------- ### Configure Podcast Creation Settings Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/verbose_config.ipynb Set up the configuration for podcast creation, including templates and speaker profiles. This is typically done once at the beginning of a script. ```python configure({"templates": {"outline": OUTLINE_TEMPLATE, "transcript": TRANSCRIPT_TEMPLATE}, "speakers_config": PROFILES}) ``` -------------------------------- ### Get Configuration Value Source: https://context7.com/lfnovo/podcast-creator/llms.txt Retrieve a configuration value by its key, with an optional default value if the key is not found. Useful for accessing settings like output directories or loaded configurations. ```python from podcast_creator import get_config output_dir = get_config("output_dir", "./output") # => "./podcasts" (if set above, otherwise "./output") speakers = get_config("speakers_config") # => dict or None ``` -------------------------------- ### Configure and Use File-Based Episode Profiles Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/episode_profiles.ipynb Configure the system to use a specific episode configuration file and then create a podcast using a profile defined within that file. This simplifies the `create_podcast` call by reducing the number of parameters. ```python # Configure to use the file-based episode profiles configure("episode_config", "my_episodes_config.json") async def create_file_based_episode(): """Create a podcast using file-based episode configuration""" content = """ The recent breakthrough in room-temperature superconductors has sent shockwaves through the scientific community. If verified, this discovery could revolutionize energy transmission, magnetic levitation transport, and quantum computing. However, the scientific community remains cautiously optimistic, emphasizing the need for peer review and replication of results. """ try: result = await create_podcast( content=content, episode_profile="news_analysis", # 📰 Use file-based profile episode_name="superconductor_news", output_dir="output/superconductor_news" ) print("✅ File-based episode profile podcast created!") print(f"📁 Output: {result['final_output_file_path']}") except Exception as e: print(f"❌ Error: {e}") # await create_file_based_episode() print("💡 Uncomment the line above to run this example") ``` -------------------------------- ### Create Podcast with Briefing Suffix Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/episode_profiles.ipynb Creates a podcast using a specified episode profile and appends custom instructions to the default briefing. Requires the 'podcast_creator' library and an async execution environment. Prints success or error messages. ```python async def create_episode_with_suffix(): """Create a podcast with a briefing suffix""" content = """ Cloud computing has revolutionized how businesses operate, offering scalable infrastructure and services on-demand. Major cloud providers like AWS, Azure, and Google Cloud have created vast ecosystems of tools and services that enable rapid application development and deployment. """ try: result = await create_podcast( content=content, episode_profile="business_analysis", briefing_suffix="Focus specifically on cost optimization strategies and ROI metrics", episode_name="cloud_economics", output_dir="output/cloud_economics" ) print("✅ Podcast with custom briefing suffix created!") print(f"📁 Output: {result['final_output_file_path']}") except Exception as e: print(f"❌ Error: {e}") # await create_episode_with_suffix() print("💡 Uncomment the line above to run this example") ``` -------------------------------- ### Test CLI Application Source: https://github.com/lfnovo/podcast-creator/blob/main/CONTRIBUTING.md Verify the command-line interface of the podcast-creator application. Use the --help flag to see available commands and options. ```bash uv run podcast-creator --help ``` -------------------------------- ### SpeakerProfile / Speaker / SpeakerConfig — Speaker Data Models Source: https://context7.com/lfnovo/podcast-creator/llms.txt Pydantic models for validating and managing speaker definitions. `SpeakerProfile` holds 1–4 `Speaker` objects with a shared TTS provider; individual speakers can override `tts_provider`, `tts_model`, and `tts_config` for mixed-provider setups. ```APIDOC ## `SpeakerProfile` / `Speaker` / `SpeakerConfig` — Speaker Data Models Pydantic models for validating and managing speaker definitions. `SpeakerProfile` holds 1–4 `Speaker` objects with a shared TTS provider; individual speakers can override `tts_provider`, `tts_model`, and `tts_config` for mixed-provider setups. ```python from podcast_creator import Speaker, SpeakerProfile, SpeakerConfig # Build a mixed-provider profile programmatically profile = SpeakerProfile( tts_provider="openai", # default provider tts_model="tts-1", speakers=[ Speaker( name="Dr. Evelyn Reed", voice_id="premium_voice_abc123", backstory="Computational neuroscientist, MIT PhD.", personality="Deeply technical, loves analogies", tts_provider="elevenlabs", # override: this speaker uses ElevenLabs tts_model="eleven_flash_v2_5", tts_config={"voice_settings": {"stability": 0.8, "similarity_boost": 0.9}}, ), Speaker( name="Jordan Miles", voice_id="alloy", # uses profile-level OpenAI TTS backstory="Science communicator and YouTuber.", personality="Enthusiastic, audience-first explanations", ), ], ) # Validate a full config file structure config = SpeakerConfig(profiles={"my_profile": profile}) print(config.list_profiles()) # => ['my_profile'] retrieved = config.get_profile("my_profile") # Load directly from JSON file from podcast_creator import SpeakerConfig from pathlib import Path speaker_config = SpeakerConfig.load_from_file(Path("./speakers_config.json")) panel = speaker_config.get_profile("diverse_panel") print(len(panel.speakers)) # => 4 ``` ``` -------------------------------- ### configure Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Sets configuration values for the podcast creator. Can accept a single key-value pair or a dictionary of settings. ```APIDOC ## configure ### Description Sets configuration values for the podcast creator. This function can be used to set individual configuration options or multiple options at once by passing a dictionary. ### Method `configure(key, value)` or `configure(config_dict)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **key** (str) - The configuration key to set. - **value** (any) - The value for the configuration key. - **config_dict** (dict) - A dictionary where keys are configuration options and values are their corresponding settings. ### Request Example ```python configure("output_dir", "./my_podcasts") configure({ "prompts_dir": "./templates", "speakers_config": "./speakers.json" }) ``` ### Response None ``` -------------------------------- ### Create Podcast with Simple Episode Profile Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/episode_profiles.ipynb Creates a podcast using only the content and a specified episode profile name. Requires the 'podcast_creator' library and an async execution environment. Prints success or error messages. ```python from podcast_creator import create_podcast async def create_simple_episode(): """Create a podcast using just an episode profile""" content = """ Artificial Intelligence has rapidly evolved from a theoretical concept to a practical reality that's transforming industries worldwide. Machine learning algorithms now power everything from recommendation systems to autonomous vehicles. Recent breakthroughs in large language models have demonstrated unprecedented capabilities in natural language understanding and generation, opening new possibilities for human-AI collaboration. The democratization of AI tools has enabled small businesses and individual creators to leverage powerful AI capabilities without requiring extensive technical expertise. However, this rapid adoption also raises important questions about ethics, job displacement, and the need for responsible AI development. """ try: result = await create_podcast( content=content, episode_profile="tech_discussion", # 🎯 This is all you need! episode_name="ai_revolution", output_dir="output/ai_revolution" ) print("✅ Podcast created successfully!") print(f"📁 Output: {result['final_output_file_path']}") print(f"🎵 Audio clips: {result['audio_clips_count']}") except Exception as e: print(f"❌ Error: {e}") # Run the example # await create_simple_episode() print("💡 Uncomment the line above to run this example") ``` -------------------------------- ### Create Podcast with Custom Configuration Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/set_config.ipynb Use `create_podcast` to generate a podcast episode. Configure prompts and speaker settings using the `configure` function before calling `create_podcast`. ```python from podcast_creator import configure, create_podcast briefing = """ Create an exciting podcast on the topic of "Large Diffusion Models" """ result = await create_podcast( content=None, briefing=briefing, episode_name="teach_me_now", output_dir="output/teach_me_now", speaker_config="solo_expert", outline_provider="perplexity", outline_model="sonar-pro", transcript_provider="perplexity", transcript_model="sonar-pro", num_segments=4 ) # Set configuration configure({"prompts_dir": "podcast_stuff/prompts", "speakers_config": "podcast_stuff/speakers_config.json"}) ``` -------------------------------- ### Create Podcast with Custom Episode Profile Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/episode_profiles.ipynb Generate a podcast using a previously configured custom episode profile. This snippet demonstrates using the 'my_startup_pitch' profile. ```python async def create_custom_episode(): """Create a podcast using a custom episode profile""" content = """ Our startup, EcoTrack, is revolutionizing sustainability monitoring for businesses. Using AI-powered sensors and analytics, we help companies track their environmental impact in real-time and optimize their operations for maximum efficiency and minimum waste. Our solution has already helped 50+ companies reduce their carbon footprint by an average of 30% while saving $2M in operational costs. """ try: result = await create_podcast( content=content, episode_profile="my_startup_pitch", # 🚀 Use custom profile episode_name="ecotrack_pitch", output_dir="output/ecotrack_pitch" ) print("✅ Custom episode profile podcast created!") print(f"📁 Output: {result['final_output_file_path']}") except Exception as e: print(f"❌ Error: {e}") # await create_custom_episode() print("💡 Uncomment the line above to run this example") ``` -------------------------------- ### create_podcast() — Generate a Podcast Source: https://context7.com/lfnovo/podcast-creator/llms.txt The primary async entry point for generating a podcast. It accepts source content and configuration parameters, runs the full LangGraph pipeline, and returns a result dictionary containing paths to generated files and data structures. ```APIDOC ## create_podcast() ### Description The primary async entry point. Accepts source content and configuration parameters, runs the full LangGraph pipeline (outline → transcript → audio generation → combination), writes `outline.json` and `transcript.json` to the output directory, and returns a result dict. ### Method `async def create_podcast(...)` ### Parameters #### Content - **content** (list[str] | str) - Required - The source material for the podcast. Can be plain text, file paths, or URLs. #### Episode Configuration - **episode_profile** (str) - Optional - Name of a pre-defined episode profile to use, simplifying configuration. - **briefing_suffix** (str) - Optional - A suffix to append to the briefing, influencing content generation. - **episode_name** (str) - Optional - The desired name for the podcast episode. - **output_dir** (str) - Optional - The directory where generated files will be saved. - **language** (str) - Optional - The language for the podcast, specified using ISO 639-1 or BCP 47 codes (e.g., "en-US", "pt-BR"). #### Generation Parameters - **num_segments** (int) - Optional - The number of segments to divide the podcast into. #### AI Provider Configuration - **outline_provider** (str) - Optional - The AI provider to use for generating the episode outline (e.g., "openai", "anthropic"). - **outline_model** (str) - Optional - The specific model to use for outline generation. - **transcript_provider** (str) - Optional - The AI provider to use for generating the podcast transcript. - **transcript_model** (str) - Optional - The specific model to use for transcript generation. #### Speaker Configuration - **speaker_config** (str) - Optional - The name of a speaker profile to use. #### Retry Configuration - **retry_max_attempts** (int) - Optional - Maximum number of retry attempts for transient failures. - **retry_wait_multiplier** (int) - Optional - Multiplier for exponential backoff wait times between retries. #### LLM Configuration - **outline_config** (dict) - Optional - Additional configuration parameters for the outline generation LLM. - **transcript_config** (dict) - Optional - Additional configuration parameters for the transcript generation LLM. ### Return Value - **final_output_file_path** (`Path`) - Absolute path to the combined MP3 file. - **outline** (`Outline`) - A structured representation of the episode outline. - **transcript** (`list[Dialogue]`) - A list of dialogue objects representing the podcast script. - **audio_clips_count** (`int`) - The total number of individual audio clips generated. - **output_dir** (`Path`) - The path to the output directory. ### Request Example ```python import asyncio from podcast_creator import create_podcast async def main(): # --- Option A: Episode Profile (recommended) --- result = await create_podcast( content=[ "The transformer architecture revolutionized NLP in 2017...", "https://arxiv.org/abs/1706.03762", # URLs are also accepted ], episode_profile="tech_discussion", # uses bundled profile defaults briefing_suffix="Focus on practical applications in 2024", episode_name="transformers_deep_dive", output_dir="output/transformers", language="pt-BR", # generate in Brazilian Portuguese retry_max_attempts=5, retry_wait_multiplier=3, ) # --- Option B: Full manual configuration --- result = await create_podcast( content="Quantum computing uses qubits instead of bits...", briefing="Create an accessible introduction to quantum computing for software engineers", episode_name="quantum_intro", output_dir="output/quantum", speaker_config="ai_researchers", # name of speaker profile outline_provider="openai", outline_model="gpt-4o-mini", transcript_provider="anthropic", transcript_model="claude-3-5-sonnet-latest", num_segments=4, outline_config={"temperature": 0.3}, transcript_config={"temperature": 0.7}, ) print(result["final_output_file_path"]) # => PosixPath('output/quantum/audio/quantum_intro.mp3') print(result["audio_clips_count"]) print(result["outline"]) print(result["transcript"]) asyncio.run(main()) ``` ``` -------------------------------- ### Launch Podcast Creator Web Interface Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Launch the Streamlit web interface for visual management of profiles, content generation, and episode playback. You can specify a custom port and host. ```bash # Launch the Streamlit web interface podcast-creator ui # Custom port/host podcast-creator ui --port 8080 --host 0.0.0.0 # The UI provides: # - Visual profile management # - Multi-content podcast generation # - Episode library with playback # - Import/export functionality ``` -------------------------------- ### Simple Episode Profile Usage Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Demonstrates the basic usage of an episode profile for podcast creation, requiring only content, profile name, episode name, and output directory. ```python # 1. Simple profile usage result = await create_podcast( content="Your content...", episode_profile="tech_discussion", episode_name="my_podcast", output_dir="output/my_podcast" ) ``` -------------------------------- ### Configure Podcast Creator Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Set configuration options for the podcast creator. This can be done by providing a key-value pair or a dictionary of multiple configurations. ```python configure(key, value) configure({"key1": "value1", "key2": "value2"}) ``` -------------------------------- ### Create Podcast with Briefing Suffix Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Use the `create_podcast` function with a specific episode profile and a custom briefing suffix to tailor the podcast's focus. ```python result = await create_podcast( content="Your content...", episode_profile="business_analysis", briefing_suffix="Focus on ROI and cost optimization", episode_name="my_podcast", output_dir="output/my_podcast" ) ``` -------------------------------- ### Run Project Tests Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Execute various tests for the podcast-creator package, including import checks, CLI commands, UI testing, and project initialization. ```bash # Test the package python -c "from podcast_creator import create_podcast; print('Import successful')" # Test CLI podcast-creator --help # Test web interface podcast-creator ui # Test initialization mkdir test_project cd test_project podcast-creator init python example_usage.py ``` -------------------------------- ### Create Version Tag Source: https://github.com/lfnovo/podcast-creator/blob/main/CLAUDE.md Use the `make tag` command to create a version tag for the project. ```bash make tag ``` -------------------------------- ### Create Podcast with Episode Profile Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Generate a podcast using a pre-configured episode profile for streamlined creation. This requires minimal parameters, specifying content, profile name, episode name, and output directory. ```python import asyncio from podcast_creator import create_podcast async def main(): # One-liner podcast creation with episode profiles! result = await create_podcast( content="Your content here...", episode_profile="tech_discussion", # 🎯 Pre-configured settings episode_name="my_podcast", output_dir="output/my_podcast" ) print(f"✅ Podcast created: {result['final_output_file_path']}") asyncio.run(main()) ``` -------------------------------- ### configure() — Global Configuration Source: https://context7.com/lfnovo/podcast-creator/llms.txt Sets library-wide configuration parameters. Accepts a single key/value pair or a dictionary of settings. Changes are applied immediately and persist for the duration of the process. Configuration is validated against `PodcastConfig`. ```APIDOC ## configure() ### Description Sets library-wide configuration. Accepts a single key/value pair or a dict. Changes are applied immediately and persist for the process lifetime (singleton). Validated against `PodcastConfig` on write. ### Method `def configure(key: str, value: Any) | def configure(settings: dict[str, Any])` ### Parameters - **key** (str) - The configuration key to set. - **value** (Any) - The value for the configuration key. - **settings** (dict[str, Any]) - A dictionary of configuration key-value pairs to set. ### Usage Examples 1. **Set a custom prompts directory (Jinja2 templates):** ```python from podcast_creator import configure configure("prompts_dir", "./my_templates") ``` 2. **Set inline templates directly:** ```python from podcast_creator import configure configure("templates", { "outline": "Create a {{ num_segments }}-part podcast outline about: {{ briefing }} Content: {{ context }} Speakers: {% for s in speakers %}{{ s.name }}: {{ s.personality }}{% endfor %} Output JSON: {\"segments\": [{\"name\": \"...\", \"description\": \"...\", \"size\": \"medium\"}]}", "transcript": "Generate dialogue for segment: {{ segment.name }} ({{ turns }} turns). Speakers: {% for s in speakers %}{{ s.name }}{% endfor %} Output JSON: {\"transcript\": [{\"speaker\": \"...\", \"dialogue\": \"...\"}]}", }) ``` ``` -------------------------------- ### Configure Global Settings with configure() Source: https://context7.com/lfnovo/podcast-creator/llms.txt Set library-wide configuration parameters. Changes persist for the process lifetime. Accepts key/value pairs or a dictionary for settings like custom prompt directories or inline templates. ```python from podcast_creator import configure # 1. Set a custom prompts directory (Jinja2 templates) configure("prompts_dir", "./my_templates") # 2. Set inline templates directly configure("templates", { "outline": """ Create a {{ num_segments }}-part podcast outline about: {{ briefing }} Content: {{ context }} Speakers: {% for s in speakers %}{{ s.name }}: {{ s.personality }}{% endfor %} Output JSON: {"segments": [{"name": "...", "description": "...", "size": "medium"}]} """, "transcript": """ Generate dialogue for segment: {{ segment.name }} ({{ turns }} turns). Speakers: {% for s in speakers %}{{ s.name }}{% endfor %} Output JSON: {"transcript": [{"speaker": "...", "dialogue": "..."}]} """, }) ``` -------------------------------- ### Generate Podcast with create_podcast() Source: https://context7.com/lfnovo/podcast-creator/llms.txt The primary async function to generate a podcast. It accepts content, episode profiles, and various configuration options for outline, transcript, and audio generation. Use `asyncio.run()` to execute. ```python import asyncio from podcast_creator import create_podcast async def main(): # --- Option A: Episode Profile (recommended) --- result = await create_podcast( content=[ "The transformer architecture revolutionized NLP in 2017...", "https://arxiv.org/abs/1706.03762", # URLs are also accepted ], episode_profile="tech_discussion", # uses bundled profile defaults briefing_suffix="Focus on practical applications in 2024", episode_name="transformers_deep_dive", output_dir="output/transformers", language="pt-BR", # generate in Brazilian Portuguese retry_max_attempts=5, retry_wait_multiplier=3, ) # --- Option B: Full manual configuration --- result = await create_podcast( content="Quantum computing uses qubits instead of bits...", briefing="Create an accessible introduction to quantum computing for software engineers", episode_name="quantum_intro", output_dir="output/quantum", speaker_config="ai_researchers", # name of speaker profile outline_provider="openai", outline_model="gpt-4o-mini", transcript_provider="anthropic", transcript_model="claude-3-5-sonnet-latest", num_segments=4, outline_config={"temperature": 0.3}, transcript_config={"temperature": 0.7}, ) print(result["final_output_file_path"]) # => PosixPath('output/quantum/audio/quantum_intro.mp3') print(result["audio_clips_count"]) print(result["outline"]) print(result["transcript"]) asyncio.run(main()) ``` -------------------------------- ### Configure Custom Templates and Paths Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Customize the podcast generation process by configuring custom templates for outlines and transcripts, or by specifying custom directories for prompts and speaker configurations. ```python from podcast_creator import configure # Configure with custom templates configure("templates", { "outline": "Your custom outline template...", "transcript": "Your custom transcript template..." }) # Configure with custom paths configure({ "prompts_dir": "./my_templates", "speakers_config": "./my_speakers.json", "output_dir": "./podcasts" }) ``` -------------------------------- ### Simple Episode Profile Usage Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Use a simple episode profile with the `create_podcast` function for quick podcast generation. Ensure the `asyncio` event loop is run. ```python import asyncio from podcast_creator import create_podcast # Simple episode profile usage async def main(): result = await create_podcast( content="AI has transformed many industries...", episode_profile="tech_discussion", # 🚀 One-liner magic! episode_name="ai_impact", output_dir="output/ai_impact" ) asyncio.run(main()) ``` -------------------------------- ### Create Podcast with Perplexity Outline and Transcript Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/one_speaker_perplexity.ipynb Use this snippet to create a podcast on a given topic using Perplexity for outline and transcript generation. Configure speaker settings, model providers, and the number of segments for the podcast. ```python from podcast_creator import create_podcast briefing = """ Create an exciting podcast on the topic of "Large Diffusion Models" """ result = await create_podcast( content=None, briefing=briefing, episode_name="teach_me_now", output_dir="output/teach_me_now", speaker_config="solo_expert", outline_provider="perplexity", outline_model="sonar-pro", transcript_provider="perplexity", transcript_model="sonar-pro", num_segments=4 ) ``` -------------------------------- ### Project Structure Overview Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Displays the directory and file structure of the podcast-creator project. Key directories include src/ for source code and resources/ for bundled templates. ```text podcast-creator/ ├── src/ │ └── podcast_creator/ │ ├── __init__.py # Public API │ ├── config.py # Configuration system │ ├── cli.py # CLI commands (with UI command) │ ├── core.py # Core utilities │ ├── graph.py # LangGraph workflow │ ├── nodes.py # Workflow nodes │ ├── retry.py # Retry utilities with exponential backoff │ ├── speakers.py # Speaker management │ ├── episodes.py # Episode profile management │ ├── state.py # State management │ ├── validators.py # Validation utilities │ └── resources/ │ ├── prompts/ │ ├── speakers_config.json │ ├── episodes_config.json │ ├── streamlit_app/ # Web interface │ └── examples/ ├── pyproject.toml # Package configuration └── README.md ``` -------------------------------- ### Load and Inspect Bundled Episode Profiles Source: https://github.com/lfnovo/podcast-creator/blob/main/examples/episode_profiles.ipynb Loads and prints details of available bundled episode profiles. Requires the 'podcast_creator' library. Handles potential errors during profile loading. ```python from podcast_creator import load_episode_config # Load and inspect the bundled episode profiles profiles = [ "tech_discussion", "solo_expert", "business_analysis", "diverse_panel" ] for profile_name in profiles: try: profile = load_episode_config(profile_name) print(f"\n📋 {profile_name.upper()}:") print(f" Speaker Config: {profile.speaker_config}") print(f" Segments: {profile.num_segments}") print(f" Outline: {profile.outline_provider}/{profile.outline_model}") print(f" Transcript: {profile.transcript_provider}/{profile.transcript_model}") print(f" Briefing: {profile.default_briefing[:100]}...") except Exception as e: print(f"❌ Error loading {profile_name}: {e}") ``` -------------------------------- ### Configure Custom Templates Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Define custom templates for podcast outlines and transcripts. These templates use Jinja-like syntax for dynamic content generation. ```python configure("templates", { "outline": """ Create a {{ num_segments }}-part podcast outline about: {{ briefing }} Content: {{ context }} Speakers: {% for speaker in speakers %}{{ speaker.name }}: {{ speaker.personality }}{% endfor %} """, "transcript": """ Generate natural dialogue for: {{ segment.name }} Keep it conversational and engaging. """ }) ``` -------------------------------- ### Configure Multiple Settings Source: https://context7.com/lfnovo/podcast-creator/llms.txt Configure multiple settings, such as output and template directories, simultaneously using a single `configure` call. ```python configure({ "output_dir": "./podcasts", "prompts_dir": "./my_templates", }) ``` -------------------------------- ### Generate Podcast with Solo Expert Profile Source: https://github.com/lfnovo/podcast-creator/blob/main/README.md Create a podcast episode using the 'solo_expert' profile. Specify the output directory for the generated files. ```python result = await create_podcast( content="Technical content...", episode_profile="solo_expert", episode_name="deep_dive", output_dir="output/deep_dive" ) ```