litellm/tests/test_litellm/llms/vertex_ai
Sameer Kankute 69afcd09d0
fix(vertex-ai): use DB credentials in video handlers + implement Veo video edit (#29098)
* fix(vertex-ai): pass litellm_params to validate_environment in video handlers and implement video edit for Veo

- Pass litellm_params to validate_environment in 11 video handler call sites
  (remix, create_character, get_character, edit, extension, delete) so
  DB-stored Vertex AI credentials are used instead of falling back to ADC
- Implement transform_video_edit_request/response for VertexAI: fetches
  source video via fetchPredictOperation then submits a new
  predictLongRunning request with the video bytes/gcsUri + edit prompt

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(vertex-ai): hoist fetchPredictOperation into handlers to avoid blocking event loop

- Add get_video_edit_prefetch_params() to BaseVideoConfig (returns None)
- VertexAI overrides it to return the fetchPredictOperation URL/body
- Both sync and async video_edit handlers call this and use their shared
  httpx client for the fetch, passing the result as prefetched_source_data
- transform_video_edit_request is now a pure transform with no HTTP calls
- Fix extra_body.pop() mutation by working on a shallow copy

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(vertex-ai): include prefetch call inside _handle_error try/except block

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(videos): add prefetched_source_data param to all transform_video_edit_request overrides

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(video_edit): keep transform/pre_call outside try so validation errors propagate

Move transform_video_edit_request and logging_obj.pre_call outside the
try/except that wraps HTTP calls in (async_)video_edit_handler so that
ValueError validation errors (e.g. 'source video not complete yet') are
not silently wrapped as 500s by _handle_error. The prefetch HTTP call
keeps its own try/except so its errors are still mapped through the
provider's error handler. Matches the pattern used by
video_extension_handler and video_remix_handler.

Co-authored-by: Yassin Kortam <yassin@berri.ai>

* refactor(vertex_ai): delegate get_video_edit_prefetch_params to status retrieve

Co-authored-by: Yassin Kortam <yassin@berri.ai>

* Fix varia review

* fix(video_edit): route transform errors through _handle_error

Wrap transform_video_edit_request and pre_call in the same try/except
as the HTTP call in sync and async handlers so validation failures
(e.g. source video not complete) return typed LiteLLM exceptions.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Yassin Kortam <yassin@berri.ai>
2026-05-28 11:45:41 -07:00
..
context_caching style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
files Merge remote-tracking branch 'origin/litellm_internal_staging' into codex/cloud-storage-file-guard 2026-05-04 11:25:41 -07:00
gemini fix(vertex_ai): omit function_call id on Vertex Gemini 3.5+ tool turns (#28324) 2026-05-20 14:52:50 -07:00
gemini_embeddings fix: rename test method 2026-03-22 01:37:59 -03:00
image_edit style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
image_generation Merge branch 'litellm_internal_staging' into litellm_vertex_request_metadata_labels 2026-04-21 09:10:51 +05:30
multimodal_embeddings Merge remote-tracking branch 'upstream/litellm_internal_staging' into litellm_staging_03_23_2026 2026-04-25 15:16:13 -03:00
realtime [Feat] Add tool calling support for gemini and vertex ai live api (#26590) 2026-05-26 14:40:42 -07:00
rerank test(vertex_ai): add e2e tests for rerank userLabels propagation 2026-04-30 18:25:38 +00:00
vertex_ai_partner_models Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
vertex_gemma_models fix(vertex_gemma): strip context_management from request body (#28438) 2026-05-21 23:10:33 +05:30
videos fix(vertex-ai): use DB credentials in video handlers + implement Veo video edit (#29098) 2026-05-28 11:45:41 -07:00
__init__.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_bge_embedding.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_bge_response_transformation.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_gemini_empty_properties.py fix: keep type field in Gemini schema when properties is empty (#18979) 2026-01-14 22:58:05 +05:30
test_gemini_header_forwarding.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_http_status_201.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_vertex.py Day 0 support : Gemini 3.5 Flash (#28268) 2026-05-19 15:50:54 -07:00
test_vertex_ai_batch_transformation.py fix: cover provider path traversal variants 2026-04-29 22:29:09 -07:00
test_vertex_ai_common_utils.py Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_hotfix_gpt-5.5-minimal-flag 2026-05-02 05:55:51 +00:00
test_vertex_ai_psc_endpoint_support.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_vertex_ai_search_vector_store_transformation.py fix: cover provider path traversal variants 2026-04-29 22:29:09 -07:00
test_vertex_gemini_gcs_uri_mime.py Litellm oss staging (#28161) 2026-05-18 16:27:44 -07:00
test_vertex_global_url_support.py fix(vertex_ai): use aiplatform.{geo}.rep.googleapis.com for multi-region locations (#26281) 2026-04-23 15:58:02 -07:00
test_vertex_image_generation.py test: fix tests 2025-11-22 16:50:50 -08:00
test_vertex_llm_base.py Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
test_vertex_model_garden_openapi.py feat(vertex_ai): Model Garden OpenAPI for publisher model ids 2026-05-01 18:05:08 +05:30