Skip to main content

Interface: SpendCondition()

Defined in: packages/core/src/utils/spend.ts:104

AI SDK-compatible stop condition. Receives the completed steps array from streamText / generateText.

Extends​

SpendCondition(options): boolean | PromiseLike<boolean>

Defined in: packages/core/src/utils/spend.ts:104

AI SDK-compatible stop condition. Receives the completed steps array from streamText / generateText.

Parameters​

options​

steps​

StepResult<any, any>[]

Returns​

boolean | PromiseLike<boolean>

Methods​

exceeded()​

exceeded(): boolean

Defined in: packages/core/src/utils/spend.ts:108

Whether the ceiling has stopped the loop.

Returns​

boolean


spent()​

spent(): number

Defined in: packages/core/src/utils/spend.ts:106

USD this loop's steps have cost so far (excludes readSpend).

Returns​

number