Interface: IUsageCheckArgs
Defined in: internal/usage-guard/types.ts:142
The question of a check: the call's factors and a rough size of the call.
Built by the LLMClient from the request it is about to send.
Extends
Properties
kind
kind:
ETraceKind
Defined in: internal/usage-guard/types.ts:130
What the call is for: the answer, a run step, a guardrail judge, a query rewrite, an embedding, a memory update.
Inherited from
modelId
modelId:
string
Defined in: internal/usage-guard/types.ts:128
The model that answers: the profile's main or cheap model, or the embedding model.
Inherited from
neededTokens
neededTokens:
object
Defined in: internal/usage-guard/types.ts:149
A rough size of the call, for an adapter that wants to compare before it answers.
inputisestimateRequestTokensof the request (a real tokenizer for OpenAI, a safe factor for the other providers);outputis the call'smaxOutputTokens, the worst case.
input
input:
number
output
output:
number
profileId?
optionalprofileId?:string
Defined in: internal/usage-guard/types.ts:126
The profile the call runs on. Absent for system jobs (e.g. KB ingestion).
Inherited from
runId?
optionalrunId?:string
Defined in: internal/usage-guard/types.ts:134
The run the call is a step of; absent outside a run.
Inherited from
tenantId
tenantId:
string
Defined in: internal/usage-guard/types.ts:122
The tenant that pays: every limit of the app is at least per tenant.
Inherited from
threadId?
optionalthreadId?:string
Defined in: internal/usage-guard/types.ts:132
The thread of the call; absent for a call outside a thread (an embedding, a KB ingestion).
Inherited from
traceId
traceId:
string
Defined in: internal/usage-guard/types.ts:120
The id of the call's trace entry: links a report to the trace and pairs a check with its addUsage.
Inherited from
userId?
optionaluserId?:string
Defined in: internal/usage-guard/types.ts:124
Absent for system jobs (e.g. KB ingestion).