Skip to content

v2.0.0

Latest

Choose a tag to compare

@release-please release-please released this 06 Nov 02:35
0379a6a

2.0.0 (2026-11-06)

⚠ BREAKING CHANGES

  • Default Gemini Developer API version is now v1 (was v1beta) (88bc413)

    • Clients targeting the Gemini Developer API now default to API version v1 instead of v1beta.
    • No effect on Gemini Enterprise (Vertex AI) defaults: Clients with .enterprise(true) are unaffected by this default change and continue to default to v1beta1.
    • Some model aliases are not available on v1, notably: gemini-flash-latest, gemini-flash-lite-latest and gemini-pro-latest. They exist only on v1beta. To keep using them, use a specific model version, or switch back to v1beta as 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 HttpOptions when building the Client (takes precedence over GOOGLE_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();
  • interactions: CodeExecutionResultStep.result changed from String to the CodeExecutionResultStepResult union (e551d17)

    • The wire JSON for text-only results is unchanged, but Java code constructing or reading CodeExecutionResultStep.result() must now use CodeExecutionResultStepResult:
      • Constructing: Use CodeExecutionResultStepResult.of("...") (or CodeExecutionResultStepResult.of(contentList) for multimodal outputs).
      • Reading: Use step.result().flatMap(CodeExecutionResultStepResult::string) for a string result, or step.result().flatMap(CodeExecutionResultStepResult::arrayOfContent) for multimodal List<Content> output.

Features

  • Add source_text to AudioTranscriptionConfig and SmartTranscriptionMode. (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