mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
Add total cost to environment details (#1788)
* Add total cost to environment details * Update src/core/Cline.ts Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Update src/core/Cline.ts --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
parent
a15691dc1d
commit
ff14efac81
1 changed files with 2 additions and 2 deletions
|
|
@ -3691,13 +3691,13 @@ export class Cline extends EventEmitter<ClineEvents> {
|
|||
details += `\n\n# Current Time\n${formatter.format(now)} (${timeZone}, UTC${timeZoneOffsetStr})`
|
||||
|
||||
// Add context tokens information
|
||||
const { contextTokens } = getApiMetrics(this.clineMessages)
|
||||
const { contextTokens, totalCost } = getApiMetrics(this.clineMessages)
|
||||
const modelInfo = this.api.getModel().info
|
||||
const contextWindow = modelInfo.contextWindow
|
||||
const contextPercentage =
|
||||
contextTokens && contextWindow ? Math.round((contextTokens / contextWindow) * 100) : undefined
|
||||
details += `\n\n# Current Context Size (Tokens)\n${contextTokens ? `${contextTokens.toLocaleString()} (${contextPercentage}%)` : "(Not available)"}`
|
||||
|
||||
details += `\n\n# Current Cost\n${totalCost !== null ? `$${totalCost.toFixed(2)}` : "(Not available)"}`
|
||||
// Add current mode and any mode-specific warnings
|
||||
const {
|
||||
mode,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue