generateContent method

  1. @override
Future<String?> generateContent(
  1. GenerativeModel generativeModel,
  2. String prompt
)
override

Generates a response from the backend with the provided text represented Content.

Implementation

@override
Future<String?> generateContent(
  GenerativeModel generativeModel,
  String prompt,
) async {
  Map<String, dynamic> input = {
    "prompt": prompt,
  };
  input.addAll(Map.from(generativeModel.toMap()));
  return await methodChannel.invokeMethod<String>(
    'generateContent',
    Map.from(input),
  );
}