Traceback (most recent call last): File "/Users/n...
# ask-ai
c
Traceback (most recent call last): File "/Users/nandakumar/anaconda3/envs/inya_avatar_test/lib/python3.12/site-packages/livekit/plugins/google/realtime/realtime_api.py", line 667, in _main_task async with self._client.aio.live.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/nandakumar/anaconda3/envs/inya_avatar_test/lib/python3.12/contextlib.py", line 210, in aenter return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/nandakumar/anaconda3/envs/inya_avatar_test/lib/python3.12/site-packages/google/genai/live.py", line 1085, in connect raw_response = await ws.recv(decode=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/nandakumar/anaconda3/envs/inya_avatar_test/lib/python3.12/site-packages/websockets/asyncio/connection.py", line 322, in recv raise self.protocol.close_exc from self.recv_exc websockets.exceptions.ConnectionClosedError: received 1008 (policy violation) models/gemini-2.0-flash-live-001 is not found for API version v1beta, or is not supported for bidiGenerateContent. Call Lis; then sent 1008 (policy violation) models/gemini-2.0-flash-live-001 is not found for API version v1beta, or is not supported for bidiGenerateContent. Call Lis The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/nandakumar/anaconda3/envs/inya_avatar_test/lib/python3.12/site-packages/livekit/agents/utils/log.py", line 16, in async_fn_logs return await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/nandakumar/anaconda3/envs/inya_avatar_test/lib/python3.12/site-packages/livekit/plugins/google/realtime/realtime_api.py", line 717, in _main_task raise APIConnectionError(message="Failed to connect to Gemini Live") from e livekit.agents._exceptions.APIConnectionError: Failed to connect to Gemini Live (body=None, retryable=True) 170043.774 DEBUG livekit.agents input stream detached
t
Thanks for reaching out, N. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I see the traceback and the error: the Gemini Live websocket returned a 1008 (policy violation) saying
models/gemini-2.0-flash-live-001 is not found for API version v1beta, or is not supported for bidiGenerateContent
. I’ll help you get this working. What you can do next: • Update the model ID to a supported realtime model. Example options: ◦
gemini-2.5-flash-native-audio-preview-09-2025
◦
gemini-2.0-flash-exp
Replace your current
RealtimeModel(model=...)
value with one of these and retry. • Verify your credentials and project access: ◦ Ensure
GOOGLE_API_KEY
or
GOOGLE_APPLICATION_CREDENTIALS
is set and the project has Gemini/Vertex AI access enabled. • Ensure your LiveKit Google plugin version supports the chosen model: ◦ Use a recent
livekit-agents[google]
release. Quick diagnostics I can use to help further: 1. Which model string are you currently passing in your code? 2. Are you using an API key (
GOOGLE_API_KEY
) or service account (
GOOGLE_APPLICATION_CREDENTIALS
)? 3. Which version of
livekit-agents[google]
(or
livekit-agents
) is installed? (You can run
pip show livekit-agents
.) Tell me those three details and I’ll suggest the exact config change or next step. Sources: Gemini Live API plugin | LiveKit docs