Repository navigation
Release Notes v4
Gunpal Jain edited this page Nov 15, 2026
·
4 revisions
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.
- 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
ApiExceptionfor every request, including streaming and file uploads. -
Automatic continuation:
generateContentand Interactions follow continuation tokens on their own.
Interactions API (Interactions-API)
-
InteractionsClient(GenAI.CreateInteractionsClient()):CreateAsync,StreamAsync,GetAsync,ResumeStreamAsync,CancelAsync,DeleteAsync,WaitForCompletionAsync,ContinueAsync. - Follows
requires_continuationautomatically (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 newTool.FileSearchtool, plusChunkingConfigand 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-jobWebhookConfig. This works on the Gemini API only; Vertex AI throwsNotSupportedException. See Batch API.
Live API (Multimodal-Live-API)
-
Ephemeral auth tokens:
AuthTokensClient.CreateAsync(CreateAuthTokenConfig)(Gemini API,v1alpha). When you pass anauth_tokens/...token as the key,MultiModalLiveClientconnects 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, andSendContextUpdateAsync(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). NewTurnCompletedevent. Exceptions in handlers go toErrorOccurred. -
Live Music (Lyria RealTime):
LiveMusicClientwithSetWeightedPromptsAsync,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 VertexComputeTokensAsync. -
FileClient.DownloadFileAsyncandRegisterFilesAsync.
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), andVoicesClient(design, remix and replicate voices). All are created fromGenAIfactory methods (CreateAgentsClient()and so on).
Vertex RAG Engine (Vertex-RAG-Engine)
-
VertexRagManager.GetEngineConfigAsync,UpdateEngineConfigAsyncandSwitchToServerlessModeAsync(RagEngineConfig,RagManagedDbConfig.CreateServerless()). - RAG operation errors now include the error code.
-
Automatic continuation in
GenerateContentAsyncandStreamContentAsync(GenerativeModel.EnableAutomaticContinuation,MaxContinuations). See Configuration and Error Handling. -
GOOGLE_GENAI_API_VERSIONenvironment variable sets the default API version (betameansv1beta/v1beta1).ApiVersions.v1Alphaadded. -
Structured error parsing: both object and array error bodies, the HTTP status used when the body has no code, and
consistent
ApiExceptionfor 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),AudioTranscriptionConfigandTranslationConfig. - 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)
-
GeminiEmbedding2added. The SDK accepts prefixed model IDs (models/...,publishers/google/models/...). - Vertex AI embeddings use Vertex's request format (
embedContentorpredict). New Vertex-only options:AutoTruncate,DocumentOcr,AudioTrackExtraction,MimeType. -
CancellationTokenis passed through to the HTTP request.
Image and video generation (Image-Generation, Video-Generation)
- Gemini image models:
GeminiNanoBanana21,Gemini31FlashImage,Gemini31FlashLiteImage,Gemini3ProImage.GenerativeAIImageGeneratornow 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.
-
Imagen retired: Google retired Imagen on the Gemini API and, on June 30, 2026, on Vertex AI.
ImagenModel,GenAI.CreateImageModel,GenerativeAIImagenGeneratorand the Imagen model constants are marked[Obsolete]; use the Gemini image models andGenerativeAIImageGenerator. -
Veo retired on the Gemini API:
VideoGenerationModelnow throwsNotSupportedExceptionon 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-flashandgemini-2.5-proare 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,topPandtopKfor Gemini 3.6+ models. The SDK never sets them on its own. - Vertex AI: Google serves the newest Gemini models from the
globallocation.
- Function results are sent with the
userrole. Gemini 3.x rejectsfunction, 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-downtext-embedding-004. It now usesgemini-embedding-001. - Vertex batch cancel now calls
:cancel. -
VertexRagManager.AwaitForLongRunningOperationhonourstimeOut. -
VertextPlatformAdapterhonoursvalidateAccessToken. -
AddGenerativeAI(options)with only an API key no longer switches to Vertex AI becauseGOOGLE_PROJECT_IDis set. - Live API:
GoAwayand session resumption messages now match the wire format.SendSetupAsyncsendsSafetySettings. Reconnection disposes old sockets. -
RemoteFileContentwithout a URI throws instead of sending an empty file URI. - Fixed all 277 build warnings across target frameworks. Resolved open Dependabot vulnerability alerts.
See the Migration Guide v4 for code samples.
-
BaseModel.EmbedContentAsync/BatchEmbedContentAsync(protected virtual) now take aCancellationToken. Overrides must be updated. - Function-result
ContentusesRoles.Userinstead ofRoles.Function. -
DefaultGeminiModelchanged togemini-3.8-flash. The default models forAsEmbeddingGeneratorandGenerativeAIImageGeneratorchanged. - Retired model constants are
[Obsolete](warning CS0618). - Veo on the Gemini API throws
NotSupportedException. - Live API: the old
GoAwayand session resumption properties are[Obsolete]. UseTimeLeft,NewHandleandResumable. -
IPlatformAdapter.GetBaseUrlparameter renamed fromappendVesiontoappendVersion. - Streaming and upload errors throw
ApiExceptioninstead ofHttpRequestExceptionwhen the body is a Google error. - Dependencies: Microsoft.Extensions.* 10.x/11.x, Microsoft.Extensions.AI 10.11/11.0, ModelContextProtocol 2.4.0.
- 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.
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-004andembedding-001, Imagen, and Veo. -
Vertex AI: Gemini 2.0, older 2.5 previews, the
textembedding-geckomodels,code-gecko, Imagen, and Veo 2.0 and 3.0.
-
Gemini API: Gemini 2.0, older 2.5 preview and experimental models, Gemma 3 and 3n,
-
New model constants:
-
Gemini37FlashandGemini35Flashon both platforms. - On Vertex AI:
Gemini38FlashCyber,Gemini38FlashLiteTts,Gemini31FlashImage,Gemini31FlashLiteImage,Gemini25FlashImage,Video.GeminiOmni12Flash,Video.Veo31Generate001andVideo.Veo31FastGenerate001.
-
-
Video:
VideoGenerationModeldefaults to Veo 3.1 (veo-3.1-generate-001). -
Live API:
MultiModalLiveClientrequests audio responses by default, which current Live models require. -
Deprecations:
-
ImagenModel,GenAI.CreateImageModel,GenerativeAIImagenGenerator,ImageTextModelandVertexAI.CreateImageTextModelare[Obsolete], because Google has retired those models. See Image Generation. - The Vertex AI
Gemini36Flashand Gemini 2.5 constants are[Obsolete]as they reach retirement.
-
Getting Started
- Initialization
- Authentication
- Configuration & Error Handling
- Supported Models
- Migration Guide (v4)
- Release Notes (v4)
Core Features
- Generate Content
- Chat Session
- Streaming
- Multimodal Features
- JSON Mode
- Function Calling
- Embeddings
- Context Caching
Gemini APIs
- Interactions API
- Multimodal Live API
- File Search
- Batch API
- Model Tuning
- Webhooks
- Agent APIs
- Image Generation
- Video Generation
- Speech Generation
- Files Client
- Model Client
Vertex AI
Integrations
Guides
Legacy