streamFromInputStream method

  1. @override
Stream<PromptValue> streamFromInputStream(
  1. Stream<InputValues> inputStream, {
  2. BaseLangChainOptions? 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<PromptValue> streamFromInputStream(
  final Stream<InputValues> inputStream, {
  final BaseLangChainOptions? options,
}) async* {
  final List<InputValues> input = await inputStream.toList();
  final InputValues reduced =
      input.isEmpty ? const {} : reduce<InputValues>(input);
  yield* stream(reduced, options: options);
}