MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / tokenReporter

Interface tokenReporter

commands.go:56–59  ·  view source on GitHub ↗

tokenReporter is what cmdTokens type-asserts to. We didn't widen the Provider interface because not every backend has a "tokens" concept; any provider that does just satisfies this implicit contract.

Source from the content-addressed store, hash-verified

54// Provider interface because not every backend has a "tokens" concept; any
55// provider that does just satisfies this implicit contract.
56type tokenReporter interface {
57 TotalUsage() api.Usage
58 EstimatedCostUSD() float64
59}
60
61func cmdTokens(_ string) {
62 stats, ok := rootAgent.Provider.(tokenReporter)

Callers 4

cmdTokensFunction · 0.65
mainFunction · 0.65
cmdTokensFunction · 0.65
mainFunction · 0.65

Implementers 2

AnthropicProviderinternal/provider/anthropic.go
OpenAIProviderinternal/provider/openai.go

Calls

no outgoing calls

Tested by

no test coverage detected