mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Fix Groq context window display (#7839)
This commit is contained in:
parent
48d592f433
commit
7cd6520302
2 changed files with 2 additions and 13 deletions
|
|
@ -149,7 +149,7 @@ describe("GroqHandler", () => {
|
|||
expect(firstChunk.done).toBe(false)
|
||||
expect(firstChunk.value).toMatchObject({
|
||||
type: "usage",
|
||||
inputTokens: 70, // 100 total - 30 cached
|
||||
inputTokens: 100,
|
||||
outputTokens: 50,
|
||||
cacheWriteTokens: 0,
|
||||
cacheReadTokens: 30,
|
||||
|
|
|
|||
|
|
@ -66,20 +66,9 @@ export class GroqHandler extends BaseOpenAiCompatibleProvider<GroqModelId> {
|
|||
// Calculate cost using OpenAI-compatible cost calculation
|
||||
const totalCost = calculateApiCostOpenAI(info, inputTokens, outputTokens, cacheWriteTokens, cacheReadTokens)
|
||||
|
||||
// Calculate non-cached input tokens for proper reporting
|
||||
const nonCachedInputTokens = Math.max(0, inputTokens - cacheReadTokens - cacheWriteTokens)
|
||||
|
||||
console.log("usage", {
|
||||
inputTokens: nonCachedInputTokens,
|
||||
outputTokens,
|
||||
cacheWriteTokens,
|
||||
cacheReadTokens,
|
||||
totalCost,
|
||||
})
|
||||
|
||||
yield {
|
||||
type: "usage",
|
||||
inputTokens: nonCachedInputTokens,
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
cacheWriteTokens,
|
||||
cacheReadTokens,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue