EngineTurn class final

One turn, as the engine produces it.

Contract: end never completes with an error (a failed turn puts its error on text); it completes after text is done, and also when the consumer cancels text. An engine that cannot say how its turns end passes end: null and must keep StructuredOutputSupport.none; so must an engine whose end is a guess for some turns (LiteRT-LM 0.18 cannot tell endOfSequence from outputLimit or contextLimit).

The engine must keep its own context aligned with core's history. A turn whose text fails commits nothing: restore the engine context to before that turn, or make the session unusable and report TurnEnd.closed if it cannot be restored. A stopped turn that emitted no non-empty text is also restored; a stop after text keeps the partial exchange.

Constructors

EngineTurn({required Stream<String> text, required Future<TurnEnd>? end})

Properties

end → Future<TurnEnd>?
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
text → Stream<String>
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