python-genai v3.6.0
- Source
- github.com
- Author
- release-please[bot]
- Date

Context
Version 3.6.0 of google-genai, Google's Python library for calling Gemini models, is a small release whose most useful changes stop the library from failing requests that could have succeeded. The clearest case is in issue #2869. Before each request the library may refresh its Google credentials, and if that refresh hit a network failure, the google.auth library raised a TransportError that the retry logic did not recognize. The first failure therefore ended the request even when the caller had configured several retry attempts; the reporter saw it on Vertex AI with service-account credentials. The fix adds TransportError to the errors retried when retry options are set, for both synchronous and asynchronous calls, while a RefreshError, which signals a permanent authentication problem, still fails at once.
A second fix concerns , where a developer asks Gemini for JSON matching a schema and the library parses the reply into a parsed field. Since Python 3.11, converting an integer longer than 4,300 digits raises a plain ValueError, which the library did not catch. In issue #2542 a model emitted an integer of about 25,410 digits, and the caller got an exception with no response object even though the API had returned success. The library now catches that error, returns the response with its raw text, and leaves the parsed field empty, as it already did for malformed JSON. A related fix makes the parsed field of a long answer delivered across several continuation responses come from the merged text rather than from a value one of those responses had already parsed.
The release's listed feature, tool retrieval, is narrower than its name suggests. It concerns tool search, an existing tool type whose documentation says it lets the model find and load tool definitions when it needs them instead of receiving all of them up front, which "may help reduce overall usage and cost." The commit exports the tool-search call and result step types from the main interactions module, where they previously sat in a separate module under shorter names, and adds a defer_loading option that delays loading an server's tools. That separate module is deleted, so code that imported the shorter names from it will need updating; no new model capability is announced.
- structured output — Forcing a model's response to match a schema, so downstream code can parse it instead of guessing at prose.
- token — The chunk of text a model reads and writes in — roughly three-quarters of a word — and the unit AI usage is billed in.
- MCP — The Model Context Protocol — an open standard that lets any AI assistant plug into any tool or data source without custom integration code.
Checking sign-in…
Loading comments…





