You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ADK OpenAPIToolSet Not Including Parameter Description And required Field #247
Observations:
While generating function declarations, all parameters are being treated as required—even when the required property is explicitly set to false.[1]
The description field of parameters is not being included in the VertexAI request schema for function declarations.[1]
Expected behavior
Ideally the LLM request should not include parameters in required list which have required: false .
Also the description of parameters should also be passed in function declaration in LLM request schema
Example
[1]
OpenAPI Spec {"parameters":[{"name":"needTotalCount","in":"query","description":"Need Total Count","required":false,"schema":{"type":"boolean"}},{"name":"templateName","in":"query","description":"Identifier of the template to be used to prepare API response by providing a filtering mechanism","required":false,"schema":{"type":"string"}}]}
LLM Request: {'contents': [{'parts': [{'text': 'find all user not logged in last 45 days'}], 'role': 'user'}], 'systemInstruction': {'parts': [{'text': '..............................'}], 'role': 'user'}, 'tools': [{'functionDeclarations': [{'description': 'The API allows you to create structured queries using the REST Query Language \n\n Either template name or template payload should be empty or null', 'name': 'quick_search_user_login_info', 'parameters': {'properties': {'need_total_count': {'type': <Type.BOOLEAN: 'BOOLEAN'>}, 'template_name': {'type': <Type.STRING: 'STRING'>}, 'query': {'type': <Type.STRING: 'STRING'>}, 'size': {'type': <Type.INTEGER: 'INTEGER'>}}, 'required': ['need_total_count', 'template_name', 'query', 'size'], 'type': <Type.OBJECT: 'OBJECT'>}}]}], 'generationConfig': {}}
Desktop (please complete the following information):
could you show your source codes ? Don't quite understand your log, how did you feed the OpenAPIToolSet to your agent ?
Usually the tools should be under Functions section , while I saw you put it in the system instruction. I guess you probably used it in an wrong way
@seanzhou1023 , I have updated the LLM request that is being generated. Earlier while removing certain parts of system instruction I ended up removing tools section while copying
@seanzhou1023 , Updated the LLM request to actual value.
Please ignore the value with empty required list [] as it was generated after I fixed the code in OpenAPI operation_parser.py file in my local system
Activity
seanzhou1023 commentedon Apr 17, 2025
could you show your source codes ? Don't quite understand your log, how did you feed the OpenAPIToolSet to your agent ?
Usually the tools should be under Functions section , while I saw you put it in the system instruction. I guess you probably used it in an wrong way
sumant-pangotra commentedon Apr 17, 2025
@seanzhou1023 , I have updated the LLM request that is being generated. Earlier while removing certain parts of system instruction I ended up removing tools section while copying
seanzhou1023 commentedon Apr 17, 2025
thanks @sumant-pangotra , but in your updated log, the "required" is empty list.
sumant-pangotra commentedon Apr 17, 2025
@seanzhou1023 , Updated the LLM request to actual value.
Please ignore the value with empty required list [] as it was generated after I fixed the code in OpenAPI operation_parser.py file in my local system
sumant-pangotra commentedon Apr 17, 2025
@seanzhou1023 , I have raised a PR for review.
lenzpaul commentedon Apr 30, 2025
I noticed this too, all the parameters are marked as requrired, even optional one.
Merge branch 'main' into google#247-OpenAPIToolSet-Considering-Requir…
seanzhou1023 commentedon May 2, 2025
Thanks @sumant-pangotra , I've approved the PR, pls fix the errors
Merge branch 'main' into google#247-OpenAPIToolSet-Considering-Requir…
sumant-pangotra commentedon May 2, 2025
Done @seanzhou1023 , 'Waiting for internal safe review approval' Check is pending
Copybara import of the project:
Merge branch 'main' into google#247-OpenAPIToolSet-Considering-Requir…
Merge pull request #256 from sumant-pangotra/#247-OpenAPIToolSet-Cons…
Merge branch 'main' into google#247-OpenAPIToolSet-Considering-Requir…
Merge branch 'main' into google#247-OpenAPIToolSet-Considering-Requir…
Copybara import of the project:
Merge branch 'main' into google#247-OpenAPIToolSet-Considering-Requir…
Merge pull request google#256 from sumant-pangotra/google#247-OpenAPI…
Merge branch 'main' into google#247-OpenAPIToolSet-Considering-Requir…
Merge branch 'main' into google#247-OpenAPIToolSet-Considering-Requir…
Copybara import of the project:
Merge branch 'main' into google#247-OpenAPIToolSet-Considering-Requir…
Merge pull request google#256 from sumant-pangotra/google#247-OpenAPI…