startChatStream method
Stream<String>
startChatStream(
- GenerativeModel generativeModel,
- String prompt, {
- List<
ChatMessage> ? history,
override
Generates a streaming response from the backend with the provided Contents.
Implementation
@override
Stream<String> startChatStream(
GenerativeModel generativeModel,
String prompt, {
List<ChatMessage>? history,
}) async* {
Map<String, dynamic> input = _getStartChatInput(
generativeModel,
prompt,
history: history,
);
input["method"] = "startChatStream";
yield* _eventChannel
.receiveBroadcastStream(Map.from(input))
.map<String>((event) {
return event;
});
}