Skip to content

[Vertex/Gemini] Nullable fields in structured output throw exception #1999

@marco-jouwweb

Description

@marco-jouwweb

I'll be brief because I have to go, but I wanted to put this out here because I keep forgetting:

  • There is a bug for Vertex/Gemini when using structured output
  • If a property of the output object/DTO is nullable, the normalized schema will not comply with the Gemini-specific requirement: nullable fields should be explicitly marked nullable in the schema
  • This is basically near identical to a pre-existing bug in the Gemini toolcall normalizer if I recall correctly

Error thrown:
Symfony\\AI\\Platform\\Exception\\RuntimeException","message":"Error from Gemini API: \"Invalid JSON payload received. Unknown name \"type\" at 'generation_config.response_schema.properties[0].value.items.properties[5].value': Proto field is not repeating, cannot start list.\"","code":400,"...

Hope this is enough, if not I'll update next week.

Thanks and have a good weekend :-)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions