streamFromInputStream method
Stream<List<ParsedToolCall> >
streamFromInputStream(
- Stream<
ChatResult> inputStream, { - OutputParserOptions? options,
override
Streams the output of invoking the Runnable on the given inputStream
.
Implementation
@override
Stream<List<ParsedToolCall>> streamFromInputStream(
final Stream<ChatResult> inputStream, {
final OutputParserOptions? options,
}) async* {
if (reduceOutputStream) {
await inputStream.forEach(
(final input) => _parseStream(input, options: options),
);
yield _lastOutput;
_clear();
} else {
yield* super
.streamFromInputStream(inputStream, options: options)
.distinct(const DeepCollectionEquality().equals)
.doOnCancel(_clear);
}
}