Skip to content

Commit 2e5aac5

Browse files
committed
Remove timestamps from audio summary to make it simpler
1 parent 8c40505 commit 2e5aac5

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

genai/text_generation/textgen_with_gcs_audio.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ def generate_content() -> str:
2020

2121
client = genai.Client(http_options=HttpOptions(api_version="v1"))
2222
prompt = """
23-
Provide the summary of the audio file.
24-
Summarize the main points of the audio concisely.
25-
Create a chapter breakdown with timestamps for key sections or topics discussed.
23+
Provide a concise summary of the main points in the audio file.
2624
"""
2725
response = client.models.generate_content(
2826
model="gemini-2.0-flash-001",
@@ -33,18 +31,12 @@ def generate_content() -> str:
3331
mime_type="audio/mpeg",
3432
),
3533
],
36-
# Required to enable timestamp understanding for audio-only files
37-
config=GenerateContentConfig(audio_timestamp=True),
3834
)
3935
print(response.text)
4036
# Example response:
41-
# This episode of the Made by Google podcast features product managers ...
42-
#
43-
# **Chapter Breakdown:**
44-
#
45-
# * **0:00-0:13:** Introduction to the podcast and the topic of Pixel Feature Drops
46-
# * **0:14-0:27:** Introduces the guest speaker, Aisha Sheriff and DeCarlos Love
47-
# ...
37+
# Here's a summary of the main points from the audio file:
38+
39+
# The Made by Google podcast discusses the Pixel feature drops with product managers Aisha Sheriff and De Carlos Love. The key idea is that devices should improve over time, with a connected experience across phones, watches, earbuds, and tablets.
4840
# [END googlegenaisdk_textgen_with_gcs_audio]
4941
return response.text
5042

0 commit comments

Comments
 (0)