Record Class ModelChunk
java.lang.Object
java.lang.Record
ai.badmonkey.agentspaces.springai.model.wire.ModelChunk
- Record Components:
requestId- the request it streamsattempt- which attempt produced it; a higher attempt means the first server diedseq- the chunk's position in its attempt, from 0deltas- the deltas, in orderlast- whether this chunk ends the attempt's streamusage- token usage, on the last chunkerror- the provider's error, on a last chunk that failedservedBy- the serving peer
public record ModelChunk(String requestId, int attempt, int seq, List<WireGeneration> deltas, boolean last, WireUsage usage, String error, String servedBy)
extends Record
A batch of streamed deltas. Chunks are short-leased, so they collect
themselves; the full answer also lands as the request's
ModelResponse.-
Constructor Summary
ConstructorsConstructorDescriptionModelChunk(String requestId, int attempt, int seq, List<WireGeneration> deltas, boolean last, WireUsage usage, String error, String servedBy) Normalizes an absent list. -
Method Summary
Modifier and TypeMethodDescriptionintattempt()Returns the value of theattemptrecord component.deltas()Returns the value of thedeltasrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.final inthashCode()Returns a hash code value for this object.booleanlast()Returns the value of thelastrecord component.Returns the value of therequestIdrecord component.intseq()Returns the value of theseqrecord component.servedBy()Returns the value of theservedByrecord component.final StringtoString()Returns a string representation of this record class.usage()Returns the value of theusagerecord component.
-
Constructor Details
-
ModelChunk
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
requestId
-
attempt
-
seq
-
deltas
-
last
-
usage
-
error
-
servedBy
-