Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/provider / / WithCostLimitOptions
Interface: WithCostLimitOptions
Defined in: packages/provider/src/middleware/with-cost-limit.ts:22
Options for withCostLimit.
Stable
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
logger? | readonly | (message, meta?) => void | Optional sink for 'warn' mode. Defaults to console.warn. | packages/provider/src/middleware/with-cost-limit.ts:43 |
maxPerHour? | readonly | number | Maximum cumulative USD cost per hour. | packages/provider/src/middleware/with-cost-limit.ts:28 |
maxPerRun? | readonly | number | Maximum cumulative USD cost per run. | packages/provider/src/middleware/with-cost-limit.ts:26 |
maxPerSession? | readonly | number | Maximum cumulative USD cost per session. | packages/provider/src/middleware/with-cost-limit.ts:24 |
onExceed? | readonly | "warn" | "throw" | What to do on breach. Default 'throw'. | packages/provider/src/middleware/with-cost-limit.ts:30 |
resolveObservedCost? | readonly | (scope, metadata) => number | Resolver returning the current observed cost for the relevant scope. The resolver lets consumers wire any accumulator (the shipped @graphorin/observability/cost.CostTracker works out of the box). When unset, the middleware is a no-op (a placeholder for tooling that wires the accumulator later). | packages/provider/src/middleware/with-cost-limit.ts:38 |