Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/agent / run-state / addModelUsage

Function: addModelUsage()

ts
function addModelUsage(
   state, 
   modelId, 
   delta): void;

Defined in: packages/agent/src/run-state/index.ts:333

Append a per-model usage entry to RunState.usageByModel. Mutates the supplied state in place — used by the agent runtime's per-step retry loop. Pure callers that need an immutable update should clone the state first.

Parameters

ParameterType
stateRunState
modelIdstring
deltaUsage

Returns

void

Stable