Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backend/app/services/assessment/mappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def _convert_json_schema_to_google(schema: dict) -> dict:
else normalized_schema
)

# The SDK's model_dump emits snake_case `property_ordering`; Vertex merges it
# with our camelCase key into a duplicated ordering and rejects the request,
# so keep exactly one ordering key.
google_schema.pop("property_ordering", None)
if "properties" in google_schema and "propertyOrdering" not in google_schema:
google_schema["propertyOrdering"] = list(
normalized_schema.get("required", [])
Expand Down
4 changes: 4 additions & 0 deletions backend/app/services/llm/mappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ def _convert_json_schema_to_google(schema: dict[str, Any]) -> dict[str, Any]:
else normalized_schema
)

# The SDK's model_dump emits snake_case `property_ordering`; Vertex merges it
# with our camelCase key into a duplicated ordering and rejects the request,
# so keep exactly one ordering key.
google_schema.pop("property_ordering", None)
if "properties" in google_schema and "propertyOrdering" not in google_schema:
google_schema["propertyOrdering"] = list(
normalized_schema.get("required", [])
Expand Down
Loading