fix(common_utils.py): handle $id in response schema when calling vert… (#8991)

* fix(common_utils.py): handle $id in response schema when calling vertex ai

Fixes issue where `$id` present in response_schema was not accepted by vertex ai

* test(test_vertex.py): add unit test to ensure $id stripped out of vertex schema
This commit is contained in:
Krish Dholakia 2025-03-04 21:19:50 -08:00 committed by GitHub
parent 662c59adcf
commit f1a44d1fdc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 0 deletions

View file

@ -170,6 +170,9 @@ def _build_vertex_schema(parameters: dict):
strip_field(
parameters, field_name="$schema"
) # 5. Remove $schema - json schema value, not supported by OpenAPI - causes vertex errors.
strip_field(
parameters, field_name="$id"
) # 6. Remove id - json schema value, not supported by OpenAPI - causes vertex errors.
return parameters