LLMStreamingResult class
Result of streaming LLM text generation Matches Swift's LLMStreamingResult
Contains:
stream: Stream of tokens as they are generatedresult: Future that completes with final generation metricscancel: Function to cancel the generation
Constructors
-
LLMStreamingResult({required Stream<
String> stream, required Future<LLMGenerationResult> result, required void cancel()}) -
const
Properties
- cancel → void Function()
-
Function to cancel the ongoing generation.
Call this to stop generation early (e.g., user pressed stop button).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
result
→ Future<
LLMGenerationResult> -
Future that completes with the final generation result and metrics
when streaming finishes. Wait for this after consuming the stream
to get the complete analytics.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
String> -
Stream of tokens as they are generated.
Listen to this to receive real-time token updates.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited