I notice that this went unanswered, so I hope this may still be useful.
The interconnect definition should be outside the cell definition. The width specified is the default width for the interconnect and can be overridden when needed. Your code would then look something like:
ic = Interconnect(width=4, xs="XXXX") @hashme("wg") def wgs(WG_width): with nd.Cell() as wg: ic.taper(width2=WG_width, length=10).put() return wg wgs(1).put(0, 0) wgs(2).put(0, 10)