Skip to content

Support for minItems and maxItems for FunctionDeclarationSchemaType.ARRAY? #200

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
louislamlam opened this issue Jul 3, 2024 · 1 comment · May be fixed by #457
Open

Support for minItems and maxItems for FunctionDeclarationSchemaType.ARRAY? #200

louislamlam opened this issue Jul 3, 2024 · 1 comment · May be fixed by #457
Labels
component:js sdk Issue/PR related to JavaScript SDK status:triaged Issue/PR triaged to the corresponding sub-team type:feature request New feature request/enhancement

Comments

@louislamlam
Copy link

Description of the feature request:

choices: { type: FunctionDeclarationSchemaType.OBJECT, properties: { list: { type: FunctionDeclarationSchemaType.ARRAY, items: { type: FunctionDeclarationSchemaType.STRING, }, minItems: 1, maxItems: 3, }, }, required: ['list'], },

Error logged in Cloud console:
Invalid JSON payload received. Unknown name "maxItems" at 'generation_config.response_schema.properties[1].value.properties[0].value': Cannot find field. [{"@type":"type.googleapis.com/google.rpc.BadRequest","fieldViolations":[{"field":"generation_config.response_schema.properties[0].value.properties[0].value","description":"Invalid JSON payload received. Unknown name \"minItems\" at 'generation_config.response_schema.properties[0].value.properties[0].value': Cannot find field."},{"field":"generation_config.response_schema.properties[0].value.properties[0].value","description":"Invalid JSON payload received. Unknown name \"maxItems\" at 'generation_config.response_schema.properties[0].value.properties[0].value': Cannot find field."}]}]

What problem are you trying to solve with this feature?

Allowing setting min and max length of return array is pretty useful for many cases.

Any other information you'd like to share?

No response

@singhniraj08 singhniraj08 added type:bug Something isn't working status:triaged Issue/PR triaged to the corresponding sub-team component:js sdk Issue/PR related to JavaScript SDK labels Jul 4, 2024
@arvinxx
Copy link

arvinxx commented Jul 7, 2024

We meet the same issues:

our dalle plugin has a schema of maxItems and minItems, but Gemini's function calling currently does not support it. so it will cause an error

@pamorgan pamorgan added type:feature request New feature request/enhancement and removed type:bug Something isn't working labels Nov 11, 2024
@IvanLH IvanLH assigned IvanLH and unassigned lahirumaramba, hsubox76 and IvanLH Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:js sdk Issue/PR related to JavaScript SDK status:triaged Issue/PR triaged to the corresponding sub-team type:feature request New feature request/enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants