generateContentStream method
Stream<String>
generateContentStream(
- GenerativeModel generativeModel,
- String prompt,
- List<
File> ? images
override
Generates a streaming response from the backend with the provided text represented Content.
Implementation
@override
Stream<String> generateContentStream(
GenerativeModel generativeModel,
String prompt,
List<File>? images,
) async* {
Map<String, dynamic> input = _getGenerateContentInput(
generativeModel,
prompt,
images,
);
input["method"] = "generateContentStream";
yield* _eventChannel
.receiveBroadcastStream(Map.from(input))
.map<String>((event) {
return event;
});
}