You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(embeddings): GeminiEmbeddings awaits a synchronous google-genai call (TypeError at runtime) #926
In the google-genai unified SDK, client.models.embed_content(...) is synchronous and returns an EmbedContentResponse directly. Awaiting it raises TypeError: object EmbedContentResponse can't be used in 'await' expression against the real API. The async surface is client.aio.models.embed_content(...) — every other Gemini path in the repo (e.g. llm/gemini.py) already uses the .aio/async variant.
The bug is currently masked by the provider test, which sets client.models.embed_content = AsyncMock(...) — making the sync method awaitable and hiding the defect (also a violation of the no-MagicMock testing rule).
Fix: use client.aio.models.embed_content(...); replace the mock-based test with a hand-written fake exposing a real async def aio.models.embed_content.
Fixed in #923 (commit e459fec) — switched to client.aio.models.embed_content and replaced the mock-based test with a hand-written async fake. CI green. Closing as the fix is committed and verified; it lands on main when #923 merges.
Activity
fix(embeddings): await Gemini embeddings via client.aio (async SDK su…
AmitoVrito commentedon Aug 12, 2026
Fixed in #923 (commit
e459fec) — switched toclient.aio.models.embed_contentand replaced the mock-based test with a hand-written async fake. CI green. Closing as the fix is committed and verified; it lands on main when #923 merges.