>>543669854
Some providers actually have specialized inference code that ensures the model formats its toolcalls correctly. I don't know exactly how it's implemented, but on a technical level, it's actually pretty simple.
Moonshot AI admittedly does this.