streamTextAsOpenAI method
Stream text with OpenAI Chat Completions output, yielding typed ChatCompletionChunks (RFC-0026).
prompt may be a String or a List<Map<String, dynamic>> of messages.
Stream options (include_usage, include_reasoning) are passed via
options.providerOptions → openai.stream_options on the wire.
Implementation
Stream<ChatCompletionChunk> streamTextAsOpenAI(
Object prompt, [
GenerateTextOptions? options,
]) {
return _raw
.streamTextAsOpenAI(prompt, options?.toJson())
.map(ChatCompletionChunk.fromJson);
}