RecordUsage records tokens used for a single LLM request (legacy path).
(provider, model string, promptTokens, completionTokens int)
| 159 | |
| 160 | // RecordUsage records tokens used for a single LLM request (legacy path). |
| 161 | func (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. |
| 171 | func (ct *CostTracker) EstimateAndRecord(provider, model string, inputChars, outputChars int) { |
nothing calls this directly
no test coverage detected