Skip to content

chore(generative_ai): update model references to stable gemini models (#14117)#14460

Open
aditya-cyberverse wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
aditya-cyberverse:fix/generative-ai-model-names
Open

chore(generative_ai): update model references to stable gemini models (#14117)#14460
aditya-cyberverse wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
aditya-cyberverse:fix/generative-ai-model-names

Conversation

@aditya-cyberverse

Copy link
Copy Markdown

Description

Fixes #14117

Updated deprecated Gemini model references across generative AI code samples to stable releases (gemini-1.5-flash and gemini-2.5-flash).

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended.

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

@aditya-cyberverse
aditya-cyberverse requested review from a team as code owners July 26, 2026 08:48
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Jul 26, 2026
@google-cla

google-cla Bot commented Jul 26, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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

Copy link
Copy Markdown
Contributor

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 updates multiple generative AI code samples to use 'gemini-1.5-flash' instead of 'gemini-2.0-flash-001' (and 'gemini-2.5-flash' instead of 'gemini-2.5-pro' in one case). The feedback correctly points out that in the pairwise evaluation sample, comparing 'gemini-1.5-flash' against itself defeats the purpose of a pairwise comparison, and suggests using 'gemini-1.5-pro' as the candidate model instead.

Comment on lines +55 to 60
baseline_model = GenerativeModel("gemini-1.5-flash")

# Candidate model for pairwise comparison
candidate_model = GenerativeModel(
"gemini-2.0-flash-001", generation_config={"temperature": 0.4}
"gemini-1.5-flash", generation_config={"temperature": 0.4}
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In a pairwise evaluation, comparing the exact same model (gemini-1.5-flash) against itself defeats the purpose of demonstrating a pairwise comparison between two different models (e.g., a lighter/faster model vs. a larger/more capable model). To make this sample more meaningful and illustrative, consider using gemini-1.5-pro as the candidate model while keeping gemini-1.5-flash as the baseline.

Suggested change
baseline_model = GenerativeModel("gemini-1.5-flash")
# Candidate model for pairwise comparison
candidate_model = GenerativeModel(
"gemini-2.0-flash-001", generation_config={"temperature": 0.4}
"gemini-1.5-flash", generation_config={"temperature": 0.4}
)
baseline_model = GenerativeModel("gemini-1.5-flash")
# Candidate model for pairwise comparison
candidate_model = GenerativeModel(
"gemini-1.5-pro", generation_config={"temperature": 0.4}
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(generative_ai) Update model references for generative_ai samples

1 participant