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

Context
Version 3.5.0 of google-genai, Google DeepMind's Python library for the Gemini API, lets a program set up a self-hosted environment for Gemini's managed agents, meaning the 's tools run on machines the developer controls (release notes). An environment is the Linux where a managed agent runs code and keeps files, and Google hosts it by default. Google's environments guide describes the self-hosted path. A program creates an environment in `self_hosted` mode and receives a one-time `environment_key`. Running `gemini-api environments connect` with that key inside the developer's own sandbox links it to Google over an outbound HTTPS connection, so no inbound firewall port is needed. Passing the environment's ID to `interactions.create` then sends the agent's work there. Options that only make sense for Google's hosted sandbox, such as mounted sources and network rules, are rejected. The commit adds the `mode` setting, a `system_instruction` that applies to every interaction in a self-hosted environment, and a free-form `custom_config` passed through to the sandbox's polling process. The key's description says it is returned only when the environment is created, so a program must store it then. Google says environments and managed agents are in preview. The 3.2.0 release notes already listed a commit with this title, but the library's 3.2.0 to 3.4.0 source tags do not contain these fields; 3.5.0 is the first that does.
The release also adds experimental support for what Google calls Live Interactions, a real-time connection to an interaction that already exists. The commit is titled for WebSocket and WebRTC, but the Python code adds only a WebSocket `connect()` method. That method can complete, cancel or detach from the interaction, and detaching leaves it resumable on the server. A separate `auth_tokens` resource creates and revokes short-lived tokens for a Live Interaction. Both refuse Vertex AI clients, since Live Interactions works only with the Gemini API, and both print a warning that the feature may change. The release links no documentation for the feature, and neither commit says which models support it, so this is groundwork rather than something to build on yet. The JavaScript library's 3.5.0 carries the browser WebRTC side.
One fix matters to anyone using automatic , where the library runs a Python function the model asks for. The declared schema tells the model to send dates, times, durations and UUIDs as strings, but the library never converted those strings into the `datetime` or `UUID` objects the function expected. As issue 3331 describes, such a tool simply never ran: the parse error went back to the model as the function's result, and the call still completed. The library now parses ISO 8601 strings into the annotated types, including inside lists, dictionaries and optional parameters. A documentation note also records that the Live API and are unavailable on the stable `v1` API version, which version 3.0.0 made the default.
- Environments in the Python SDK and CLI gain a self-hosted BYOS mode, along with new system_instruction, custom_config and environment_key settings.
- Live Interactions arrive as experimental SDK support over WebSocket and WebRTC, with generated types and an auth-token client added to the public SDKs.
- Automatic function calling now parses string arguments into datetime, date, time, timedelta and UUID values, a fix tracked in issue #3331.
- The release documents that the Live API and caches are not available on the v1 API version.
- AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
- sandbox — An isolated environment where AI-generated code or agent actions run without being able to touch anything real.
- tool use — A model's ability to call external functions — run code, search the web, edit files — instead of only generating text.
- prompt caching — Reusing the model's processed form of a repeated prompt prefix so subsequent calls skip re-reading it, cutting cost and latency substantially.
Checking sign-in…
Loading comments…




