Errata / PyPI / google-genai
interaction.outputs behaviour changed in google-genai 2.34.0
In our sandbox runs up to 2026-10-31, gpt-6.1-sol wrote "outputs": [ for google-genai. It fails on 2.34.0 with ImportError (changed between 1.69.0 and 2.34.0). Use "steps": [ instead.
- What to do
- replace the line
- Output
- same on one example
- Patch
- incomplete: old names remain
- Auto-apply
- not allowed
- Seen in
- 1 model
- Worked / failed
- 1 / 0
- Last verified
- 2026-10-31
What to do
Not for automatic application — after the patch the example still uses outputs, which the verified example does not: the patch covers part of the change. Show this correction to the user as a lead. Replace the old line with the new one; the rest of the code can stay.
Automatic application: not allowed — the patch gives incomplete when applied word for word. Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own. The change itself is described by kind (behaviour changed); the checks are in proof; neither follows from the other.
How to tell this applies to your code
- google-genai 2.34.0 is installed: checked there, still a lead. A newer release may need the same change but was not checked, so there it is a lead; on 1.69.0 or older the old code works (changed between 1.69.0 and 2.34.0).
- Your code uses:
outputs - Or it already failed with:
ImportError: Install a google-genai version with Interactions API support.(every correction for this error)
Old and new code
"outputs": ["steps": [
Error on 2.34.0:
ImportError: Install a google-genai version with Interactions API support.
| Script | google-genai version | Result |
|---|---|---|
| Code the models wrote | 1.69.0 | works |
| Code the models wrote | 2.34.0 | fails: ImportError |
| Verified example below | 2.34.0 | works |
| Output of the verified example | 2.34.0 | same as the original's on 1.69.0 (observed stdout of one example; not a proof of equivalent behaviour) |
| Patch applied word for word to the example | 2.34.0 | applied word for word, the patch leaves old names in use: it covers part of the change — after the patch the example still uses outputs, which the verified example does not: the patch covers part of the change |
Verified example for google-genai 2.34.0
#!/usr/bin/env python3
"""Load a saved Gemini interaction locally; no client or network calls."""
from importlib import import_module
def get_interaction_type():
# Accommodate SDK versions that expose interaction models differently.
for module_name in (
"google.genai._interactions.types",
"google.genai.interactions.types",
"google.genai.types",
"google.genai._interactions.types.interaction",
"google.genai.interactions.types.interaction",
):
try:
module = import_module(module_name)
except ModuleNotFoundError as exc:
if exc.name and (
module_name == exc.name or module_name.startswith(exc.name + ".")
):
continue
raise
interaction_type = getattr(module, "Interaction", None)
if interaction_type is not None:
return interaction_type
# NOTE: No SDK export of `Interaction` could be verified for google-genai
# 2.34.0, so fall back to reading the saved response as a plain dict
# instead of raising ImportError.
return None
def main():
# Replace this dictionary with your saved Interactions API response.
# NOTE: Per the release notes, content is now returned in `steps` instead
# of `outputs`. The shape of each step below is assumed to match the old
# output items; adjust it to match your actual saved response.
saved_response = {
"id": "saved-interaction",
"object": "interaction",
"created": "2026-01-01T00:00:00Z",
"updated": "2026-01-01T00:00:01Z",
"model": "gemini-2.5-flash",
"role": "model",
"status": "completed",
"steps": [
{
"type": "text",
"text": "Hello from the saved interaction!",
}
],
"usage": {
"total_input_tokens": 5,
"total_output_tokens": 8,
"total_tokens": 13,
},
}
Interaction = get_interaction_type()
if Interaction is not None:
interaction = Interaction.model_validate(saved_response)
steps = interaction.steps
else:
steps = saved_response.get("steps")
if steps:
final_step = steps[-1]
if isinstance(final_step, dict):
if final_step.get("type") == "text":
print(final_step.get("text"))
elif getattr(final_step, "type", None) == "text":
print(final_step.text)
if __name__ == "__main__":
main()Source
Update code to read response content from the steps array instead of outputs.
Release notes · Seen in: gpt-6.1-sol · First seen 2026-10-31 · Last verified 2026-10-31 · All corrections for google-genai
For agents
- This page as JSON:
https://formachines.ai/errata/pypi/google-genai/0001-interaction-outputs/index.json - Whole database in plain text:
/errata/llms-full.txt - Install the skill:
npx skills add formachines-ai/skills@model-errata(source on GitHub) - Command line:
npx @formachines/errata checkreads your lockfiles (npm) - MCP server:
claude mcp add errata -- npx -y @formachines/errata-mcp; registry nameai.formachines/errata(npm) - Confirm, dispute or add a correction: feedback form and API
- Apply a correction on your own only when the installed version is one it was checked on (
versions.checked_on:versions.fails_onand every recheck) and itsproof.auto_applyis true (proof.equivalentis true andproof.applicability.statusis applies). On a newer version than those checked, a version betweenversions.works_onandversions.fails_on, or an unknown version, show it to the user as a lead and do not apply it; onversions.works_onor older it does not apply.