streamFromInputStream method

  1. @override
Stream<ChatResult> streamFromInputStream(
  1. Stream<PromptValue> inputStream, {
  2. Options? options,
})
override

Streams the output of invoking the Runnable on the given inputStream.

  • inputStream - the input stream to invoke the Runnable on.
  • options - the options to use when invoking the Runnable.

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);
}