Skip to content

Conversation

@chenghao-mou
Copy link

Code to reproduce the issue:

import asyncio

from dotenv import load_dotenv

from google import genai

load_dotenv(".env")

client = genai.Client(
    vertexai=True,
    location="us-central1",
)

model = "gemini-live-2.5-flash-preview-native-audio-09-2025"
config = {"response_modalities": ["TEXT"]}


async def main():
    async with client.aio.live.connect(model=model, config=config) as session:
        message = "Hello, how are you?"
        await session.send_client_content(turns=message, turn_complete=True)


if __name__ == "__main__":
    asyncio.run(main())

It was triggering this issue:

  File "/Users/chenghao/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/contextlib.py", line 214, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chenghao/Developer/python-genai/google/genai/live.py", line 1024, in connect
    auth_req = google.auth.transport.requests.Request()  # type: ignore
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'google.auth.transport' has no attribute 'requests'. Did you mean: 'Request'?

requests as a module was never imported directly or indirectly.

@google-cla
Copy link

google-cla bot commented Nov 26, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@chenghao-mou chenghao-mou changed the title properly import requests fix: properly import requests Nov 26, 2025
Import requests from google.auth.transport
Restore file format from the previous version
Properly import requests module from google.auth.transport
@janasangeetha janasangeetha self-assigned this Nov 28, 2025
@janasangeetha janasangeetha added the size:S Code changes < 10 lines label Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S Code changes < 10 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants