github googleapis/go-genai v1.78.0

one hour ago

1.78.0 (2026-11-17)

⚠ BREAKING CHANGES

  • Default Gemini Developer API version is now v1 (was v1beta) (402dc81)
    • Clients targeting the Gemini Developer API (the default backend, genai.BackendGeminiAPI) now default to API version v1 instead of v1beta.

      Note for Go users: Although this default change is a runtime breaking change, we are shipping it in a minor v1.x release rather than v2.0.0 as the less disruptive of the two options. In Go, a v2 major version bump changes the module path to google.golang.org/genai/v2, which breaks every user and downstream library by forcing import rewrites across the ecosystem—even though no Go types or function signatures changed. Shipping in v1.x keeps existing imports and builds working, leaves most code unaffected, and lets anyone who needs the previous v1beta behavior restore it with a single config field or environment variable (see below).

    • No effect on Gemini Enterprise (Vertex AI) defaults: Clients using genai.BackendVertexAI (or GOOGLE_GENAI_USE_VERTEXAI=true) are unaffected by this default change and continue to default to v1beta1.
    • Some models are not available on v1, notably: the gemini-flash-latest, gemini-flash-lite-latest, and gemini-pro-latest aliases, some -preview models, and models that depend on v1beta-only features (such as TTS models). They exist only on v1beta. To keep using them, use a specific stable model version, or switch back to v1beta as shown below.
    • Some APIs are not available on v1: The Live API (client.Live), context caching (client.Caches), and beta platform services (client.Agents, client.Decisions, client.Webhooks) are served only on v1beta in the Gemini Developer API. To keep using them, 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: Set APIVersion in HTTPOptions (takes precedence over GOOGLE_GENAI_API_VERSION):
      import (
      	"context"
      
      	"google.golang.org/genai"
      )
      
      client, err := genai.NewClient(context.Background(), &genai.ClientConfig{
      	HTTPOptions: genai.HTTPOptions{APIVersion: "v1beta"},
      })

Features

  • add gemini-omni-1.2-flash and make it the gemini-api video default (04c227d)
  • Add proactive_video to ProactivityConfig for the Live API. (4ac9851)
  • Add source_text to AudioTranscriptionConfig and SmartTranscriptionMode. (2b4e897)
  • Add XHIGH and xhigh to ThinkingLevel across GenAI SDKs and CLI. (78c23d6)
  • add xhigh thinking level to Interactions ThinkingLevel (5a3af4c)
  • Add MALFORMED_RESPONSE to FinishReason (6ba4b48), refs #2937
  • Add missing enum values to FinishReason and ReinforcementTuningThinkingLevel (9517de6)
  • add the Decisions API (client.decisions.create) to the GenAI SDKs (4e1c734)
  • Add tool search types to the Interactions SDKs (f2b5eea)
  • add usage_metadata (including traffic_type) and truncated to EmbedContentResponse for Gemini Enterprise API (850cdca)
  • cli: use gemini-3.5-transcribe as default model for transcribe command (968e135)
  • default Gemini API version to v1 instead of v1beta across SDKs (402dc81)
  • Disable GenerateVideos for Gemini API, update tests/READMEs (9cf04de)
  • environments: introduce self-hosted BYOS mode, system_instruction, custom_config, and environment_key in SDKs and CLI (eeafe6c)
  • environments: introduce self-hosted BYOS mode, system_instruction, custom_config, and environment_key in SDKs and CLI (ac12b34)
  • interactions: add gemini-4-carbon and gemini-omni-1.2-flash to Model enum (e08c6be)
  • interactions: add gemini-4-hydrogen to Model enum (1b7b34c)
  • interactions: add Office and OpenDocument MIME types (36ba34e)
  • interactions: expose static file processing options (5d76cf0)
  • interactions: support multimodal content in CodeExecutionResultStep.result (0872815)
  • support batch inputs and usage metadata for Gemini embedding models on Gemini Enterprise API (c1a7aa2)
  • support GOOGLE_GENAI_API_VERSION environment variable across SDKs (402dc81)
  • update discovery doc (8653ef7)

Bug Fixes

  • do not panic on a null element in a converted response slice or a null response body (c7c9c43), refs #899
  • overlays: fail CLI commands on failed interactions, redact tool headers, narrow ModelInteraction.required (34be134)
  • respect configured and default API version for Gemini API file uploads across SDKs (da10e09)
  • stop percent-encoding the Vertex resource prefix in Interactions URLs (4348fe0), refs #960

Miscellaneous Chores

Don't miss a new go-genai release

NewReleases is sending notifications on new releases.