Skip to main content

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​

IUsageCall.kind


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​

IUsageCall.modelId


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.

input is estimateRequestTokens of the request (a real tokenizer for OpenAI, a safe factor for the other providers); output is the call's maxOutputTokens, the worst case.

input​

input: number

output​

output: number


profileId?​

optional profileId?: 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​

IUsageCall.profileId


runId?​

optional runId?: string

Defined in: internal/usage-guard/types.ts:134

The run the call is a step of; absent outside a run.

Inherited from​

IUsageCall.runId


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​

IUsageCall.tenantId


threadId?​

optional threadId?: 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​

IUsageCall.threadId


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​

IUsageCall.traceId


userId?​

optional userId?: string

Defined in: internal/usage-guard/types.ts:124

Absent for system jobs (e.g. KB ingestion).

Inherited from​

IUsageCall.userId