Gen AI with structured output - `propertyOrdering` in Python vs. Java implementations
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di googleapis/java-genai
-
priority: p2 type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
googleapis/java-genai#1372 ·
I maintainer di solito rispondono entro 1 giorno
-
Interactions API: GaosClientException.getMessage() only returns "400 . API error occurred" and omits the server error detailsForse già presa @hemasekhar-p l’ha presa 24 giorni fa. Apertapriority: p2 type: bug
googleapis/java-genai#1282 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Interactions API: store(false) omits "id", breaking Interaction and InteractionCompletedEvent deserializationForse già presa @hemasekhar-p l’ha presa 24 giorni fa. Apertapriority: p2 type: bug
googleapis/java-genai#1281 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Interaction.outputText() always returns Optional.empty() (SDK-computed field is never populated)Forse già presa @hemasekhar-p l’ha presa 24 giorni fa. Apertapriority: p2 type: bug
googleapis/java-genai#1280 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Live API: no way to observe session close or connection errors after setupForse già presa @hemasekhar-p l’ha presa 87 giorni fa. Apertapriority: p3 type: feature request
googleapis/java-genai#1153 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di googleapis/java-genai
Issue simili
-
Update samples to Citrus 5.1.0Forse già presa @asuruceanu l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
snowflakedb/snowflake-kafka-connector#1610 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
swagger-api/swagger-petstore#245 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
liquid-java/liquidjava#443 ·
I maintainer di solito rispondono entro 2 giorni