temperature and top_p silently removed from Interactions GenerationConfig in 2.14.0

Ouverte
#2,876 1 commentaire 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@kkorpal y travaille déjà.

Depuis le 19/8/2026.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

priority: p2 type: bug
Description

temperature and top_p were removed from the Interactions API's GenerationConfig / GenerationConfigParam in 2.14.0. The 2.14.0 changelog has no entry for this, and it wasn't flagged as a deprecation in any prior release.

The removal is type-only. GenerationConfig is extra="allow", so passing temperature still validates and still serializes onto the wire — code keeps working at runtime but fails type checking. That combination makes it easy to "fix" by deleting the field, silently changing sampling behavior.

This also leaves the two surfaces inconsistent: types.GenerateContentConfig (used by models.generate_content) still has both temperature and top_p as first-class fields in 2.18.1.

Reproduction (2.18.1)
from google.genai import version
from google.genai.interactions import GenerationConfigParam
from google.genai._gaos.types.interactions.generationconfig import GenerationConfig

print("google-genai:", version.__version__)
print("temperature in GenerationConfig:", "temperature" in GenerationConfig.model_fields)
print("extra policy:", GenerationConfig.model_config.get("extra"))
print("dump:", GenerationConfig.model_validate({"temperature": 0.0}).model_dump())

cfg: GenerationConfigParam = {"temperature": 0.0}  # pyright: reportAssignmentType

Runtime output:

google-genai: 2.18.1
temperature in GenerationConfig: False
extra policy: allow
dump: {'temperature': 0.0}

Type checker (pyright, standard mode):

error: Type "dict[str, float]" is not assignable to declared type "GenerationConfigParam"
    "temperature" is an undefined item in type "GenerationConfigParam" (reportAssignmentType)

Bisected across wheels: present in 2.13.0, absent from 2.14.0 onward.

Questions
  1. Is this intentional — has the Interactions API stopped accepting temperature/top_p, or is it a codegen omission?
  2. If intentional: is temperature now ignored server-side, or still honored? Callers doing deterministic structured extraction need to know whether removing it changes model behavior. A changelog entry and a deprecation window would help.
  3. If a codegen bug: can the fields be restored?
Environment
  • google-genai 2.18.1 (also reproduces on 2.14.0–2.18.0)
  • Python 3.13, Linux
Langage dominant
Python
Étoiles
4.1k
Forks
1.1k
Merge moyen
1 j 20 h
PR mergées (30 j)
109

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de googleapis/python-genai

Toutes les issues de googleapis/python-genai

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.