Skip to content

DoneResult

Defined in: packages/sdk/src/result.ts:83

A run that finished: the model answered without calling a tool, or an output tool accepted its answer. output is the accepted answer, and undefined when the run has no output tool, the model answered in text, or another tool ended the run with terminate: true. A text answer cut off at the output limit also ends done; its message’s stopReason is then "length".

S

readonly context: Context

Defined in: packages/sdk/src/result.ts:65

The whole conversation, earlier history included, ready for continueRun().

ResultBase.context


readonly cost: Cost

Defined in: packages/sdk/src/result.ts:72

The cost of every model call, summed. It is unknown if any call’s cost is. A run that made no call costs an exact 0 with basis provider, so adding it to another cost keeps that cost’s basis.

ResultBase.cost


readonly messages: readonly Message[]

Defined in: packages/sdk/src/result.ts:63

The messages this run added: the input, if any, then every response and tool result, in order.

ResultBase.messages


readonly output: S | undefined

Defined in: packages/sdk/src/result.ts:85


readonly steps: number

Defined in: packages/sdk/src/result.ts:74

How many model calls the run made.

ResultBase.steps


readonly stopReason: "done"

Defined in: packages/sdk/src/result.ts:84


readonly usage: Usage

Defined in: packages/sdk/src/result.ts:67

The tokens of every model call, summed.

ResultBase.usage

These docs are licensedCC BY 4.0. Thelicence text is in the repository.