Bug description global has never been able to be used as a location for gemini function calling. I've always had to use a specific region. gemini-3-pro-preview is only available in global so need fix for this issue

https://global-aiplatform.googleapis.com:443/v1/projects/your-project-id/locations/global/publishers/google/models/gemini-3-pro-preview:generateContent?$alt=json;enum-encoding%3Dint

I assume the issue is the same as other repos where location is appended to the base URL, however when global is needed, this should not be appending.

Correct URL

https://aiplatform.googleapis.com:443/v1/projects/your-project-id/locations/global/publishers/google/models/gemini-3-pro-preview:generateContent?$alt=json;enum-encoding%3Dint

Environment I'm using Spring AI 2.0.0-M1 so I can use gemini3 but this has been a longstanding issue with all previous versions I believe

Steps to reproduce

spring:
  ai:
    vertex:
      ai:
        gemini:
          chat:
            options:
              model: gemini-3-pro-preview
          location: global
          project-id: your-project-id

Expected behavior Should be able to retrieve data from gemini-3-pro-preview

Minimal Complete Reproducible example Should be just using spring ai 2.0.0-M1 with gemini-3-pro-preview

var responseContent = chatClient.prompt()
        .user("some string")
        .system(SYSTEM_PROMPT)
        .advisors(
            advisorSpec -> advisorSpec.param(ChatMemory.CONVERSATION_ID, conversationId)
                .param("userId", userId)
        ).call().content();