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):
- OS: [e.g. iOS] macOS 15.3.2
- Python version(python -V): 3.11
- ADK version(pip show google-adk): 0.1.0
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):