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

Method getOrCreateRecord

cli/cost_tracker.go:358–368  ·  view source on GitHub ↗

--- Internal helpers ---

(key, provider, model string)

Source from the content-addressed store, hash-verified

356// --- Internal helpers ---
357
358func (ct *CostTracker) getOrCreateRecord(key, provider, model string) *ModelUsageRecord {
359 rec, ok := ct.modelUsage[key]
360 if !ok {
361 rec = &ModelUsageRecord{
362 Provider: provider,
363 Model: model,
364 }
365 ct.modelUsage[key] = rec
366 }
367 return rec
368}
369
370func (ct *CostTracker) recomputeCost(rec *ModelUsageRecord) {
371 inputCost, outputCost := getModelPricing(rec.Provider, rec.Model)

Callers 1

RecordRealUsageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected