How to create an assistant message after a function call in the new tools API?

Tools requires a matching ID between the tool call and the tool return. The assistant call and the tool reply must be paired as followup messages.

This helps the AI endpoint match two parallel calls to the same function name with their respective returns.