def test_prepare_chat_with_tools_tool_not_required(llm):
    """Test that tool_required=False correctly sets tool_choice to 'auto'."""
    user_msg = "Search for information about Python"

    # Test with tool_required=False (default)
    result = llm._prepare_chat_with_tools(
        tools=[search_tool], user_msg=user_msg, tool_required=False
    )

    assert result["tool_choice"] == "auto"
    assert len(result["tools"]) == 1
    assert result["tools"][0]["function"]["name"] == "search_tool"
Test that tool_required=False correctly sets tool_choice to 'auto'.
llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/test_llms_oci_data_science.py