[Tracker]
Update Summary: Vertex AI provider should support global and multi-region Gemini AI endpoints
Check-in Date: MM/DD/YYYY
Additional Collaborators:
Metadata is used by the AI Tracker. Docs and additional fields here.
[/Tracker]
Problem/Motivation
Google's Gemini 3 models are only available to global and multi-region locations like us and eu right now. This means that the regular locations like 'us-central1' or 'us-west1', etc. cannot be used with the newer models.
For this module that causes 404 not founds because the URL for global and multi-region locations is different from the other location URLs. From their documentation https://docs.cloud.google.com/gemini-enterprise-agent-platform/resources...
Note: When using the global endpoint, use https://aiplatform.googleapis.com/v1/projects/${GOOGLE_CLOUD_PROJECT}/locations/global/publishers/google/models/${MODEL_ID}:generateContent instead of a service endpoint prepended with https://${GOOGLE_CLOUD_LOCATION}-aiplatform.googleapis.com.
For the us and eu multi-regions we have these URLs:
Proposed resolution
Adjust the hardcoded endpoint URLs to incorporate global and multi-region options.
Hardcoded location endpoint https://git.drupalcode.org/project/ai_provider_google_vertex/-/blob/2.x/...
Target date or deadline
Remaining tasks
AI usage (if applicable)
[ ] AI Assisted Issue
This issue was generated with AI assistance, but was reviewed and refined by the creator.
[ ] AI Assisted Code
This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.
[ ] AI Generated Code
This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.
[ ] Vibe Coded
This code was generated by an AI and has only been functionally tested.
Issue fork ai_provider_google_vertex-3592824
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
dmundraComment #3
dmundraComment #6
dmundraThe fix is simple, just have to set the different endpoints if using global or us/eu locations.
Comment #7
dmundraOkay now ready for review after fixing some typos and phpcs cleanup.
Comment #9
dmundraI believe this fix should also work on 2.x so created a MR request there as well. Not sure if that is better for final merging but might be helpful for testing.