mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-29 01:03:17 +00:00
* fix(vertex_ai): stop a json_schema row failing the plain rows in its batch file Vertex loads a batch file into one BigQuery table, so each row's generationConfig gains a null for every key another row sets. response_json_schema is a google.protobuf.Value, so its null counts as set and every plain row with a generationConfig of its own fails with "response_mime_type must be set". Proto JSON takes both spellings of the field, so a row carrying a schema now uses generation_config, which no other row shares. The request Vertex parses is the same as before. * fix(vertex_ai): inline json_schema $defs in Gemini batch rows Vertex loads a batch file into BigQuery, whose column names cannot hold $, so one $defs key failed the whole batch. Schema rows now inline their refs through the shared defs helper. Also pins that the renamed row keeps every other key of the plain row * fix(vertex_ai): drop or refuse json_schema $ keys in Gemini batch rows BigQuery column names cannot hold $, so a $schema, $comment, recursive $ref or $-named property still failed the whole Vertex batch. Annotation keywords now drop under drop_params, else the upload answers 400 naming them, and keys that cannot be dropped always answer 400 defs_unpacked now merges $defs with definitions, and unpack_defs reuses the parent scope when a node adds no defs, so memory stays flat on large schemas * fix(vertex_ai): keep json_schema literals and ref siblings in Gemini batch rows defs_unpacked now lets $defs win when both blocks name the same def, which is what Anthropic requests got before, and it keeps the keys next to a $ref (a field's description) over the inlined target, like the OpenAI SDK does The batch walk now runs top down, so const, default, enum, and example values pass through whole. A $ key inside one of them answers 400 at upload instead of being dropped, since dropping it would change the value the model must return A $ref that is not #/$defs/<name> or #/definitions/<name>, such as a JSON pointer or an external URL, answers 400 at upload instead of resolving to a local def with the same last segment * fix(vertex_ai): keep ref target constraints and keyword-named properties in Gemini batch rows * fix(vertex_ai): add a required next to a json_schema ref to its target's in Gemini batch rows * fix(vertex_ai): refuse json_schema keys a Gemini batch row would lose when a ref is inlined Keys next to a $ref other than annotations and required answer 400, or drop under drop_params, and a $ref inside a literal value answers 400 before inlining. The inlining budget counts the kept annotations, a sibling required merges through a set lookup, and only the Vertex batch path keeps ref siblings, so Anthropic output schemas inline as before * fix(prompt_templates): keep the 400 for a $ref to a def that is not an object A $ref whose target is a boolean, number, string or list schema raised a TypeError the proxy answers with a 500, or inlined the value, after the defs merge skipped dict copies. It again takes the merge, which answers 400 as before * perf(prompt_templates): stack nested $defs scopes instead of copying every outer def A node or ref target with its own $defs used to copy every def above it, so a schema whose properties each add a def held one full copy per property. Each scope is now a tuple of the local defs and the enclosing scopes, looked up innermost first, which keeps the inlined output the same and the peak memory flat * fix(vertex_ai): honor a Responses batch row's own drop_params when cleaning its json_schema The Responses-to-Chat bridge leaves drop_params out of the chat body, so a /v1/responses row that set it still got the BigQuery '$' key refusal. The row's original body now supplies the flag * fix(prompt_templates): resolve a definitions ref to its own block when $defs defines the same name differently * fix(prompt_templates): track a definitions ref by its own block when checking for ref cycles A $defs entry that refs the definitions entry of the same name was read as a cycle, because the cycle check keyed on the bare name. It now keys on the block the ref resolved to --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| agent_engine | ||
| audio_transcription | ||
| batches | ||
| context_caching | ||
| count_tokens | ||
| files | ||
| fine_tuning | ||
| fixtures | ||
| gemini | ||
| gemini_embeddings | ||
| image_edit | ||
| image_generation | ||
| interactions | ||
| multimodal_embeddings | ||
| rag_engine | ||
| realtime | ||
| rerank | ||
| text_to_speech | ||
| vertex_ai_partner_models | ||
| vertex_embeddings | ||
| vertex_gemma_models | ||
| videos | ||
| __init__.py | ||
| google_genai_proxy_test_config.yaml | ||
| test_bge_embedding.py | ||
| test_bge_response_transformation.py | ||
| test_common_utils.py | ||
| test_gemini_batch_embeddings.py | ||
| test_gemini_empty_properties.py | ||
| test_gemini_header_forwarding.py | ||
| test_http_status_201.py | ||
| test_request_labels.py | ||
| test_vertex.py | ||
| test_vertex_ai_batch_transformation.py | ||
| test_vertex_ai_common_utils.py | ||
| test_vertex_ai_non_gemini.py | ||
| test_vertex_ai_psc_endpoint_support.py | ||
| test_vertex_ai_search_vector_store_transformation.py | ||
| test_vertex_gemini_gcs_uri_mime.py | ||
| test_vertex_global_url_support.py | ||
| test_vertex_image_generation.py | ||
| test_vertex_llm_base.py | ||
| test_vertex_model_garden_openapi.py | ||
| test_vertex_passthrough_logging_handler.py | ||