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.
| 54 | // Provider interface because not every backend has a "tokens" concept; any |
| 55 | // provider that does just satisfies this implicit contract. |
| 56 | type tokenReporter interface { |
| 57 | TotalUsage() api.Usage |
| 58 | EstimatedCostUSD() float64 |
| 59 | } |
| 60 | |
| 61 | func cmdTokens(_ string) { |
| 62 | stats, ok := rootAgent.Provider.(tokenReporter) |
no outgoing calls
no test coverage detected