Skip to content

fix(types): support IntEnum in callable tools#2301

Open
MukundaKatta wants to merge 2 commits intogoogleapis:mainfrom
MukundaKatta:codex/python-genai-int-enum-callables
Open

fix(types): support IntEnum in callable tools#2301
MukundaKatta wants to merge 2 commits intogoogleapis:mainfrom
MukundaKatta:codex/python-genai-int-enum-callables

Conversation

@MukundaKatta
Copy link
Copy Markdown

Summary

  • handle Enum annotations directly in automatic callable schema parsing instead of falling through the generic Pydantic fallback
  • preserve integer-backed enums as INTEGER schemas while serializing enum values in the string form expected by the SDK schema model
  • add a FunctionDeclaration.from_callable regression test for IntEnum parameters

Testing

  • python3 -m py_compile google/genai/_automatic_function_calling_util.py google/genai/tests/types/test_types.py
  • python3 -m pytest google/genai/tests/types/test_types.py -k int_enum_parameter (fails locally during test startup: ModuleNotFoundError: No module named 'google.auth')

@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this Apr 21, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:L Code changes between 40-100 lines label Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L Code changes between 40-100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants