ask method

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

Implementation

@override
Future<String?> ask({
  required String prompt,
}) async {
  try {
    GenerateContentResponse generateContentResponse = await generativeModel.generateContent(
      [
        Content.text(prompt),
      ],
    );
    return generateContentResponse.text;
  } catch (e) {
    return null;
  }
}