File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -1440,19 +1440,21 @@ export class Task extends EventEmitter<ClineEvents> {
14401440 this . isStreaming = false
14411441 }
14421442
1443- if (
1444- inputTokens > 0 ||
1445- outputTokens > 0 ||
1446- cacheWriteTokens > 0 ||
1447- cacheReadTokens > 0 ||
1448- typeof totalCost !== "undefined"
1449- ) {
1443+ if ( inputTokens > 0 || outputTokens > 0 || cacheWriteTokens > 0 || cacheReadTokens > 0 ) {
14501444 TelemetryService . instance . captureLlmCompletion ( this . taskId , {
14511445 inputTokens,
14521446 outputTokens,
14531447 cacheWriteTokens,
14541448 cacheReadTokens,
1455- cost : totalCost ,
1449+ cost :
1450+ totalCost ??
1451+ calculateApiCostAnthropic (
1452+ this . api . getModel ( ) . info ,
1453+ inputTokens ,
1454+ outputTokens ,
1455+ cacheWriteTokens ,
1456+ cacheReadTokens ,
1457+ ) ,
14561458 } )
14571459 }
14581460
You can’t perform that action at this time.
0 commit comments