The AI generates tokens, whether the text of squirrel poems or the invocation of function parameters, and it is still processed through the logit function allowing less-likely token options to be chosen, unless temperature is cranked up to 0.01. (100x logprob spread).
I’ve started (and finished for me) such an idea. It would be improved if it understood the information domain of asking that would invoke functions.
One might resubmit if a function was invoked - but the very action of a function being called instead of content text being produced is decided on by the first token output probability.