Skip to content

Commit 76ca0f7

Browse files
committed
feat(genai): Update bearer token code
1 parent 03a9b39 commit 76ca0f7

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

genai/live/live_websocket_audiogen_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import os
1717

1818

19-
def get_bearer_token():
19+
def get_bearer_token() -> str:
2020
import google.auth
2121
from google.auth.transport.requests import Request
2222

genai/live/live_websocket_audiotranscript_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import os
1717

1818

19-
def get_bearer_token():
19+
def get_bearer_token() -> str:
2020
import google.auth
2121
from google.auth.transport.requests import Request
2222

genai/live/live_websocket_textgen_with_audio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import os
1717

1818

19-
def get_bearer_token():
19+
def get_bearer_token() -> str:
2020
import google.auth
2121
from google.auth.transport.requests import Request
2222

@@ -43,8 +43,8 @@ async def generate_content() -> str:
4343
from websockets.asyncio.client import connect
4444
from scipy.io import wavfile
4545

46-
def read_wavefile(filepath):
47-
# Read the .wav file.
46+
def read_wavefile(filepath: str) -> tuple[str, str]:
47+
# Read the .wav file using scipy.io.wavfile.read
4848
rate, data = wavfile.read(filepath)
4949
# Convert the NumPy array of audio samples back to raw bytes
5050
raw_audio_bytes = data.tobytes()

genai/live/live_websocket_textgen_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import os
1717

1818

19-
def get_bearer_token():
19+
def get_bearer_token() -> str:
2020
import google.auth
2121
from google.auth.transport.requests import Request
2222

genai/live/test_live_examples.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
import pytest
2222

23-
import live_with_txt
24-
import live_websocket_textgen_with_audio
25-
import live_websocket_textgen_with_txt
2623
import live_websocket_audiogen_with_txt
2724
import live_websocket_audiotranscript_with_txt
25+
import live_websocket_textgen_with_audio
26+
import live_websocket_textgen_with_txt
27+
import live_with_txt
2828

2929
os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True"
3030
os.environ["GOOGLE_CLOUD_LOCATION"] = "us-central1"

0 commit comments

Comments
 (0)