streamText method

Stream<StreamPart> streamText(
  1. Object prompt, [
  2. GenerateTextOptions? options
])

Stream text, yielding typed StreamParts.

prompt may be a String or a List<Map<String, dynamic>> of messages, matching the raw Model.streamText contract. The stream blocks the calling isolate until completion (see aimux.dart for FFI semantics).

Implementation

Stream<StreamPart> streamText(
  Object prompt, [
  GenerateTextOptions? options,
]) {
  return _raw.streamText(prompt, options?.toJson()).map(StreamPart.fromJson);
}