From 2aefc18b0ad383ca86373e8912ca307d6f25a069 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 16 Oct 2026 03:20:03 -0700 Subject: [PATCH] fix(volcengine): unpack Ark parameters sent through extra_body --- .../llms/volcengine/videos/transformation.py | 7 ++++++- .../test_volcengine_video_transformation.py | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/litellm/llms/volcengine/videos/transformation.py b/litellm/llms/volcengine/videos/transformation.py index cd74af3649c..bbaa8d342a2 100644 --- a/litellm/llms/volcengine/videos/transformation.py +++ b/litellm/llms/volcengine/videos/transformation.py @@ -592,8 +592,13 @@ class VolcEngineVideoConfig(BaseVideoConfig): and an omitted length is sent as OpenAI's documented default of 4 seconds, since the 2.5 family's own default is ``-1``. """ - params: Final = video_create_optional_request_params drop_params: Final = _drops_params(litellm_params) + params: Final = MappingProxyType( + { + **{key: value for key, value in video_create_optional_request_params.items() if key != "parameters"}, + **_parameters_fields(video_create_optional_request_params.get("parameters"), model, drop_params), + } + ) content: Final = _sent_content(prompt, params, model, drop_params) if params.get("frames") is not None and not drop_params: raise _droppable(model, "frames is not supported through litellm, pass seconds instead") diff --git a/tests/unit/llms/volcengine/test_volcengine_video_transformation.py b/tests/unit/llms/volcengine/test_volcengine_video_transformation.py index c2e4a34581b..6ba09d202dc 100644 --- a/tests/unit/llms/volcengine/test_volcengine_video_transformation.py +++ b/tests/unit/llms/volcengine/test_volcengine_video_transformation.py @@ -876,6 +876,24 @@ async def test_seconds_size_and_extra_body_content_reach_the_wire(): } +@pytest.mark.asyncio +@pytest.mark.parametrize( + "fields", + [{"parameters": {"seed": 3}}, {"extra_body": {"parameters": {"seed": 3}}}], + ids=["top_level", "extra_body"], +) +async def test_parameters_reach_the_wire_unpacked_whether_sent_top_level_or_in_extra_body(fields: dict[str, object]): + body = await _wire_body(model=f"volcengine/{SEEDANCE_2_5}", prompt="p", seconds="4", **fields) + + assert body == { + "model": SEEDANCE_2_5, + "content": [{"type": "text", "text": "p"}], + "resolution": "720p", + "duration": 4, + "seed": 3, + } + + @pytest.mark.asyncio async def test_an_extra_body_duration_of_minus_one_is_rejected_before_anything_is_sent(): with pytest.raises(UnsupportedParamsError, match="Ark-picked length"):