I'm completely new to Flutter and trying to call an asynchronous function. I keep getting
Error: The argument type 'Future<String> Function()'can't be assigned to the parameter type 'String'.
When I try to await the function inside an asynchronous function, it also doesn't work for me. How do I fix this?
messages.add(ChatMessage(
messageContent: getCompletionOpenAi(myController.text),
messageType: "receiver",
));