Skip to content

fix: export interactions.Interaction as the resource class for mypy - #2810

Open
a2105z wants to merge 1 commit into
googleapis:mainfrom
a2105z:fix/interactions-mypy-interaction-export
Open

fix: export interactions.Interaction as the resource class for mypy#2810
a2105z wants to merge 1 commit into
googleapis:mainfrom
a2105z:fix/interactions-mypy-interaction-export

Conversation

@a2105z

@a2105z a2105z commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Background

interactions.py previously did from ._gaos.types.triggers import * before importing the interactions resource types and relied on last-binding-wins. That works at runtime and for pyright, but mypy keeps the first star-import binding, so typed users saw TypeAliasType instead of the resource class.

Test plan

  • pytest google/genai/tests/interactions/test_interaction_type_export.py
  • mypy: reveal_type(Interaction) resolves to the resource class (not TypeAliasType)
  • Trigger Interaction alias still importable from google.genai._gaos.types.triggers

Stop star-importing the triggers Interaction TypeAliasTypes into
google.genai.interactions so mypy resolves Interaction to the resource
class, matching runtime behavior.

Fixes googleapis#2732
@a2105z

a2105z commented Aug 4, 2026

Copy link
Copy Markdown
Author

@Venkaiahbabuneelam this PR makes google.genai.interactions.Interaction resolve to the resource class under mypy instead of the triggers alias; whenever you have a moment, I would really appreciate your review — thank you for your time.

@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this Aug 4, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:XL Code changes > 100 lines label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL Code changes > 100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants