Skip to main content

instrumentModelCall

@retinue/monorepo


@retinue/monorepo / backend/src / instrumentModelCall

Function: instrumentModelCall()

instrumentModelCall<T>(deps, input, call): Promise<T>

Defined in: backend/src/telemetry/instrument.ts:183

Time a model call — latency, outcome and the model, with no prompt anywhere near it.

The attributes are the model id and the outcome. Not the prompt, not the response, not the token contents — the counts are on the usage ledger, which is the place designed to hold them and which is tenant-scoped.

Type Parameters​

T​

T

Parameters​

deps​

metrics​

RunMetrics

now?​

() => number

telemetry​

Telemetry

input​

modelId​

string

providerId?​

string

runId?​

string

tenantId​

string

call​

() => Promise<T>

Returns​

Promise<T>