getResponse method

  1. @override
Future<String?> getResponse({
  1. required String prompt,
})
override

Implementation

@override
Future<String?> getResponse({required String prompt}) async {
  if (_initCompleter.isCompleted) {
    return await methodChannel.invokeMethod<String>('getGemmaResponse', {'prompt': prompt});
  } else {
    throw Exception('Gemma is not initialized yet');
  }
}