Skip to content

Release Notes v4

Gunpal Jain edited this page Nov 15, 2026 · 4 revisions

Release Notes: v4.0.0

v4.0.0 adds support for the current Gemini API and Vertex AI: new APIs, current model IDs, .NET 10/11 targets, and updated dependencies. Upgrading from 3.x? Read the Migration Guide v4 first.

Previous release: 3.6.9.


Highlights

  • New APIs: Interactions, File Search, Webhooks, ephemeral Live API tokens, Model Tuning, Live Music, and the Agent APIs (Agents, Environments, Triggers, Credentials, Decisions, Voices).
  • Current models: Gemini 4, Gemini 3.x, Gemini 3.8 Live and TTS, Nano Banana 2.1, Gemini Omni video, Lyria and Gemini Embedding 2. Retired models are marked [Obsolete] with their replacements. See Supported Models.
  • Default model is now gemini-3.8-flash.
  • .NET 10 and .NET 11 target frameworks.
  • Better errors: Google error details come back as ApiException for every request, including streaming and file uploads.
  • Automatic continuation: generateContent and Interactions follow continuation tokens on their own.

New features

Interactions API (Interactions-API)

  • InteractionsClient (GenAI.CreateInteractionsClient()): CreateAsync, StreamAsync, GetAsync, ResumeStreamAsync, CancelAsync, DeleteAsync, WaitForCompletionAsync, ContinueAsync.
  • Follows requires_continuation automatically (EnableAutomaticContinuation, MaxContinuations = 10). Background interactions are not continued.
  • Resumes a dropped stream from the last event (MaxStreamReconnects = 3).
  • Agent model constants: GoogleAIModels.Agents.DeepResearchPreview042026, DeepResearchMaxPreview042026, AntigravityPreview092026.

File Search (File-Search)

  • FileSearchStoresClient (GoogleAi.CreateFileSearchStoresClient()): create, get, list and delete stores; upload files or streams; import from the Files API; manage documents and operations; download media.
  • GenerativeModel.UseFileSearch(...) and the new Tool.FileSearch tool, plus ChunkingConfig and grounding metadata for retrieved context.

Webhooks (Webhooks)

  • WebhooksClient (GenAI.CreateWebhooksClient()): create, get, list, update, delete, ping and rotate the signing secret.
  • BatchClient.CreateAsync(model, source, destination, webhookConfig, ...) sends a per-job WebhookConfig. This works on the Gemini API only; Vertex AI throws NotSupportedException. See Batch API.
  • Ephemeral auth tokens: AuthTokensClient.CreateAsync(CreateAuthTokenConfig) (Gemini API, v1alpha). When you pass an auth_tokens/... token as the key, MultiModalLiveClient connects to the constrained endpoint, so client apps don't need the API key.
  • New client methods: SendRealtimeInputAsync, SendVideoFrameAsync, SendRealtimeTextAsync, SendActivityStartAsync/SendActivityEndAsync (manual voice activity detection), SendAudioStreamEndAsync, and SendContextUpdateAsync (change the system instruction or tools during a session).
  • New setup options: RealtimeInputConfig, SessionResumption, ContextWindowCompression, Proactivity, HistoryConfig, input/output audio transcription configs, and translation.
  • Reconnects re-send setup and resume the session (ResendSetupOnReconnect, LastSessionResumptionHandle). New TurnCompleted event. Exceptions in handlers go to ErrorOccurred.
  • Live Music (Lyria RealTime): LiveMusicClient with SetWeightedPromptsAsync, SetMusicGenerationConfigAsync, PlayAsync/PauseAsync/StopAsync/ResetContextAsync (Gemini API).

Model tuning (Model-Tuning)

  • TuningClient (GenAI.CreateTuningClient()): tune, get, list, cancel, wait for completion, and validate rewards. Covers Vertex AI tuning jobs (supervised, preference, distillation, reinforcement, Veo LoRA) and Gemini API tuned models.
  • ModelClient.UpdateModelAsync, DeleteModelAsync, and Vertex ComputeTokensAsync.
  • FileClient.DownloadFileAsync and RegisterFilesAsync.

