How can I use function calling on functions with different inputs

I have noticed openAI changed how they give back the function to be called. Before, it was a string.
I have several functions to call. Some of them use local variables. Therefore, I have used ifs.
The issue is, now the function to be called is a function type.

                        functionResponse = await functionToCall(question);

Example of what I did given.
I am trying to make my code work again, with no success.

I know we can enumate the inputs. Nonetheless, those inputs are actually local variables!