Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Gen AI with structured output - `propertyOrdering` in Python vs. Java implementations

Aperta
#1,169 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@hemasekhar-p ci sta già lavorando.

Dal 12/8/2026.

  • #1172 di @hemasekhar-p — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

priority: p3 type: feature request

Hi, when using gen AI with schema-constrained output, I've noticed in google/genai/_transformers.py, there's explicit handling of propertyOrdering (aka. property_ordering), while it seems that this is not the case in the Java implementation.

In the Python implementation the logic for including it is fairly simple: if propertyOrdering is missing, add it:

      if (
          len(properties.items()) > 1
          and order_properties  # True by default
          and 'propertyOrdering' not in schema
      ):
        schema['property_ordering'] = list(properties.keys())

I wouldn't bring this up if it didn't actually result in AI returning different, and better responses with it, vs. without it. Specifically, in my Java app, with the exact same prompt and basic schema (without explicitly setting propertyOrdering), AI consistently returns fewer fields than it does when invoked via the Python app.

Now I've noticed this field is labeled as non-standard, at least in v1.51.0, which I have locally:

    /**
     * Setter for propertyOrdering.
     *
     * <p>propertyOrdering: Optional. Order of properties displayed or used where order matters.
     * This is not a standard field in OpenAPI specification, but can be used to control the order
     * of properties.
     */

Despite that, I've now added propertyOrdering to my schema (in Java). (Note, I have Vertex AI set to true in both cases, if that makes a difference.)

Is there any general information on this? In particular, is propertyOrdering expected to have an effect on structured output generation in Vertex AI, and should the Java implementation also be adding it automatically when it isn't explicitly provided?

Thanks.

Lingua principale
Java
Stelle
398
Fork
126
Merge medio
1g 12h
PR unite (30g)
71

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di googleapis/java-genai

Tutte le issue di googleapis/java-genai

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.