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

Context
Version 3.5.0 of @google/genai, Google DeepMind's JavaScript and TypeScript library for the Gemini API, adds experimental code for joining a Gemini interaction in real time from a browser over WebRTC, the standard browsers use for live audio and video calls (release notes). In the Interactions API, Google's interface for model and calls, each call is an interaction stored on the server. The commit connects to one that already exists. The library opens a peer connection, attaches the page's microphone or camera tracks, and sends a connection offer to a new `:webrtc` endpoint for that interaction. Once Google answers, audio and video travel as media streams while JSON events go over a data channel named `events`. The library also offers a WebSocket connection to the same live interaction. A source comment explains that the code leaves out one header because a browser would otherwise block the connection request, so browsers are an intended client.
That use explains the other half of the feature. A web page should not hold a developer's long-lived API key, and a companion commit adds an `authTokens` client that creates a short-lived for one interaction, described as being for client-side authentication. Google's existing Live API already uses ephemeral tokens this way so that apps can connect from a user's device. Live Interactions works only with the Gemini API, not Vertex AI. It is marked experimental, prints a one-time warning that it may change, and the release links no documentation or list of supported models, so it is not yet a stable base for a product. The Python library's 3.5.0, released the same day, adds the WebSocket path and the tokens but not WebRTC.
The release shares the Python library's support for self-hosted environments, where a Gemini managed agent's tools run on the developer's own machines instead of Google's . Creating one returns a secret `environment_key`, which the developer's sandbox uses to connect to Google and which the API returns only at creation. Its one bug fix concerns batch jobs whose results come back inline. Those results were returned as plain objects even though the library's types declared them `GenerateContentResponse` instances, so convenience getters such as `.text` were missing from them. The fix wraps each inline response in a real instance, and entries that hold only an error are left without one.
- Environments in the JavaScript 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 SDK.
- Batch jobs with inlined responses now return GenerateContentResponse instances, a bug fix tracked in issue #1433.
- 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.
- 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.
- sandbox — An isolated environment where AI-generated code or agent actions run without being able to touch anything real.
Checking sign-in…
Loading comments…




