Skip to content
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

Function schemas don't allow maxItems/minItems #210

Open
ianb opened this issue Dec 31, 2023 · 1 comment
Open

Function schemas don't allow maxItems/minItems #210

ianb opened this issue Dec 31, 2023 · 1 comment
Labels
type:feature request New feature/request/enhancement

Comments

@ianb
Copy link

ianb commented Dec 31, 2023

Description of the bug:

Using the Gemini Pro API, If you have a function definition like this:

{
  name: "myFunction",
  parameters: {
    type: "object",
    properties: {
      choices: {
        type: "array",
        minItems: 5,
        maxItems: 5,
        items: {type: "string"}
      }
    }
  }
}

the API will return an error about minItems and maxItems like:

Invalid JSON payload received. Unknown name "maxItems" at 'tools[0].function_declarations[0].parameters.properties[0].value': Cannot find field.
Invalid JSON payload received. Unknown name "minItems" at 'tools[0].function_declarations[0].parameters.properties[0].value': Cannot find field.

Actual vs expected behavior:

It should accept the maxItems/minItems properties, which are part of JSON/OpenAPI schemas.

@ianb ianb added the type:bug Something isn't working label Dec 31, 2023
@MarkDaoust MarkDaoust added type:feature request New feature/request/enhancement and removed type:bug Something isn't working labels Jan 11, 2024
@MarkDaoust
Copy link
Member

The proto that defined the API is here, and yes, this is clearly not currently supported.

https://github.com/googleapis/googleapis/blob/master/google/ai/generativelanguage/v1beta/content.proto#L186-L216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature request New feature/request/enhancement
Projects
None yet
Development

No branches or pull requests

2 participants