-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: Added support for enums as arguments for function tools #3088
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
feat: Added support for enums as arguments for function tools #3088
Conversation
Summary of ChangesHello @SOORAJTS2001, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant enhancement by enabling the use of Python Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds support for using enums as parameters in function tools. The implementation correctly identifies enum types and extracts their values for the schema. However, there is a bug in handling default values for enum parameters, which will cause an exception. I've provided a code suggestion to fix this. Additionally, the unit tests for this new feature could be expanded to cover cases with default values to prevent such issues in the future. I've included examples of test cases that should be added.
fix: Add more test cases inside `test_build_function_declaration.py` for passing Enums as arguments
|
@seanzhou1023 please take a look at this |
|
Hi @surajksharma07 ! |
|
Hi @SOORAJTS2001, Thank you for your contribution to the ADK project. The changes in Before we proceed with the final review and merge, could you please address the following points?
Once these adjustments are made, we can proceed with the final testing and merge. Let us know if you have any questions. |
Hi @surajksharma07 |
|
@surajksharma07 @hangfei @seanzhou1023 any update on this? |
|
@surajksharma07 @hangfei @seanzhou1023 @polong-lin |
|
Oh sorry, will fix the formatting issue |
|
thank you, alternatively, i can co contribute to the fix if you like. let me know |
…' into feat/function-tools-enum-support

src/google/adk/tools/_function_parameter_parse_util.pyRan the whole unittests

For unittests/tools

Test result for test_build_function_declaration.py