Agent APIs (Agent-APIs)

  • AgentsClient, EnvironmentsClient (including workspace file upload and download), TriggersClient (create, update, pause, resume, run, executions, WaitForExecutionAsync), CredentialsClient, DecisionsClient (gemini-decision-1), and VoicesClient (design, remix and replicate voices). All are created from GenAI factory methods (CreateAgentsClient() and so on).

Vertex RAG Engine (Vertex-RAG-Engine)

  • VertexRagManager.GetEngineConfigAsync, UpdateEngineConfigAsync and SwitchToServerlessModeAsync (RagEngineConfig, RagManagedDbConfig.CreateServerless()).
  • RAG operation errors now include the error code.

Generation, tools and configuration

  • Automatic continuation in GenerateContentAsync and StreamContentAsync (GenerativeModel.EnableAutomaticContinuation, MaxContinuations). See Configuration and Error Handling.
  • GOOGLE_GENAI_API_VERSION environment variable sets the default API version (beta means v1beta/v1beta1). ApiVersions.v1Alpha added.
  • Structured error parsing: both object and array error bodies, the HTTP status used when the body has no code, and consistent ApiException for streaming and uploads.
  • New request and config fields: ServiceTier (ServiceTiers.Standard/Flex/Priority), Store, Labels, ContinuationToken, ModelArmorConfig, ResponseFormat, per-part media resolution, image output options (PersonGeneration, OutputMimeType, OutputCompressionQuality), AudioTranscriptionConfig and TranslationConfig.
  • New tools: FileSearch, McpServers (server-side MCP), ParallelAiSearch, ExaAiSearch, plus updated Google Search, Google Maps, Computer Use and Vertex tool options.
  • New response fields: finish and block reasons, model status, traffic type, and server-side tool invocations.

Embeddings (Embeddings)

  • GeminiEmbedding2 added. The SDK accepts prefixed model IDs (models/..., publishers/google/models/...).
  • Vertex AI embeddings use Vertex's request format (embedContent or predict). New Vertex-only options: AutoTruncate, DocumentOcr, AudioTrackExtraction, MimeType.
  • CancellationToken is passed through to the HTTP request.

Image and video generation (Image-Generation, Video-Generation)

  • Gemini image models: GeminiNanoBanana21, Gemini31FlashImage, Gemini31FlashLiteImage, Gemini3ProImage. GenerativeAIImageGenerator now defaults to Nano Banana 2.1.
  • Video on the Gemini API: Gemini Omni (GoogleAIModels.Video.GeminiOmni12Flash) through the Interactions API.

Context caching (Context-Caching)

  • No API changes. Docs and samples now use current model IDs.

Model and platform changes

  • Imagen retired: Google retired Imagen on the Gemini API and, on June 30, 2026, on Vertex AI. ImagenModel, GenAI.CreateImageModel, GenerativeAIImagenGenerator and the Imagen model constants are marked [Obsolete]; use the Gemini image models and GenerativeAIImageGenerator.
  • Veo retired on the Gemini API: VideoGenerationModel now throws NotSupportedException on the Gemini API. Use Veo on Vertex AI or Gemini Omni.
  • Retired and deprecated model constants are [Obsolete] with replacement guidance. text-embedding-004, the Gemini 2.0 family, Gemini 2.5 previews, and Gemini 3 Pro Preview are shut down. gemini-2.5-flash and gemini-2.5-pro are deprecated, and from December 1, 2026 Google routes them to newer models.
  • Semantic Retrieval / AQA is now legacy. See Legacy Semantic Retrieval (AQA).
  • Google deprecated temperature, topP and topK for Gemini 3.6+ models. The SDK never sets them on its own.
  • Vertex AI: Google serves the newest Gemini models from the global location.

