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
perf: lazily import the interactions API to speed up import google.genai
The top-level package eagerly imported the interactions submodule, and
client.py eagerly imported the _gaos backend, so every `import
google.genai` paid for hundreds of interactions-API modules even when the
caller only uses generate_content.
Defer both: make `interactions` a lazy module attribute via __getattr__,
and move the _gaos imports in client.py under TYPE_CHECKING plus into the
Client/AsyncClient properties that construct them. `from __future__ import
annotations` keeps the property return annotations valid without the eager
import. The _gaos modules now load only when .interactions/.agents/
.webhooks (or the nextgen client) are first accessed.
PiperOrigin-RevId: 945816846
0 commit comments