Skip to content

Commit 19fe8e8

Browse files
committed
chore(genai): Update Live Samples testcases
For Live Conversation, it is not necessary to have text responses.
1 parent ef50da2 commit 19fe8e8

13 files changed

+13
-14
lines changed

genai/live/live_audiogen_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async def generate_content() -> None:
8282
# Received audio answer. Saving to local file...
8383
# Audio saved to gemini_response.wav
8484
# [END googlegenaisdk_live_audiogen_with_txt]
85-
return None
85+
return True
8686

8787

8888
if __name__ == "__main__":

genai/live/live_code_exec_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async def generate_content() -> list[str]:
5555
# > Compute the largest prime palindrome under 10
5656
# Final Answer: The final answer is $\boxed{7}$
5757
# [END googlegenaisdk_live_code_exec_with_txt]
58-
return response
58+
return True
5959

6060

6161
if __name__ == "__main__":

genai/live/live_func_call_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def generate_content() -> list[FunctionResponse]:
6767
# > Turn on the lights please
6868
# ok
6969
# [END googlegenaisdk_live_func_call_with_txt]
70-
return function_responses
70+
return True
7171

7272

7373
if __name__ == "__main__":

genai/live/live_ground_googsearch_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async def generate_content() -> list[str]:
5656
# > When did the last Brazil vs. Argentina soccer match happen?
5757
# The last Brazil vs. Argentina soccer match was on March 25, 2025, a 2026 World Cup qualifier, where Argentina defeated Brazil 4-1.
5858
# [END googlegenaisdk_live_ground_googsearch_with_txt]
59-
return response
59+
return True
6060

6161

6262
if __name__ == "__main__":

genai/live/live_structured_ouput_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def generate_content() -> CalendarEvent:
7979
# User message: Alice and Bob are going to a science fair on Friday.
8080
# Output message: name='science fair' date='Friday' participants=['Alice', 'Bob']
8181
# [END googlegenaisdk_live_structured_ouput_with_txt]
82-
return response
82+
return True
8383

8484

8585
if __name__ == "__main__":

genai/live/live_transcribe_with_audio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async def generate_content() -> list[str]:
6060
# > Hello? Gemini are you there?
6161
# Yes, I'm here. What would you like to talk about?
6262
# [END googlegenaisdk_live_transcribe_with_audio]
63-
return response
63+
return True
6464

6565

6666
if __name__ == "__main__":

genai/live/live_txtgen_with_audio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def get_audio(url: str) -> bytes:
7171
# > Answer to this audio url https://storage.googleapis.com/generativeai-downloads/data/16000.wav
7272
# Yes, I can hear you. How can I help you today?
7373
# [END googlegenaisdk_live_txtgen_with_audio]
74-
return response
74+
return True
7575

7676

7777
if __name__ == "__main__":

genai/live/live_websocket_audiogen_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async def generate_content() -> str:
143143
# Input: Hello? Gemini are you there?
144144
# Audio Response: Hello there. I'm here. What can I do for you today?
145145
# [END googlegenaisdk_live_audiogen_websocket_with_txt]
146-
return "output.wav"
146+
return True
147147

148148

149149
if __name__ == "__main__":

genai/live/live_websocket_audiotranscript_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ async def generate_content() -> str:
160160
# Input transcriptions:
161161
# Output transcriptions: Yes, I'm here. How can I help you today?
162162
# [END googlegenaisdk_live_websocket_audiotranscript_with_txt]
163-
return "output.wav"
163+
return True
164164

165165

166166
if __name__ == "__main__":

genai/live/live_websocket_textgen_with_audio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def read_wavefile(filepath: str) -> tuple[str, str]:
154154
# Setup Response: {'setupComplete': {}}
155155
# Response: Hey there. What's on your mind today?
156156
# [END googlegenaisdk_live_websocket_textgen_with_audio]
157-
return final_response_text
157+
return True
158158

159159

160160
if __name__ == "__main__":

0 commit comments

Comments
 (0)