Problem
The Interactions API error types (APIStatusError, InternalServerError, RateLimitError, APIConnectionError, APITimeoutError, etc.) are only importable from the private google.genai._interactions module:
from google.genai._interactions import (
APIStatusError,
InternalServerError,
RateLimitError,
APIConnectionError,
APITimeoutError,
)
The public google.genai.errors module exposes a separate hierarchy (ServerError, ClientError) that is unrelated to the stainless-generated Interactions API errors — issubclass(InternalServerError, ServerError) is False.
Impact
Linters flag these imports as private-module access violations (e.g. Ruff PLC2701), forcing consumers to suppress the rule. More importantly, private modules have no stability guarantees, so these imports could break on any patch release.
Suggestion
Re-export the Interactions API error types (or a shared base class like GeminiNextGenAPIClientError) from google.genai.errors or a new public module (e.g. google.genai.interactions.errors), so downstream code can catch them without reaching into private internals.
SDK version: 1.73.1
Problem
The Interactions API error types (
APIStatusError,InternalServerError,RateLimitError,APIConnectionError,APITimeoutError, etc.) are only importable from the privategoogle.genai._interactionsmodule:The public
google.genai.errorsmodule exposes a separate hierarchy (ServerError,ClientError) that is unrelated to the stainless-generated Interactions API errors —issubclass(InternalServerError, ServerError)isFalse.Impact
Linters flag these imports as private-module access violations (e.g. Ruff PLC2701), forcing consumers to suppress the rule. More importantly, private modules have no stability guarantees, so these imports could break on any patch release.
Suggestion
Re-export the Interactions API error types (or a shared base class like
GeminiNextGenAPIClientError) fromgoogle.genai.errorsor a new public module (e.g.google.genai.interactions.errors), so downstream code can catch them without reaching into private internals.SDK version: 1.73.1