podcast_llm.outline
Podcast outline generation module.
This module provides functionality for generating and structuring podcast outlines. It contains utilities for formatting and manipulating outline structures, as well as functions for generating complete podcast outlines from topics and research material.
The module leverages LangChain and GPT-4 to intelligently structure podcast content into a hierarchical outline format. It uses prompts from the LangChain Hub to ensure consistent and high-quality outline generation.
- Functions:
format_wikipedia_document: Formats Wikipedia content for use in prompts outline_episode: Generates a complete podcast outline from a topic and research
Example
- outline = outline_episode(
config=podcast_config, topic=”Artificial Intelligence”, background_info=research_docs
) print(outline.as_str)
- podcast_llm.outline.format_wikipedia_document(doc)[source]
Format a Wikipedia document for use in prompt context.
Takes a Wikipedia document object and formats its metadata and content into a structured string format suitable for inclusion in LLM prompts. The format includes a header with the article title followed by the full article content.
- Parameters:
doc – Wikipedia document object containing metadata and page content
- Returns:
Formatted string with article title and content
- Return type:
str
- podcast_llm.outline.outline_episode(config: PodcastConfig, topic: str, background_info: list) PodcastOutline [source]
Generate a structured outline for a podcast episode.
Takes a topic and background research information, then uses LangChain and GPT-4 to generate a detailed podcast outline with sections and subsections. The outline is structured using Pydantic models for type safety and validation.
- Parameters:
topic (str) – The main topic for the podcast episode
background_info (list) – List of Wikipedia document objects containing research material
- Returns:
Structured outline object containing sections and subsections
- Return type: