Skip to content

docs(vertex): move model= from genai.Client() to from_genai() - #2475

Closed
Goutham-Annem wants to merge 1 commit into
567-labs:mainfrom
Goutham-Annem:docs/fix-vertex-genai-model-param
Closed

docs(vertex): move model= from genai.Client() to from_genai()#2475
Goutham-Annem wants to merge 1 commit into
567-labs:mainfrom
Goutham-Annem:docs/fix-vertex-genai-model-param

Conversation

@Goutham-Annem

Copy link
Copy Markdown

Summary

Fixes an incorrect code example in the Vertex AI migration guide where model= was passed to genai.Client() instead of from_genai().

The genai.Client() constructor does not accept a model parameter — passing it there is silently ignored. The model argument belongs to from_genai(), which uses it to set the default model for all requests.

Fixes #2416

Changes

  • docs/integrations/vertex.md — corrected the "Option 2" example in the Migration to Google GenAI section

Before (incorrect):

client = from_genai(
    genai.Client(
        vertexai=True,
        project="your-project",
        location="us-central1",
        model="gemini-3-flash"   # ❌ not a valid Client() param
    )
)

After (correct):

client = from_genai(
    genai.Client(
        vertexai=True,
        project="your-project",
        location="us-central1",
    ),
    model="gemini-3-flash",   # ✅ belongs to from_genai()
)

Testing

Documentation-only change. Verified against the google-genai SDK source — genai.Client.__init__ does not accept a model parameter.

Note: This PR was developed with AI assistance.

The model parameter belongs to from_genai(), not genai.Client().
Passing model= inside genai.Client() has no effect and silently
ignores the model selection.

Fixes 567-labs#2416
@jxnl

jxnl commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Consolidated and shipped in #2495. Closing this focused patch as superseded; thank you for the contribution.

@jxnl jxnl closed this Jul 29, 2026
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.

[Docs]: Incorrect documentation for google.genai with vertex

2 participants