Skip to content

feat: add Vertex AI provider for Google Cloud AI/ML integration#6264

Open
duckyduckycode wants to merge 1 commit intokeephq:mainfrom
duckyduckycode:feat/vertexai-provider
Open

feat: add Vertex AI provider for Google Cloud AI/ML integration#6264
duckyduckycode wants to merge 1 commit intokeephq:mainfrom
duckyduckycode:feat/vertexai-provider

Conversation

@duckyduckycode
Copy link
Copy Markdown

Summary

Adds a new Vertex AI provider that integrates Keep with Google Cloud Vertex AI, resolving #6087.

Vertex AI is Google Cloud's unified ML platform providing access to foundation models (Gemini, etc.) for text generation, structured output, and AI-powered workflows within Keep.

What Changed

New Provider: keep/providers/vertexai_provider/

Dual Authentication Support:

  • API Key mode — Simple setup using Google AI Studio / Vertex AI express mode API key
  • Service Account mode — Full Vertex AI with service account JSON + project ID + region selection, supporting GKE workload identity

Features:

  • _query() method following the same pattern as Anthropic/Gemini/OpenAI providers
  • Configurable model selection (default: gemini-2.0-flash, supports all Gemini models)
  • Structured output via JSON schema (system instruction injection)
  • Automatic JSON response parsing
  • Temperature and max_tokens parameters
  • All 11 major Vertex AI regions
  • Comprehensive error handling with clear error messages

Files Added

  • keep/providers/vertexai_provider/__init__.py
  • keep/providers/vertexai_provider/vertexai_provider.py
  • tests/providers/vertexai_provider/test_vertexai_provider.py
  • docs/providers/documentation/vertexai-provider.mdx

Usage in Workflows

actions:
  - name: classify-alert
    provider:
      type: vertexai
      config: "{{ providers.vertexai }}"
    with:
      prompt: "Classify this alert severity: {{ alert.message }}"
      model: gemini-2.0-flash
      structured_output_format:
        type: json_schema
        json_schema:
          name: severity_classification
          schema:
            type: object
            properties:
              severity:
                type: string
                enum: ["critical", "high", "medium", "low", "info"]
            required: ["severity"]
            additionalProperties: false
          strict: true

Testing

15 unit tests covering:

  • Auth config validation (API key, service account, missing auth, missing project)
  • Provider initialization and type extraction
  • Basic query functionality
  • JSON auto-parsing
  • Plain text preservation
  • Structured output with system instruction
  • Model selection
  • Temperature parameter
  • Default model verification
  • dispose() lifecycle

Checklist

  • Provider follows existing naming convention (*_provider)
  • __init__.py exports provider class and auth config
  • validate_config() implemented
  • dispose() implemented
  • PROVIDER_DISPLAY_NAME, PROVIDER_CATEGORY, PROVIDER_TAGS set
  • Documentation added
  • Unit tests added
  • No breaking changes to existing providers

Resolves #6087

Adds a new Vertex AI provider that integrates Keep with Google Cloud's
unified ML platform, resolving keephq#6087.

Features:
- Dual authentication: API key (express mode) and service account (full Vertex AI)
- Support for all 11 Vertex AI regions
- Structured output via JSON schema
- Configurable model selection (gemini-2.0-flash default)
- Temperature and max_tokens parameters
- Automatic JSON response parsing
- Workload identity support for GKE deployments
- Comprehensive unit tests (15 test cases)

Follows the same pattern as existing AI providers (Anthropic, Gemini, OpenAI)
with the _query method for Keep workflow integration.
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 19, 2026
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dosubot dosubot Bot added Documentation Improvements or additions to documentation Feature A new feature Provider Providers related issues labels Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation Feature A new feature Provider Providers related issues size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🔌 Provider]: Vertex AI

2 participants