Browse Source

Remove unnecessary cost calculation from vscode-lm.ts (#2875)

* feat: Removed unnecessary cost calculation

* Update vscode-lm.ts

---------

Co-authored-by: Matt Rubens <[email protected]>
Dominik Oswald 8 months ago
parent
commit
844753e0d9
1 changed files with 1 additions and 3 deletions
  1. 1 3
      src/api/providers/vscode-lm.ts

+ 1 - 3
src/api/providers/vscode-lm.ts

@@ -2,7 +2,6 @@ import { Anthropic } from "@anthropic-ai/sdk"
 import * as vscode from "vscode"
 
 import { SingleCompletionHandler } from "../"
-import { calculateApiCostAnthropic } from "../../utils/cost"
 import { ApiStream } from "../transform/stream"
 import { convertToVsCodeLmMessages } from "../transform/vscode-lm-format"
 import { SELECTOR_SEPARATOR, stringifyVsCodeLmModelSelector } from "../../shared/vsCodeSelectorUtils"
@@ -443,8 +442,7 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
 			yield {
 				type: "usage",
 				inputTokens: totalInputTokens,
-				outputTokens: totalOutputTokens,
-				totalCost: calculateApiCostAnthropic(this.getModel().info, totalInputTokens, totalOutputTokens),
+				outputTokens: totalOutputTokens
 			}
 		} catch (error: unknown) {
 			this.ensureCleanState()