podcast_llm.models

Pydantic models for podcast generation.

This module defines the core data models used throughout the podcast generation system. It uses Pydantic for data validation and serialization, providing type safety and structured representations of podcast components like outlines, scripts, and research materials.

Key models include: - PodcastOutline: Complete episode structure with sections and subsections - PodcastSection: Major content sections within an episode - PodcastSubsection: Detailed subsections of content - Script: Complete podcast script with speaker turns - Question/Answer: Individual conversation exchanges - WikipediaPages: Research material from Wikipedia - SearchQueries: Web search queries for additional research

The models enforce consistent structure and provide helper methods for formatting and manipulating podcast content. They serve as the foundational data structures that flow through the generation pipeline.

Example

outline = PodcastOutline(
sections=[
PodcastSection(

title=”Introduction”, subsections=[

PodcastSubsection(title=”Topic Overview”), PodcastSubsection(title=”Key Concepts”)

]

)

]

) print(outline.as_str)

class podcast_llm.models.Answer(*, answer: str)[source]

Bases: BaseModel

A model representing an answer in an interview conversation.

This class models an individual answer given by an interviewee in a podcast conversation. It provides a structured way to store and format answer text, with a helper property to output the answer in a standardized string format.

answer

The actual text content of the answer being given

Type:

str

answer: str
property as_str: str
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'answer': FieldInfo(annotation=str, required=True, title='Text of the answer')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

class podcast_llm.models.ContextDocument(*, title: str, text: str, source: str)[source]

Bases: BaseModel

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'source': FieldInfo(annotation=str, required=True, description='The source of the document'), 'text': FieldInfo(annotation=str, required=True, description='The text of the document'), 'title': FieldInfo(annotation=str, required=True, description='The title of the document')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

source: str
text: str
title: str
class podcast_llm.models.PodcastOutline(*, sections: List[PodcastSection])[source]

Bases: BaseModel

A model representing a complete podcast episode outline.

This class models the full structure of a podcast episode outline, containing an ordered list of major sections, each with their own subsections. It provides a hierarchical organization of the episode content and includes a helper property to format the entire outline into a standardized string representation.

sections

Ordered list of major sections making up the episode outline

Type:

List[PodcastSection]

property as_str: str
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'sections': FieldInfo(annotation=List[PodcastSection], required=True, description='List of sections in a podcast outline')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

sections: List[PodcastSection]
class podcast_llm.models.PodcastSection(*, title: str, subsections: List[PodcastSubsection])[source]

Bases: BaseModel

A model representing a section within a podcast outline.

This class models a major section of content within a podcast outline. Each section contains a title and a list of subsections, providing hierarchical structure to the podcast content. A helper property formats the section and its subsections into a standardized string representation.

title

The title/heading text for this section

Type:

str

subsections

List of subsections contained within this section

Type:

List[PodcastSubsection]

property as_str: str
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'subsections': FieldInfo(annotation=List[PodcastSubsection], required=True, description='List of subsections in a podcast section'), 'title': FieldInfo(annotation=str, required=True, description='A section in a podcast outline')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

subsections: List[PodcastSubsection]
title: str
class podcast_llm.models.PodcastSubsection(*, title: str)[source]

Bases: BaseModel

A model representing a subsection within a podcast section.

This class models an individual subsection of content within a larger podcast section. It provides a structured way to store and format subsection titles, with a helper property to output the subsection in a standardized string format with appropriate indentation.

title

The title/heading text for this subsection

Type:

str

property as_str: str
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'title': FieldInfo(annotation=str, required=True, description='A subsection in a podcast outline')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

title: str
class podcast_llm.models.Question(*, question: str)[source]

Bases: BaseModel

A model representing a question in an interview conversation.

This class models an individual question asked by an interviewer in a podcast conversation. It provides a structured way to store and format question text, with a helper property to output the question in a standardized string format.

question

The actual text content of the question being asked

Type:

str

property as_str: str
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'question': FieldInfo(annotation=str, required=True, title='Text of the question')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

question: str
class podcast_llm.models.Script(*, lines: List[ScriptLine])[source]

Bases: BaseModel

A model representing a complete podcast script.

This class models the full script of a podcast episode, containing an ordered list of dialogue lines from both interviewer and interviewee. It provides a structured way to store the complete conversation and includes a helper property to format the entire script into a standardized string representation with proper speaker labels and spacing.

lines

Ordered list of dialogue lines making up the complete script

Type:

List[ScriptLine]

property as_str: str
lines: List[ScriptLine]
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'lines': FieldInfo(annotation=List[ScriptLine], required=True, title='Lines in a podcast script')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

class podcast_llm.models.ScriptLine(*, speaker: str, text: str)[source]

Bases: BaseModel

A model representing a single line of dialogue in a podcast script.

This class models an individual line of dialogue from either the interviewer or interviewee in a podcast conversation. It provides a structured way to store both the speaker identifier and their dialogue text, with a helper property to format the line in a standardized string format.

speaker

Identifier for who is speaking (‘Interviewer’ or ‘Interviewee’)

Type:

str

text

The actual dialogue content being spoken

Type:

str

property as_str: str
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'speaker': FieldInfo(annotation=str, required=True, title='The person speaking'), 'text': FieldInfo(annotation=str, required=True, title='A line in a podcast script.')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

speaker: str
text: str
class podcast_llm.models.SearchQueries(*, queries: List[SearchQuery])[source]

Bases: BaseModel

A model representing a collection of search queries.

This class models a collection of search queries used to gather research material for podcast content generation. It stores a list of SearchQuery objects and provides a structured way to work with multiple queries together.

queries

List of SearchQuery objects representing the collection

Type:

List[SearchQuery]

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'queries': FieldInfo(annotation=List[SearchQuery], required=True, title='List of search queries')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

queries: List[SearchQuery]
class podcast_llm.models.SearchQuery(*, query: str)[source]

Bases: BaseModel

A model representing a search query.

This class models an individual search query used to gather research material for podcast content generation. It provides a structured way to store and format query text, with a helper property to output the query in a standardized string format.

query

The actual text content of the search query

Type:

str

property as_str: str
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'query': FieldInfo(annotation=str, required=True, title='Text of the search query')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

query: str
class podcast_llm.models.WikipediaPage(*, name: str)[source]

Bases: BaseModel

A model representing a Wikipedia page.

This class models a Wikipedia page that has been retrieved as part of the research process for podcast content generation. It stores the page name and provides a standardized string representation through a helper property.

name

The title/name of the Wikipedia page

Type:

str

property as_str: str
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'name': FieldInfo(annotation=str, required=True, title='Name of the wikipedia page')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

name: str
class podcast_llm.models.WikipediaPages(*, pages: List[WikipediaPage])[source]

Bases: BaseModel

A model representing a collection of Wikipedia pages.

This class models a collection of Wikipedia pages that have been retrieved as part of the research process for podcast content generation. It stores a list of WikipediaPage objects and provides a standardized way to work with multiple pages together.

pages

List of WikipediaPage objects representing the collection

Type:

List[WikipediaPage]

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'pages': FieldInfo(annotation=List[WikipediaPage], required=True, title='List of Wikipedia pages')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

pages: List[WikipediaPage]