getResponseAsync method
Implementation
@override
Stream<String?> getResponseAsync({required String prompt}) {
if (_initCompleter.isCompleted) {
methodChannel.invokeMethod('getGemmaResponseAsync', {'prompt': prompt});
return eventChannel.receiveBroadcastStream().map<String?>((event) => event as String?);
} else {
throw Exception('Gemma is not initialized yet');
}
}