ProviderStreamState class final
Mutable accumulation state for one streamed assistant message.
pi mutates a single output object; Dart types are immutable, so adapters
keep the pieces here and build an immutable snapshot per event instead
(same partial-first contract).
Constructors
- ProviderStreamState(Model model)
-
Creates stream state for
model.
Properties
-
blocks
→ List<
StreamingBlock> -
Ordered content blocks accumulated so far.
final
- errorMessage ↔ String?
-
Failure description for error/aborted terminal events.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- model → Model
-
The model being called.
final
- rateLimit ↔ RateLimitInfo?
-
The structured 429 decode (issue #867), set only by the terminal
error path; carried onto the finalized AssistantMessage.
getter/setter pair
- rawStopReason ↔ String?
-
The provider's raw stop/finish reason string as reported on the wire,
when the adapter parsed one (see AssistantMessage.rawStopReason).
getter/setter pair
- responseId ↔ String?
-
Provider-specific response/message identifier, when exposed upstream.
getter/setter pair
- responseModel ↔ String?
-
Concrete model id reported by the provider, when different from the
requested one (e.g. OpenRouter
autorouting).getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stopReason ↔ StopReason
-
Why the stream terminated (best guess until the terminal event).
getter/setter pair
- timestamp → DateTime
-
When the stream started (pi stores Unix milliseconds).
final
- usage ↔ Usage
-
Token/cost accounting as last reported by the provider.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
snapshot(
{bool finalize = false}) → AssistantMessage - Builds the immutable AssistantMessage carried by event snapshots.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited