Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from . import agent

from . import agent # noqa: F401
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
# limitations under the License.

from google.adk.agents import SequentialAgent
from .sub_agents.podcast_topics import podcast_topics_agent

from .sub_agents.podcast_episode_planner import podcast_episode_planner_agent
from .sub_agents.podcast_topics import podcast_topics_agent
from .sub_agents.podcast_transcript_writer import (
podcast_transcript_writer_agent,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@
# limitations under the License.

from typing import List
from pydantic import BaseModel

from podcast_transcript_agent.models.podcast_transcript import PodcastSpeaker
from pydantic import BaseModel


class Segment(BaseModel):
"""A model for a 'main_segment', which includes a title."""

title: str
script_points: List[str]


class PodcastEpisodePlan(BaseModel):
"""Represents the entire episode, containing a title and a list of segments."""

episode_title: str
speakers: List[PodcastSpeaker]
segments: List[Segment]
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@
# limitations under the License.

from typing import List

from pydantic import BaseModel


class Topic(BaseModel):
"""A model for a podcast topic, which includes a title, description, and key facts."""

topic_name: str
description: str
key_facts: list[str]


class PodcastTopics(BaseModel):
"""A model for the main topic and sub-topics of a podcast episode."""

main_topic: str
sub_topics: List[Topic]
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,46 @@


from typing import List

from pydantic import BaseModel


class SpeakerDialogue(BaseModel):
"""A model for a speaker's dialogue, including the speaker's ID and the text of the dialogue."""

speaker_id: str
text: str


class PodcastSegment(BaseModel):
"""A model for a podcast segment, which includes a title, start and end times of the segment (in seconds), and a list of speaker dialogues."""

segment_title: str
title: str
start_time: float
end_time: float
speaker_dialogues: List[SpeakerDialogue]


class PodcastSpeaker(BaseModel):
"""A model for a podcast speaker, including their ID, name, and role."""

speaker_id: str
name: str
role: str



class PodcastMetadata(BaseModel):
"""A model for the podcast's metadata, including the episode title, duration, and summary."""

episode_title: str
duration_seconds: int
summary: str


class PodcastTranscript(BaseModel):
"""A model for a podcast transcript, which includes metadata, speakers, and segments."""
metadata: PodcastMetadata

metadata: PodcastMetadata
speakers: List[PodcastSpeaker]
segments: List[PodcastSegment]
segments: List[PodcastSegment]
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from .agent import podcast_episode_planner_agent

from .agent import podcast_episode_planner_agent # noqa: F401
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this import be moved to where the import is actually used? (to avoid having to use noqa)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good comment for the sample owner. I don't want to make such changes though, since I am just applying formatters to the sample in this PR.

Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
# limitations under the License.

from google.adk.agents import Agent
from . import prompt
from podcast_transcript_agent.models.podcast_plan import PodcastEpisodePlan

from . import prompt

podcast_episode_planner_agent = Agent(
name="podcast_episode_planner_agent",
model="gemini-2.5-flash",
description="Plans the podcast episode based on extracted topics",
instruction=prompt.PODCAST_EPISODE_PLANNER_PROMPT,
output_schema=PodcastEpisodePlan,
output_key="podcast_episode_plan"
)
output_key="podcast_episode_plan",
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from .agent import podcast_topics_agent



from .agent import podcast_topics_agent # noqa: F401
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
# limitations under the License.

from google.adk.agents import Agent
from . import prompt
from podcast_transcript_agent.models.podcast_topics import PodcastTopics

from . import prompt

podcast_topics_agent = Agent(
name="podcast_topics_agent",
model="gemini-2.5-flash",
description="Extracts podcast topics from provided input",
instruction= prompt.TOPIC_EXTRACTION_PROMPT,
instruction=prompt.TOPIC_EXTRACTION_PROMPT,
output_schema=PodcastTopics,
output_key="podcast_topics"
output_key="podcast_topics",
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from .agent import podcast_transcript_writer_agent


from .agent import podcast_transcript_writer_agent # noqa: F401
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
# limitations under the License.

from google.adk.agents import Agent
from . import prompt
from podcast_transcript_agent.models.podcast_transcript import PodcastTranscript

podcast_transcript_writer_agent = Agent(
from . import prompt

podcast_transcript_writer_agent = Agent(
name="podcast_transcript_writer_agent",
model="gemini-2.5-flash",
description="Writes the podcast transcript based on the podcast plan",
instruction=prompt.PODCAST_TRANSCRIPT_WRITER_PROMPT,
output_schema=PodcastTranscript,
output_key="podcast_episode_transcript"
)

output_key="podcast_episode_transcript",
)
9 changes: 5 additions & 4 deletions python/agents/podcast_transcript_agent/tests/test_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import json
from pathlib import Path

import dotenv
import pytest
from google.adk.runners import InMemoryRunner
from podcast_transcript_agent.agent import podcast_transcript_agent
from pathlib import Path
from google.genai import types
import dotenv
import json
from podcast_transcript_agent.agent import podcast_transcript_agent


@pytest.fixture(scope="session", autouse=True)
Expand Down