generateContent method

Future<GenerateContentResponse> generateContent(
  1. List<Content> prompt
)

Generates a response from the backend with the provided Contents. prompt A group of Contents to send to the model. Returns a GenerateContentResponse after some delay. Function should be called within a async function

Implementation

Future<GenerateContentResponse> generateContent(List<Content> prompt) async {
  try {
    return (await _controller.generateContent(await _buildRequest(prompt))).toPublic().validate();
  } catch (e) {
    throw GoogleGenerativeAIException.from(e);
  }
}