Skip to content

feat(ai): add google vertex ai platform support for google ai provider#7769

Draft
claude[bot] wants to merge 2 commits intomainfrom
claude/issue-7768-20260203-1152
Draft

feat(ai): add google vertex ai platform support for google ai provider#7769
claude[bot] wants to merge 2 commits intomainfrom
claude/issue-7768-20260203-1152

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Feb 3, 2026

Summary

Adds support for Google Vertex AI platform to the Google AI provider, similar to how Anthropic already supports Vertex AI through a platform field on resources.

This allows users to use Google's Gemini models through Vertex AI instead of the standard Google AI endpoint, enabling enterprise customers to use their GCP infrastructure for AI requests.

Closes #7768

Changes

  • Added GoogleAIPlatform enum with Standard and GoogleVertexAi variants (in both windmill-api and windmill-worker)
  • Added google_platform field to ProviderResource and AIRequestConfig structs
  • Updated GoogleAIQueryBuilder to accept and handle the platform parameter
  • Modified endpoint URL construction for Vertex AI (uses base URL directly without adding /models/ prefix)
  • Changed authentication for Vertex AI to use Bearer token (OAuth2 access token from gcloud auth print-access-token) instead of x-goog-api-key
  • Updated AI proxy request handling to properly route Google AI Vertex requests

Test plan

  • Configure a Google AI resource with google_platform: "google_vertex_ai" and baseUrl pointing to Vertex AI endpoint (e.g., https://{region}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models)
  • Set apiKey to a GCP OAuth2 access token (from gcloud auth print-access-token)
  • Verify AI chat works with Gemini models through Vertex AI
  • Verify standard Google AI (without Vertex) still works correctly

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 3, 2026

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6518ed1
Status: ✅  Deploy successful!
Preview URL: https://7e3fda89.windmill.pages.dev
Branch Preview URL: https://claude-issue-7768-20260203-1.windmill.pages.dev

View logs

@centdix
Copy link
Collaborator

centdix commented Feb 3, 2026

/ai there should not be a google_platform in AIResource, platform should be either anthropicplatform or googleplatform. also it seems there is useless duplicate code, clean the code

@claude
Copy link
Contributor Author

claude bot commented Feb 3, 2026

Claude finished @centdix's task in 3m 49s —— View job


Refactoring Google Vertex AI Platform Support

  • Analyze current implementation and identify issues
  • Refactor to use a unified AIPlatform enum (removing separate google_platform field)
  • Remove duplicate code in the Google AI provider
  • Run cargo check to validate changes
  • Commit and push changes

Summary:

Refactored the Google Vertex AI platform support to remove duplicate code and use a unified platform enum. Changes made:

  1. Merged enums: Combined AnthropicPlatform and GoogleAIPlatform into a single AIPlatform enum with variants Standard and GoogleVertexAi

  2. Removed duplicate google_platform field: The platform field now works for both Anthropic and Google AI providers since both support the same values

  3. Simplified resource structs: AIStandardResource, AIRequestConfig, and ProviderResource now only have a single platform field

  4. Cleaned up provider code: Both AnthropicQueryBuilder and GoogleAIQueryBuilder now use AIPlatform instead of their separate enums

Result: Reduced code by 29 lines while maintaining full functionality. Resources can now be configured with a single platform field that works for both providers.
|

- Merge AnthropicPlatform and GoogleAIPlatform into a single AIPlatform enum
- Remove duplicate google_platform field from AIStandardResource, AIRequestConfig, and ProviderResource
- Both Anthropic and Google AI providers now use the same platform field to indicate Vertex AI usage
- Simplify ProviderWithResource to have a single get_platform() method

This reduces code duplication and makes the resource configuration cleaner -
the same platform field works for both providers since both support the same
values (standard and google_vertex_ai).

Co-authored-by: centdix <centdix@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ai): handle google models through vertex AI

1 participant