Repository navigation
Conversation
…e schema genai_transformers.t_schema().model_dump() emits snake_case property_ordering (no by_alias), and the mapper's guard only checks camelCase propertyOrdering before adding its own required-order list. The request therefore carries both keys; Vertex merges them into one ordering with every field duplicated and rejects the request with 'property_ordering contains duplicate field ...', failing every google-gcp batch row that uses a json_output_schema. Pop the snake_case key so exactly one ordering (required-field order) is sent. Verified against a live Vertex batch job: previously-failing schema now returns valid structured output. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
OpenAPI changes ⚪ No API surface changesNote This PR does not modify the API contract.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Issue
Closes #PLEASE_TYPE_ISSUE_NUMBER
Summary
property_orderingfields in the schema.property_orderingis removed before adding the required camelCase key, preventing duplication.services/assessment/mappers.pyandservices/llm/mappers.py.Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes
Please add here if any other information is required for the reviewer.
Original PR description
Problem
Every google-gcp batch assessment that uses a
json_output_schemafails: Vertex rejects each row with(observed on prod assessment
432ef1d9, batch job 1096 — all 998 rows errored).Root cause
_convert_json_schema_to_google()normalizes the schema throughgenai_transformers.t_schema()and dumps it withmodel_dump(mode="json")— withoutby_alias, so the SDK emits snake_caseproperty_ordering. The guard below only checks camelCase:so the mapper adds a second, camelCase ordering. Vertex merges both keys into one ordering where every field appears twice, and rejects the request.
Fix
Pop the SDK's snake_case
property_orderingbefore adding the required-order camelCase key, in both copies of the converter (services/assessment/mappers.py,services/llm/mappers.py).Verification
propertyOrderingandproperty_orderingfor the failing schema — byte-identical to the request captured in the batch-1096 predictions JSONL.JOB_STATE_SUCCEEDED, all rows returned valid structured output matching the schema.🤖 Generated with Claude Code