Invoked when the LLM attempts to invoke a function. The provided callback must be provided with a return value.