Skip to content

Commit 2585661

Browse files
author
Guiners
committed
codereview fix
1 parent 68ae455 commit 2585661

8 files changed

+57
-21
lines changed

genai/live/live_audiogen_with_txt.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@ async def generate_content() -> None:
2424
import numpy as np
2525
import scipy.io.wavfile as wavfile
2626
from google import genai
27-
from google.genai.types import (Content, LiveConnectConfig, Modality, Part,
28-
PrebuiltVoiceConfig, SpeechConfig,
29-
VoiceConfig)
27+
from google.genai.types import (
28+
Content,
29+
LiveConnectConfig,
30+
Modality,
31+
Part,
32+
PrebuiltVoiceConfig,
33+
SpeechConfig,
34+
VoiceConfig,
35+
)
3036

3137
client = genai.Client()
3238
model = "gemini-2.0-flash-live-preview-04-09"

genai/live/live_code_exec_with_txt.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@
1818
async def generate_content() -> list[str]:
1919
# [START googlegenaisdk_live_code_exec_with_txt]
2020
from google import genai
21-
from google.genai.types import (Content, LiveConnectConfig, Modality, Part,
22-
Tool, ToolCodeExecution)
21+
from google.genai.types import (
22+
Content,
23+
LiveConnectConfig,
24+
Modality,
25+
Part,
26+
Tool,
27+
ToolCodeExecution,
28+
)
2329

2430
client = genai.Client()
2531
model_id = "gemini-2.0-flash-live-preview-04-09"

genai/live/live_func_call_with_txt.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@
2020
async def generate_content() -> list[FunctionResponse]:
2121
# [START googlegenaisdk_live_func_call_with_txt]
2222
from google import genai
23-
from google.genai.types import (Content, FunctionDeclaration,
24-
FunctionResponse, LiveConnectConfig,
25-
Modality, Part, Tool)
23+
from google.genai.types import (
24+
Content,
25+
FunctionDeclaration,
26+
FunctionResponse,
27+
LiveConnectConfig,
28+
Modality,
29+
Part,
30+
Tool,
31+
)
2632

2733
client = genai.Client()
2834
model_id = "gemini-2.0-flash-live-preview-04-09"

genai/live/live_ground_googsearch_with_txt.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@
1919
async def generate_content() -> list[str]:
2020
# [START googlegenaisdk_live_ground_googsearch_with_txt]
2121
from google import genai
22-
from google.genai.types import (Content, GoogleSearch, LiveConnectConfig,
23-
Modality, Part, Tool)
22+
from google.genai.types import (
23+
Content,
24+
GoogleSearch,
25+
LiveConnectConfig,
26+
Modality,
27+
Part,
28+
Tool,
29+
)
2430

2531
client = genai.Client()
2632
model_id = "gemini-2.0-flash-live-preview-04-09"

genai/live/live_structured_ouput_with_txt.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ def generate_content() -> CalendarEvent:
3030
import google.auth.transport.requests
3131
import openai
3232
from google.auth import default
33-
from openai.types.chat import (ChatCompletionSystemMessageParam,
34-
ChatCompletionUserMessageParam)
33+
from openai.types.chat import (
34+
ChatCompletionSystemMessageParam,
35+
ChatCompletionUserMessageParam,
36+
)
3537

3638
project_id = os.environ["GOOGLE_CLOUD_PROJECT"]
3739
location = "us-central1"

genai/live/live_transcribe_with_audio.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@
2222
async def generate_content() -> list[str]:
2323
# [START googlegenaisdk_live_transcribe_with_audio]
2424
from google import genai
25-
from google.genai.types import (AudioTranscriptionConfig, Content,
26-
LiveConnectConfig, Modality, Part)
25+
from google.genai.types import (
26+
AudioTranscriptionConfig,
27+
Content,
28+
LiveConnectConfig,
29+
Modality,
30+
Part,
31+
)
2732

2833
client = genai.Client()
2934
model = "gemini-live-2.5-flash-preview-native-audio"

genai/live/live_with_txt.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@
1818
async def generate_content() -> list[str]:
1919
# [START googlegenaisdk_live_with_txt]
2020
from google import genai
21-
from google.genai.types import (Content, HttpOptions, LiveConnectConfig,
22-
Modality, Part)
21+
from google.genai.types import (
22+
Content,
23+
HttpOptions,
24+
LiveConnectConfig,
25+
Modality,
26+
Part,
27+
)
2328

2429
client = genai.Client(http_options=HttpOptions(api_version="v1beta1"))
2530
model_id = "gemini-2.0-flash-live-preview-04-09"

genai/live/test_live_examples.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ async def test_live_structured_ouput_with_txt() -> None:
105105

106106
@pytest.mark.asyncio
107107
async def test_live_txt_with_audio() -> None:
108-
assert await live_txt_with_audio.generate_content()
108+
assert await live_txt_with_audio.generate_content()
109109

110110

111111
@pytest.mark.asyncio
112112
async def test_live_audio_with_txt() -> None:
113-
result = await live_audio_with_txt.generate_content()
114-
assert result is not None
113+
result = await live_audio_with_txt.generate_content()
114+
assert result is not None
115115

116116

117117
@pytest.mark.asyncio
118118
async def test_live_transcribe_with_audio() -> None:
119-
result = await live_transcribe_with_audio.generate_content()
120-
assert result is not None
119+
result = await live_transcribe_with_audio.generate_content()
120+
assert result is not None

0 commit comments

Comments
 (0)