GenerateTurnState class final
The state of one turn of the generate tool loop, as seen by GenerateMiddleware.generate.
A class rather than a record so fields can be added without breaking middleware that constructs one. Middleware typically rewrites only the request:
return next(envelope.copyWith(request: newOptions), ctx);
Constructors
- GenerateTurnState({required GenerateActionOptions request, int currentTurn = 0, int messageIndex = 0})
Properties
- currentTurn → int
-
Zero-based index of this turn in the tool loop.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- messageIndex → int
-
Index of the next message in the response stream; used to tag streamed
chunks with the message they belong to.
final
- request → GenerateActionOptions
-
The generate request for this turn.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{GenerateActionOptions? request, int? currentTurn, int? messageIndex}) → GenerateTurnState - Returns a copy with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited