Google-Gemini2
python-genai Google Bug
gemini-2.0-flash报错, gemini-1.5-flash报错相同
https://github.com/livekit/agents/pull/1480#commits-pushed-f87c7ac
提交了复现代码,并报告了bug给Google
https://github.com/googleapis/python-genai/issues/362
Error:
2025/02/18 14:28:44 - ERROR - livekit.plugins.google - Error in _main_task
Traceback (most recent call last):
File “/Users/admin/git/livekitagents/livekit-agents/livekit/agents/utils/log.py”, line 16, in async_fn_logs
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/admin/git/livekitagents/livekit-plugins/livekit-plugins-google/build/editable.livekit_plugins_google-0.10.2-py3-none-any/livekit/plugins/google/beta/realtime/realtime_api.py”, line 490, in _main_task
async with self._client.aio.live.connect(
File “/Users/admin/miniforge3/envs/pipecat/lib/python3.11/contextlib.py”, line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File “/Users/admin/miniforge3/envs/pipecat/lib/python3.11/site-packages/google/genai/live.py”, line 705, in connect
logging.info(await ws.recv(decode=False))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/admin/miniforge3/envs/pipecat/lib/python3.11/site-packages/websockets/asyncio/connection.py”, line 313, in recv
raise self.protocol.close_exc from self.recv_exc
websockets.exceptions.ConnectionClosedError: received 1008 (policy violation) Request trace id: 3c25bd58ae0ed234, [ORIGINAL ERROR] generic::not_found: models/gemini-2.0-flash is not found for API versi; then sent 1008 (policy violation) Request trace id: 3c25bd58ae0ed234, [ORIGINAL ERROR] generic::not_found: models/gemini-2.0-flash is not found for API versi
2025/02/18 14:28:44 - ERROR - livekit.plugins.google - Error in _main_task
Traceback (most recent call last):
File “/Users/admin/git/livekitagents/livekit-agents/livekit/agents/utils/log.py”, line 16, in async_fn_logs
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/admin/git/livekitagents/livekit-plugins/livekit-plugins-google/build/editable.livekit_plugins_google-0.10.2-py3-none-any/livekit/plugins/google/beta/realtime/realtime_api.py”, line 490, in _main_task
async with self._client.aio.live.connect(
File “/Users/admin/miniforge3/envs/pipecat/lib/python3.11/contextlib.py”, line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File “/Users/admin/miniforge3/envs/pipecat/lib/python3.11/site-packages/google/genai/live.py”, line 705, in connect
logging.info(await ws.recv(decode=False))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/admin/miniforge3/envs/pipecat/lib/python3.11/site-packages/websockets/asyncio/connection.py”, line 313, in recv
raise self.protocol.close_exc from self.recv_exc
websockets.exceptions.ConnectionClosedError: received 1008 (policy violation) Request trace id: 3c25bd58ae0ed234, [ORIGINAL ERROR] generic::not_found: models/gemini-2.0-flash is not found for API versi; then sent 1008 (policy violation) Request trace id: 3c25bd58ae0ed234, [ORIGINAL ERROR] generic::not_found: models/gemini-2.0-flash is not found for API versi
{“message”: “Error in _main_task\nTraceback (most recent call last):\n File "/Users/admin/git/livekitagents/livekit-agents/livekit/agents/utils/log.py", line 16, in async_fn_logs\n return await fn(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/Users/admin/git/livekitagents/livekit-plugins/livekit-plugins-google/build/editable.livekit_plugins_google-0.10.2-py3-none-any/livekit/plugins/google/beta/realtime/realtime_api.py", line 490, in _main_task\n async with self._client.aio.live.connect(\n File "/Users/admin/miniforge3/envs/pipecat/lib/python3.11/contextlib.py", line 210, in __aenter__\n return await anext(self.gen)\n ^^^^^^^^^^^^^^^^^^^^^\n File "/Users/admin/miniforge3/envs/pipecat/lib/python3.11/site-packages/google/genai/live.py", line 705, in connect\n logging.info(await ws.recv(decode=False))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/Users/admin/miniforge3/envs/pipecat/lib/python3.11/site-packages/websockets/asyncio/connection.py", line 313, in recv\n raise self.protocol.close_exc from self.recv_exc\nwebsockets.exceptions.ConnectionClosedError: received 1008 (policy violation) Request trace id: 3c25bd58ae0ed234, [ORIGINAL ERROR] generic::not_found: models/gemini-2.0-flash is not found for API versi; then sent 1008 (policy violation) Request trace id: 3c25bd58ae0ed234, [ORIGINAL ERROR] generic::not_found: models/gemini-2.0-flash is not found for API versi”, “level”: “ERROR”, “name”: “livekit.plugins.google”, “pid”: 64845, “job_id”: “AJ_PM9XishhmSxZ”, “timestamp”: “2025-02-18T06:28:44.235064+00:00”}
2025/02/18 14:28:47 - INFO - livekit.agents - worker is at full capacity, marking as unavailable
Reproduce the error when using Gemini on LiveKit.
1 |
|