Skip to content

Commit d4c7504

Browse files
happyhumanmstyer-googletommywagz
authored
chore: Reformatted the podcast-transcript-agent sample by ensuring black, isort, and flake8 pass (#763)
Co-authored-by: Mike Styer <[email protected]> Co-authored-by: tommywagz <[email protected]>
1 parent 2f7b82f commit d4c7504

File tree

12 files changed

+48
-31
lines changed

12 files changed

+48
-31
lines changed

python/agents/podcast_transcript_agent/podcast_transcript_agent/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from . import agent
16-
15+
from . import agent # noqa: F401

python/agents/podcast_transcript_agent/podcast_transcript_agent/agent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
# limitations under the License.
1414

1515
from google.adk.agents import SequentialAgent
16-
from .sub_agents.podcast_topics import podcast_topics_agent
16+
1717
from .sub_agents.podcast_episode_planner import podcast_episode_planner_agent
18+
from .sub_agents.podcast_topics import podcast_topics_agent
1819
from .sub_agents.podcast_transcript_writer import (
1920
podcast_transcript_writer_agent,
2021
)

python/agents/podcast_transcript_agent/podcast_transcript_agent/models/podcast_plan.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,21 @@
1313
# limitations under the License.
1414

1515
from typing import List
16-
from pydantic import BaseModel
16+
1717
from podcast_transcript_agent.models.podcast_transcript import PodcastSpeaker
18+
from pydantic import BaseModel
19+
1820

1921
class Segment(BaseModel):
2022
"""A model for a 'main_segment', which includes a title."""
23+
2124
title: str
2225
script_points: List[str]
2326

27+
2428
class PodcastEpisodePlan(BaseModel):
2529
"""Represents the entire episode, containing a title and a list of segments."""
30+
2631
episode_title: str
2732
speakers: List[PodcastSpeaker]
2833
segments: List[Segment]

python/agents/podcast_transcript_agent/podcast_transcript_agent/models/podcast_topics.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,20 @@
1313
# limitations under the License.
1414

1515
from typing import List
16+
1617
from pydantic import BaseModel
1718

19+
1820
class Topic(BaseModel):
1921
"""A model for a podcast topic, which includes a title, description, and key facts."""
22+
2023
topic_name: str
2124
description: str
2225
key_facts: list[str]
2326

27+
2428
class PodcastTopics(BaseModel):
2529
"""A model for the main topic and sub-topics of a podcast episode."""
30+
2631
main_topic: str
2732
sub_topics: List[Topic]

python/agents/podcast_transcript_agent/podcast_transcript_agent/models/podcast_transcript.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,46 @@
1414

1515

1616
from typing import List
17+
1718
from pydantic import BaseModel
1819

20+
1921
class SpeakerDialogue(BaseModel):
2022
"""A model for a speaker's dialogue, including the speaker's ID and the text of the dialogue."""
23+
2124
speaker_id: str
2225
text: str
2326

27+
2428
class PodcastSegment(BaseModel):
2529
"""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."""
30+
2631
segment_title: str
2732
title: str
2833
start_time: float
2934
end_time: float
3035
speaker_dialogues: List[SpeakerDialogue]
3136

37+
3238
class PodcastSpeaker(BaseModel):
3339
"""A model for a podcast speaker, including their ID, name, and role."""
40+
3441
speaker_id: str
3542
name: str
3643
role: str
37-
44+
45+
3846
class PodcastMetadata(BaseModel):
3947
"""A model for the podcast's metadata, including the episode title, duration, and summary."""
48+
4049
episode_title: str
4150
duration_seconds: int
4251
summary: str
4352

53+
4454
class PodcastTranscript(BaseModel):
4555
"""A model for a podcast transcript, which includes metadata, speakers, and segments."""
46-
metadata: PodcastMetadata
56+
57+
metadata: PodcastMetadata
4758
speakers: List[PodcastSpeaker]
48-
segments: List[PodcastSegment]
59+
segments: List[PodcastSegment]

python/agents/podcast_transcript_agent/podcast_transcript_agent/sub_agents/podcast_episode_planner/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from .agent import podcast_episode_planner_agent
16-
15+
from .agent import podcast_episode_planner_agent # noqa: F401

python/agents/podcast_transcript_agent/podcast_transcript_agent/sub_agents/podcast_episode_planner/agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
# limitations under the License.
1414

1515
from google.adk.agents import Agent
16-
from . import prompt
1716
from podcast_transcript_agent.models.podcast_plan import PodcastEpisodePlan
1817

18+
from . import prompt
1919

2020
podcast_episode_planner_agent = Agent(
2121
name="podcast_episode_planner_agent",
2222
model="gemini-2.5-flash",
2323
description="Plans the podcast episode based on extracted topics",
2424
instruction=prompt.PODCAST_EPISODE_PLANNER_PROMPT,
2525
output_schema=PodcastEpisodePlan,
26-
output_key="podcast_episode_plan"
27-
)
26+
output_key="podcast_episode_plan",
27+
)

python/agents/podcast_transcript_agent/podcast_transcript_agent/sub_agents/podcast_topics/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from .agent import podcast_topics_agent
16-
17-
18-
15+
from .agent import podcast_topics_agent # noqa: F401

python/agents/podcast_transcript_agent/podcast_transcript_agent/sub_agents/podcast_topics/agent.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
# limitations under the License.
1414

1515
from google.adk.agents import Agent
16-
from . import prompt
1716
from podcast_transcript_agent.models.podcast_topics import PodcastTopics
1817

18+
from . import prompt
19+
1920
podcast_topics_agent = Agent(
2021
name="podcast_topics_agent",
2122
model="gemini-2.5-flash",
2223
description="Extracts podcast topics from provided input",
23-
instruction= prompt.TOPIC_EXTRACTION_PROMPT,
24+
instruction=prompt.TOPIC_EXTRACTION_PROMPT,
2425
output_schema=PodcastTopics,
25-
output_key="podcast_topics"
26+
output_key="podcast_topics",
2627
)

python/agents/podcast_transcript_agent/podcast_transcript_agent/sub_agents/podcast_transcript_writer/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from .agent import podcast_transcript_writer_agent
16-
17-
15+
from .agent import podcast_transcript_writer_agent # noqa: F401

0 commit comments

Comments
 (0)