Skip to content

.Net: Bug: GeminiChatCompletionClient (Vertex AI) with location "global" always results in a 404 #12525

Open
@schneini

Description

@schneini

Describe the bug
Using GeminiChatCompletionClient (Vertex AI) with location global will always result in a 404.

Some models are only available when using global as the location. See here: https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations. A current example would be gemini-2.5-flash-lite-preview-06-17, which is only listed under Global.

The issue is that the URL in GeminiChatCompletionClient (and possibly other clients as well) is constructed like this: {location}-aiplatform.googleapis.com, which means that the URL will be global-aiplatform.googleapis.com, which is incorrect. The correct URL for the global location is aiplatform.googleapis.com (no location prepended).

To Reproduce
Use the VertexAIUsingChatCompletion example with location global:
https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Concepts/ChatCompletion/Google_GeminiChatCompletion.cs

Expected behavior
The correct URL is used when using global as the location.

Platform

  • Language: C#
  • Source: NuGet package version 1.57.0
  • AI model: gemini-2.5-flash-lite-preview-06-17

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET codebugSomething isn't working

Type

Projects

Status

Sprint: Planned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions