streamFromInputStream method
Stream<ChatResult>
streamFromInputStream(
- Stream<
PromptValue> inputStream, { - ChatOllamaOptions? options,
inherited
Streams the output of invoking the Runnable
on the given inputStream
.
inputStream
- the input stream to invoke theRunnable
on.options
- the options to use when invoking theRunnable
.
Implementation
@override
Stream<ChatResult> streamFromInputStream(
final Stream<PromptValue> inputStream, {
final Options? options,
}) async* {
final input = await inputStream.toList();
final reduced = reduce<PromptValue>(input);
yield* stream(reduced, options: options);
}