It iterates through the events in reverse order, and returns the event containing a function call with a functionCall.id matching the functionResponse.id from the last event in the session.
It iterates through the events in reverse order, and returns the event containing a function call with a functionCall.id matching the functionResponse.id from the last event in the session.