Repository navigation
Releases
Releases · googleapis/java-genai
v2.6.0
v2.5.0
2.5.0 (2026-11-18)
Features
- Add a history parameter to Chats.create and AsyncChats.create (a0c58aa)
- environments: introduce self-hosted BYOS mode, system_instruction, custom_config, and environment_key in SDKs and CLI (cbcfc03)
- sdk: Add tool retrieval and function result schemas in public SDK (1893dbe)
Bug Fixes
- Chat history no longer reorders turns after an invalid model response, (a0c58aa)
- interactions: preserve 3-arg Function constructor in Java SDK (d19d94e)
- Override transitive commons-codec 1.11 with 1.18.0 (367f859), refs #896
Documentation
- note that the Live API and caches are not available on v1 (e5dc84c)
v2.4.0
2.4.0 (2026-11-16)
Features
- Add tool search types to the Interactions SDKs (7f3fb30)
- interactions: expose static file processing options (80058fb)
- support batch inputs and usage metadata for Gemini embedding models on Gemini Enterprise API (748c819)
Bug Fixes
- apply HttpOptions.timeout to each attempt instead of the whole operation (0fc5993)
- forward UploadToFileSearchStoreConfig fields in the uploadToFileSearchStore start request (ab9b8bb), refs #821
- stop retry backoff after the last attempt or once the HTTP call is canceled (5946bbc)
Documentation
- note that some models are not available on v1 (b706580)
v2.3.0
v2.2.0
v2.1.0
2.1.0 (2026-11-10)
Features
- add
gemini-omni-1.2-flashand make it thegemini-api videodefault (2df4536) - Add
proactive_videotoProactivityConfigfor the Live API. (fee1478) - add
xhighthinking level to Interactions ThinkingLevel (bbae015) - add usage_metadata (including traffic_type) and truncated to EmbedContentResponse for Gemini Enterprise API (d411dd6)
- interactions: add gemini-4-carbon and gemini-omni-1.2-flash to Model enum (9c125d0)
- live: support base URL, API version and headers in LiveConnectConfig.httpOptions (8fcc127)
Documentation
- update documentation links from ai.google.dev to aistudio.google.com. (8d80f7e)
v2.0.0
2.0.0 (2026-11-06)
⚠ BREAKING CHANGES
-
Default Gemini Developer API version is now
v1(wasv1beta) (88bc413)- Clients targeting the Gemini Developer API now default to API version
v1instead ofv1beta. - No effect on Gemini Enterprise (Vertex AI) defaults: Clients with
.enterprise(true)are unaffected by this default change and continue to default tov1beta1. - Some models are not available on
v1, notably: thegemini-flash-latest,gemini-flash-lite-latestandgemini-pro-latestaliases, and some-previewmodels. They exist only onv1beta. To keep using them, use a specific stable model version, or switch back tov1betaas shown below. - The Live API and context caching (
caches) are not available onv1. The Gemini Developer API serves them only onv1beta. To keep using them, switch back tov1betaas shown below. - Some model aliases are not available on
v1, notably:gemini-flash-latest,gemini-flash-lite-latestandgemini-pro-latest. They exist only onv1beta. To keep using them, use a specific model version, or switch back tov1betaas shown below. - How to configure or restore the previous default via environment variable: Set
GOOGLE_GENAI_API_VERSION(works for both Gemini Developer API and Enterprise / Vertex AI clients when no version is set in code):# Restores the beta default ('v1beta' on Gemini Developer API, 'v1beta1' on Enterprise / Vertex AI) export GOOGLE_GENAI_API_VERSION=beta # Or set an explicit API version string on either platform (e.g. 'v1', 'v1beta', 'v1beta1') export GOOGLE_GENAI_API_VERSION=v1beta
- How to set the API version in code: Pass
HttpOptionswhen building theClient(takes precedence overGOOGLE_GENAI_API_VERSION):import com.google.genai.Client; import com.google.genai.types.HttpOptions; Client client = Client.builder() .httpOptions(HttpOptions.builder().apiVersion("v1beta").build()) .build();
- Clients targeting the Gemini Developer API now default to API version
-
interactions:
CodeExecutionResultStep.resultchanged fromStringto theCodeExecutionResultStepResultunion (e551d17)- The wire JSON for text-only results is unchanged, but Java code constructing or reading
CodeExecutionResultStep.result()must now useCodeExecutionResultStepResult:- Constructing: Use
CodeExecutionResultStepResult.of("...")(orCodeExecutionResultStepResult.of(contentList)for multimodal outputs). - Reading: Use
step.result().flatMap(CodeExecutionResultStepResult::string)for a string result, orstep.result().flatMap(CodeExecutionResultStepResult::arrayOfContent)for multimodalList<Content>output.
- Constructing: Use
- The wire JSON for text-only results is unchanged, but Java code constructing or reading
Features
- Add
source_texttoAudioTranscriptionConfigandSmartTranscriptionMode. (04a5b93) - Add MALFORMED_RESPONSE to FinishReason (f96561b), refs #2937
- cli: use gemini-3.5-transcribe as default model for transcribe command (bc3779f)
- default Gemini API version to v1 instead of v1beta across SDKs (88bc413)
- Disable GenerateVideos for Gemini API, update tests/READMEs (30cb945)
- interactions: add Office and OpenDocument MIME types (e8448b2)
- interactions: support multimodal content in CodeExecutionResultStep.result (e551d17)
- support GOOGLE_GENAI_API_VERSION environment variable across SDKs (88bc413)
- update discovery doc (9bd8ae3)
Bug Fixes
- refresh the access token on every HTTP attempt so retries and queued async calls do not send an expired token (eb3a674)
- respect configured and default API version for Gemini API file uploads across SDKs (22ad0a9)
- stop Vertex replay clients from fetching real OAuth tokens (524d7c8)
Documentation
- clarify that ClientOptions.maxConnections and maxConnectionsPerHost only limit asynchronous requests (e742930)
- update remaining documentation links from ai.google.dev to aistudio.google.com. (17d87f4)
Miscellaneous Chores
- set version to 2.0.0 (6f06afe)
v1.80.0
1.80.0 (2026-10-29)
Features
- Add support for continuation_token and requires_continuation status (79097b6)
- add video upscale task parameter (ff129dd)
- interactions: add automaticContinuation to Interactions.create in the Java SDK (5691ac2)
- interactions: declare continuation_ids on Interaction (9695964)
- support video understanding in Gemini Developer API (c6b8380)
Bug Fixes
- interactions: align SDK User-Agent and x-goog-api-client headers (5a1389f)
v1.79.0
1.79.0 (2026-10-22)
Features
- Add
storetoGenerateContentConfig(Gemini Developer API only) andlabelstoLiveConnectConfig. (912b141) - add base_voice to PromptedVoice in GAOS SDK (9fbbc95)
- Add generation_output_config to GenerateContentConfig (eabd2d1)
- Add Live API in-session context updates (
send_context_update) and types across GenAI SDKs. (89ef7e5) - include AudioContent, DocumentContent, and VideoContent in FunctionResultSubContent (ac14f74)
- interactions: populate output_text and output media helpers in the Java SDK (1ca9c62)
- update discovery doc (c00afaf)
Bug Fixes
- Create the LocalTokenizerLoader HTTP client lazily so GraalVM native builds succeed (42dea8b), refs #978
- interactions: sync InteractionSseEventInteractionStatus enum with InteractionStatus (5584baa)
- Support fractional-second durations (e.g. "1.5s") in Duration fields (453c442)
- triggers: fix agent triggers OpenAPI overlays, numeric fields, and SDK patches (80b6d5e)
- update Jackson to 2.18.11 (2b42dd6)
Documentation
- Update unenforced JSON Schema keywords on Interactions schema fields. (381cc56)