js-genai v2.31.0
- Source
- github.com
- Author
- release-please[bot]
- Date

Context
Version 2.31.0 of js-genai, Google's JavaScript and TypeScript SDK for its Gemini generative AI APIs, mostly keeps the library in step with new API fields, and its most useful changes concern tool results and live sessions (release notes). When a model calls a function the developer provides, the result sent back can now include audio, document and video content. For the Live API, used for ongoing real-time sessions, the release adds in-session updates through send_context_update, which by its name lets an application feed new context into a session that is already running, and a labels field on the connection config.
The notes are terse and do not explain behavior. They add a store option to GenerateContentConfig that applies only to the Gemini Developer API, a generation_output_config option, and a base_voice setting, without saying what each does, so developers should check the API documentation before relying on them. One bug fix matters for apps: errors that occur in the middle of a server-sent event stream, and dropped connections, are now raised consistently across Google's GenAI SDKs, so code that handles streaming failures should see the same behavior from each.
- js-genai 2.31.0 adds AudioContent, DocumentContent and VideoContent to FunctionResultSubContent, so function results sent back to Gemini can include audio, documents and video.
- The Live API gains send_context_update for changing context inside an existing session, and LiveConnectConfig now accepts labels.
- GenerateContentConfig adds a store option, available on the Gemini Developer API only, plus a new generation_output_config field.
- context window — The maximum amount of text a model can consider at once — its working memory for the current conversation or task.
- streaming — Sending a model's response token by token as it is generated, so the reader sees text immediately instead of waiting for the whole answer.
- multimodal — A model that works with more than text — reading images, audio, or video, and sometimes generating them too.
Checking sign-in…
Loading comments…





