Interface: DoneSegment
Defined in: packages/core/src/stream-segments/types.ts:209
The end of a response, with its reason.
Extends
Properties
agentId
agentId:
string
Defined in: packages/core/src/stream-segments/types.ts:228
Set in group chat.
Overrides
agentName?
optionalagentName?:string
Defined in: packages/core/src/stream-segments/types.ts:15
Inherited from
avatarEmoji?
optionalavatarEmoji?:string
Defined in: packages/core/src/stream-segments/types.ts:16
Inherited from
cacheReadTokens?
optionalcacheReadTokens?:number
Defined in: packages/core/src/stream-segments/types.ts:225
cacheWriteTokens?
optionalcacheWriteTokens?:number
Defined in: packages/core/src/stream-segments/types.ts:226
duration_ms
duration_ms:
number
Defined in: packages/core/src/stream-segments/types.ts:212
durationDisplay
durationDisplay:
string
Defined in: packages/core/src/stream-segments/types.ts:215
error?
optionalerror?:object
Defined in: packages/core/src/stream-segments/types.ts:231
code
code:
string
message
message:
string
id
id:
string
Defined in: packages/core/src/stream-segments/types.ts:10
Inherited from
inputTokens?
optionalinputTokens?:number
Defined in: packages/core/src/stream-segments/types.ts:223
The rest of the done event's token counts, so a stored turn reports the
usage its live stream did (uiMessagesFromSegments).
iterationCount?
optionaliterationCount?:number
Defined in: packages/core/src/stream-segments/types.ts:217
outputTokens?
optionaloutputTokens?:number
Defined in: packages/core/src/stream-segments/types.ts:224
parentAgentId?
optionalparentAgentId?:string
Defined in: packages/core/src/stream-segments/types.ts:229
reason
reason:
"error"|"turn_yielded"|"out_of_iterations"|"max_tokens_reached"|"interrupted"|"awaiting_interrupt"|"no_applicable_tools"|"max_depth_reached"|"graceful_shutdown"
Defined in: packages/core/src/stream-segments/types.ts:211
reasonDisplay
reasonDisplay:
string
Defined in: packages/core/src/stream-segments/types.ts:214
reasoningTokens?
optionalreasoningTokens?:number
Defined in: packages/core/src/stream-segments/types.ts:227
step?
optionalstep?:number
Defined in: packages/core/src/stream-segments/types.ts:24
The model step (0-based, within its turn) that produced this segment.
History stamps it when the step finishes, so a turn is rebuilt for the
next request one step at a time, in the order it was sent (see
deriveAPIMessages). Absent on segments stored without it, which are
rebuilt as one assistant message per turn.
Inherited from
timestamp
timestamp:
number
Defined in: packages/core/src/stream-segments/types.ts:12
Epoch milliseconds.
Inherited from
tokensUsed?
optionaltokensUsed?:number
Defined in: packages/core/src/stream-segments/types.ts:218
type
type:
"done"
Defined in: packages/core/src/stream-segments/types.ts:210