Skip to content

Commit 04fa714

Browse files
Update test to match new parallel_tool_calls behavior
Changed test_prepare_options_removes_parallel_tool_calls_when_no_tools to test_prepare_options_preserves_parallel_tool_calls_when_no_tools to reflect that parallel_tool_calls is now preserved even when no tools are present, consistent with the tool_choice behavior.
1 parent b031755 commit 04fa714

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/packages/core/tests/openai/test_openai_chat_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -890,17 +890,17 @@ def test_multiple_function_calls_in_single_message(openai_unit_test_env: dict[st
890890
assert prepared[0]["tool_calls"][1]["id"] == "call_2"
891891

892892

893-
def test_prepare_options_removes_parallel_tool_calls_when_no_tools(openai_unit_test_env: dict[str, str]) -> None:
894-
"""Test that parallel_tool_calls is removed when no tools are present."""
893+
def test_prepare_options_preserves_parallel_tool_calls_when_no_tools(openai_unit_test_env: dict[str, str]) -> None:
894+
"""Test that parallel_tool_calls is preserved even when no tools are present."""
895895
client = OpenAIChatClient()
896896

897897
messages = [ChatMessage(role="user", text="test")]
898898
options = {"allow_multiple_tool_calls": True}
899899

900900
prepared_options = client._prepare_options(messages, options)
901901

902-
# Should not have parallel_tool_calls when no tools
903-
assert "parallel_tool_calls" not in prepared_options
902+
# parallel_tool_calls is preserved even when no tools (consistent with tool_choice behavior)
903+
assert prepared_options.get("parallel_tool_calls") is True
904904

905905

906906
async def test_streaming_exception_handling(openai_unit_test_env: dict[str, str]) -> None:

0 commit comments

Comments
 (0)