Skip to content

feat(js/plugins/google-genai): PayGo support for priority and flex#5191

Open
ifielker wants to merge 2 commits intomainfrom
if-paygo
Open

feat(js/plugins/google-genai): PayGo support for priority and flex#5191
ifielker wants to merge 2 commits intomainfrom
if-paygo

Conversation

@ifielker
Copy link
Copy Markdown
Collaborator

Sample code:

const response = await ai.generate({
    model: vertexAI.model('gemini-3.1-flash-lite-preview'),
    prompt:
      'You are a helpful AI assistant named Walt, say hello.',
    config: {
      payGo: 'priority', // or priority-only, flex, flex-only.
    },
  });

Checklist (if applicable):

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for PayGo consumption options to the Vertex AI Gemini plugin, introducing a payGo configuration field that maps to specific request headers. It also enables customHeaders in the client and adds a trafficType field to UsageMetadata. Feedback indicates that the trafficType field is not yet mapped in the model response usage object, which should be addressed to ensure the data is correctly captured.

Comment thread js/plugins/google-genai/src/common/types.ts
@ifielker ifielker requested review from apascal07 and pavelgj April 24, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant