MCPcopy Create free account
hub / github.com/diillson/chatcli / RecordUsage

Method RecordUsage

cli/cost_tracker.go:161–168  ·  view source on GitHub ↗

RecordUsage records tokens used for a single LLM request (legacy path).

(provider, model string, promptTokens, completionTokens int)

Source from the content-addressed store, hash-verified

159
160// RecordUsage records tokens used for a single LLM request (legacy path).
161func (ct *CostTracker) RecordUsage(provider, model string, promptTokens, completionTokens int) {
162 ct.RecordRealUsage(provider, model, &models.UsageInfo{
163 PromptTokens: promptTokens,
164 CompletionTokens: completionTokens,
165 TotalTokens: promptTokens + completionTokens,
166 IsReal: false,
167 })
168}
169
170// EstimateAndRecord estimates tokens from text lengths and records usage.
171func (ct *CostTracker) EstimateAndRecord(provider, model string, inputChars, outputChars int) {

Callers

nothing calls this directly

Calls 1

RecordRealUsageMethod · 0.95

Tested by

no test coverage detected