stream property
Returns the chat as a stream Example:
chat.stream.listen((event) {
if (event is RequestChatEvent) {
print(event.request.message.message);
} else if (event is ResponseChatEvent) {
print(event.response.choices.first.message);
print(event.usage.totalTokens);
}
});
Implementation
Stream<ChatEvent> get stream => _streamController.stream;