Skip to content

fix(genai): update 5 samples to gemini-3.8-flash and remove deprecated temperature=0 - #14676

Merged
iennae merged 2 commits into
mainfrom
fix/genai-gemini-3-8-flash
Oct 27, 2026
Merged

iennae merged 2 commits into
mainfrom
fix/genai-gemini-3-8-flash

Conversation

@iennae

@iennae iennae commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Description

  • Updates five genai/ samples (ctrlgen_with_class_schema.py, counttoken_with_txt.py, textgen_chat_with_txt.py, textgen_with_txt.py, and tools_func_def_with_txt.py) to the latest gemini-3.8-flash model.
  • Removes deprecated temperature=0 from GenerateContentConfig in genai/tools/tools_func_def_with_txt.py.
  • Aligns genai/tools/test_tools_examples.py (GOOGLE_CLOUD_LOCATION = "global") and genai/tools/requirements.txt (google-genai==2.29.0) with the other genai/ test suites.

@iennae
iennae requested review from a team as code owners October 24, 2026 17:48
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Oct 24, 2026

@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 the Gemini model version from 'gemini-3.5-flash' to 'gemini-3.8-flash' across several example scripts, including controlled generation, token counting, chat, and text generation. It also upgrades the 'google-genai' package dependency to version 2.29.0 in the tools requirements, changes the 'GOOGLE_CLOUD_LOCATION' environment variable to 'global' in the test suite, and removes the 'temperature' configuration from the function definition tool example. There are no review comments, and I have no feedback to provide.

…d temperature=0

Update five Google GenAI SDK samples (`ctrlgen_with_class_schema.py`,
`counttoken_with_txt.py`, `textgen_chat_with_txt.py`, `textgen_with_txt.py`,
and `tools_func_def_with_txt.py`) to use the latest `gemini-3.8-flash` model.

In `genai/tools/tools_func_def_with_txt.py`, remove `temperature=0` from
`GenerateContentConfig`, as setting temperature below 1.0 is deprecated for
Gemini 3.x models. Also update `genai/tools/test_tools_examples.py` to use
`GOOGLE_CLOUD_LOCATION = "global"` and `genai/tools/requirements.txt` to
`google-genai==2.29.0` for consistency with the other `genai/` test suites.
@iennae
iennae force-pushed the fix/genai-gemini-3-8-flash branch from d87195b to 00af603 Compare October 24, 2026 17:51

@XrossFox XrossFox 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.

Hello, i have ran each test for each modified file:

Image Image Image Image

Tests are passing, code LGTM.

@XrossFox XrossFox 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.

Note: i found that there is an outdated dependency under genai/controlled_generation/requirements-test.txt that requires to be updated for that sample to run, update the following dependency to the specified version below:
pytest-asyncio==1.4.0

This will probably will apply for the other samples as well.

…test.txt

Problem:
Several genai/*/requirements-test.txt files pinned pytest==9.0.3 alongside pytest-asyncio==0.23.6. Because pytest-asyncio==0.23.6 specifies an upper bound of pytest<9,>=7.0.0, installing requirements-test.txt fails with a dependency resolution conflict.

Solution:
Update pytest-asyncio from 0.23.6 to 1.4.0 across all six affected genai/*/requirements-test.txt files (controlled_generation, count_tokens, model_optimizer, template_folder, thinking, and tools) to support pytest>=9.

@XrossFox XrossFox 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.

LGTM

@iennae
iennae merged commit d831f8b into main Oct 27, 2026
14 of 22 checks passed
@iennae
iennae deleted the fix/genai-gemini-3-8-flash branch October 27, 2026 02:04
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.

2 participants