Fixes

  • Function results are sent with the user role. Gemini 3.x rejects function, and old histories are converted automatically.
  • Microsoft.Extensions.AI chat client: fixed duplicated model turns with parallel function calls (which gave empty answers), and streaming function calls in chunks before the last one are no longer missed.
  • AsEmbeddingGenerator() defaulted to the shut-down text-embedding-004. It now uses gemini-embedding-001.
  • Vertex batch cancel now calls :cancel.
  • VertexRagManager.AwaitForLongRunningOperation honours timeOut.
  • VertextPlatformAdapter honours validateAccessToken.
  • AddGenerativeAI(options) with only an API key no longer switches to Vertex AI because GOOGLE_PROJECT_ID is set.
  • Live API: GoAway and session resumption messages now match the wire format. SendSetupAsync sends SafetySettings. Reconnection disposes old sockets.
  • RemoteFileContent without a URI throws instead of sending an empty file URI.
  • Fixed all 277 build warnings across target frameworks. Resolved open Dependabot vulnerability alerts.

Breaking changes (summary)

See the Migration Guide v4 for code samples.

  1. BaseModel.EmbedContentAsync/BatchEmbedContentAsync (protected virtual) now take a CancellationToken. Overrides must be updated.
  2. Function-result Content uses Roles.User instead of Roles.Function.
  3. DefaultGeminiModel changed to gemini-3.8-flash. The default models for AsEmbeddingGenerator and GenerativeAIImageGenerator changed.
  4. Retired model constants are [Obsolete] (warning CS0618).
  5. Veo on the Gemini API throws NotSupportedException.
  6. Live API: the old GoAway and session resumption properties are [Obsolete]. Use TimeLeft, NewHandle and Resumable.
  7. IPlatformAdapter.GetBaseUrl parameter renamed from appendVesion to appendVersion.
  8. Streaming and upload errors throw ApiException instead of HttpRequestException when the body is a Google error.
  9. Dependencies: Microsoft.Extensions.* 10.x/11.x, Microsoft.Extensions.AI 10.11/11.0, ModelContextProtocol 2.4.0.

Dependencies and target frameworks

  • Added net10.0 to all packages. net11.0 is added when the package is built with the .NET 11 SDK.
  • Microsoft.Extensions.* and System.Text.Json: 10.0.15 on net8.0/net9.0; 11.0.0 on net10.0+, netstandard2.0 and net462.
  • Microsoft.Extensions.AI.Abstractions: 10.11.0 on net8.0/net9.0; 11.0.0 elsewhere.
  • ModelContextProtocol 2.4.0, CSharpToJsonSchema 3.10.6, Websocket.Client 5.5.1, Google.Apis.Auth 1.78.0.

Update: 4.0.1

4.0.1 keeps the model catalogue in line with Google's model lifecycle.

Breaking for code that uses retired models: constants for models that Google has shut down were removed. See Supported Models: Removed in 4.0.1 for the replacement for each one.

  • Removed constants for shut-down models:
    • Gemini API: Gemini 2.0, older 2.5 preview and experimental models, Gemma 3 and 3n, text-embedding-004 and embedding-001, Imagen, and Veo.
    • Vertex AI: Gemini 2.0, older 2.5 previews, the textembedding-gecko models, code-gecko, Imagen, and Veo 2.0 and 3.0.
  • New model constants:
    • Gemini37Flash and Gemini35Flash on both platforms.
    • On Vertex AI: Gemini38FlashCyber, Gemini38FlashLiteTts, Gemini31FlashImage, Gemini31FlashLiteImage, Gemini25FlashImage, Video.GeminiOmni12Flash, Video.Veo31Generate001 and Video.Veo31FastGenerate001.
  • Video: VideoGenerationModel defaults to Veo 3.1 (veo-3.1-generate-001).
  • Live API: MultiModalLiveClient requests audio responses by default, which current Live models require.
  • Deprecations:
    • ImagenModel, GenAI.CreateImageModel, GenerativeAIImagenGenerator, ImageTextModel and VertexAI.CreateImageTextModel are [Obsolete], because Google has retired those models. See Image Generation.
    • The Vertex AI Gemini36Flash and Gemini 2.5 constants are [Obsolete] as they reach retirement.

Clone this wiki locally