diff --git a/tests/test_litellm/expected_responses_api_request/azure_shell_tool.json b/tests/test_litellm/expected_responses_api_request/azure_shell_tool.json index b716c518106..48aaa842964 100644 --- a/tests/test_litellm/expected_responses_api_request/azure_shell_tool.json +++ b/tests/test_litellm/expected_responses_api_request/azure_shell_tool.json @@ -1,6 +1,11 @@ { "model": "gpt-5-mini", - "input": "List files in /mnt/data and run python --version.", + "input": [ + { + "role": "user", + "content": "List files in /mnt/data and run python --version." + } + ], "tools": [ { "type": "shell", diff --git a/tests/test_litellm/expected_responses_api_request/context_management_and_shell.json b/tests/test_litellm/expected_responses_api_request/context_management_and_shell.json index 1e34b230182..7dc5565bc1e 100644 --- a/tests/test_litellm/expected_responses_api_request/context_management_and_shell.json +++ b/tests/test_litellm/expected_responses_api_request/context_management_and_shell.json @@ -1,6 +1,11 @@ { "model": "gpt-4o", - "input": "List files in /mnt/data and run python --version.", + "input": [ + { + "role": "user", + "content": "List files in /mnt/data and run python --version." + } + ], "context_management": [ { "type": "compaction", diff --git a/tests/test_litellm/responses/test_responses_api_request_body.py b/tests/test_litellm/responses/test_responses_api_request_body.py index 77d20e7dec2..e67708b70d3 100644 --- a/tests/test_litellm/responses/test_responses_api_request_body.py +++ b/tests/test_litellm/responses/test_responses_api_request_body.py @@ -219,53 +219,7 @@ async def test_aresponses_drops_stream_options(): post_kwargs = mock_post.call_args.kwargs request_body = post_kwargs["json"] if "json" in post_kwargs else json.loads(post_kwargs["data"]) assert "stream_options" not in request_body - - -@pytest.mark.asyncio -async def test_aresponses_normalizes_string_input_to_user_list(): - with patch( - "litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler.post", - new_callable=AsyncMock, - ) as mock_post: - mock_post.return_value = MockResponse( - _minimal_responses_api_payload("resp_string_input", "gpt-5.5"), 200 - ) - - await litellm.aresponses( - model="openai/gpt-5.5", - api_key="fake-api-key", - input="Reply with exactly ROUTE_OK.", - max_output_tokens=64, - ) - - mock_post.assert_called_once() - post_kwargs = mock_post.call_args.kwargs - request_body = post_kwargs["json"] if "json" in post_kwargs else json.loads(post_kwargs["data"]) - assert request_body["input"] == [{"role": "user", "content": "Reply with exactly ROUTE_OK."}] - - -@pytest.mark.asyncio -async def test_aresponses_forwards_list_input_unchanged(): - list_input = [{"role": "user", "content": "Reply with exactly ROUTE_OK."}] - with patch( - "litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler.post", - new_callable=AsyncMock, - ) as mock_post: - mock_post.return_value = MockResponse( - _minimal_responses_api_payload("resp_list_input", "gpt-5.5"), 200 - ) - - await litellm.aresponses( - model="openai/gpt-5.5", - api_key="fake-api-key", - input=list_input, - max_output_tokens=64, - ) - - mock_post.assert_called_once() - post_kwargs = mock_post.call_args.kwargs - request_body = post_kwargs["json"] if "json" in post_kwargs else json.loads(post_kwargs["data"]) - assert request_body["input"] == list_input + assert request_body["input"] == [{"role": "user", "content": "hi"}] @pytest.mark.asyncio