Repository navigation
fix(genai): update 5 samples to gemini-3.8-flash and remove deprecated temperature=0 - #14676
Conversation
There was a problem hiding this comment.
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.
d87195b to
00af603
Compare
There was a problem hiding this comment.
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.




Description
genai/samples (ctrlgen_with_class_schema.py,counttoken_with_txt.py,textgen_chat_with_txt.py,textgen_with_txt.py, andtools_func_def_with_txt.py) to the latestgemini-3.8-flashmodel.temperature=0fromGenerateContentConfigingenai/tools/tools_func_def_with_txt.py.genai/tools/test_tools_examples.py(GOOGLE_CLOUD_LOCATION = "global") andgenai/tools/requirements.txt(google-genai==2.29.0) with the othergenai/test suites.