Skip to content

feat: Support Enum parameter parsing in function declarations #625 #687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lucasnobre212
Copy link
Contributor

@lucasnobre212 lucasnobre212 commented May 12, 2025

(My past PR (#625) was using the main branch in my fork and this was causing me problems. I created a new branch for this feature only. Sorry! )

Added handling for Enum types in function_parameter_parse_util.py to enable parsing of Enum parameters.
Updated schema generation to include enum values and validated default values.
Included a unit test to ensure correctness of the implementation.

Observations:

This is my first PR, so please tell me if I need to provide more context or make more changes
I added a unit test for Enum. I couldn't run a integration test though, I tried to run only test_single_function_calls_success from test_tools.py but pytest kept skipping it.

Closes #398

Testing plan:

Run
uv run pytest ./tests/unittests
More specifically, you need to run the test test_enum_input in tests/unittests/tools/test_build_function_declaration.py

@lucasnobre212 lucasnobre212 changed the title Support Enum parameter parsing in function declarations feat: Support Enum parameter parsing in function declarations #625 May 12, 2025
@lucasnobre212
Copy link
Contributor Author

@hangfei updated branch with main. It is my first PR to this project, please tell if I need to do anything else

@hangfei hangfei requested a review from seanzhou1023 May 30, 2025 17:59
@hangfei
Copy link
Collaborator

hangfei commented May 30, 2025

@lucasnobre212 could you resolve the conflicts?

@seanzhou1023 Could you help review this change? Thanks.

@lucasnobre212
Copy link
Contributor Author

I can't see any conflicts though. I just rebased my branch onto main and force pushed to update it

Added handling for Enum types in `function_parameter_parse_util.py` to enable parsing of Enum parameters. Updated schema generation to include enum values and validated default values. Included a unit test to ensure correctness of the implementation.
@hangfei hangfei added bot triaged [Bot] This issue is triaged by ADK bot tools [Component] This issue is related to tools labels Jun 14, 2025
@hangfei
Copy link
Collaborator

hangfei commented Jul 18, 2025

@lucasnobre212 Could you fix the formatting?

@lucasnobre212
Copy link
Contributor Author

@hangfei I already fixed the formatting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot triaged [Bot] This issue is triaged by ADK bot tools [Component] This issue is related to tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Enum type for function tool args
2 participants