mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-20 18:14:29 -07:00
feat(core): add per-model token usage to stream-json output (#21839)
This commit is contained in:
@@ -154,6 +154,7 @@ describe('StreamJsonFormatter', () => {
|
||||
input: 50,
|
||||
duration_ms: 1200,
|
||||
tool_calls: 2,
|
||||
models: {},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -180,6 +181,7 @@ describe('StreamJsonFormatter', () => {
|
||||
input: 50,
|
||||
duration_ms: 1200,
|
||||
tool_calls: 0,
|
||||
models: {},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -304,6 +306,15 @@ describe('StreamJsonFormatter', () => {
|
||||
input: 50,
|
||||
duration_ms: 1200,
|
||||
tool_calls: 2,
|
||||
models: {
|
||||
'gemini-2.0-flash': {
|
||||
total_tokens: 80,
|
||||
input_tokens: 50,
|
||||
output_tokens: 30,
|
||||
cached: 0,
|
||||
input: 50,
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -347,6 +358,22 @@ describe('StreamJsonFormatter', () => {
|
||||
input: 150,
|
||||
duration_ms: 3000,
|
||||
tool_calls: 5,
|
||||
models: {
|
||||
'gemini-pro': {
|
||||
total_tokens: 80,
|
||||
input_tokens: 50,
|
||||
output_tokens: 30,
|
||||
cached: 0,
|
||||
input: 50,
|
||||
},
|
||||
'gemini-ultra': {
|
||||
total_tokens: 170,
|
||||
input_tokens: 100,
|
||||
output_tokens: 70,
|
||||
cached: 0,
|
||||
input: 100,
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -376,6 +403,15 @@ describe('StreamJsonFormatter', () => {
|
||||
input: 20,
|
||||
duration_ms: 1200,
|
||||
tool_calls: 0,
|
||||
models: {
|
||||
'gemini-pro': {
|
||||
total_tokens: 80,
|
||||
input_tokens: 50,
|
||||
output_tokens: 30,
|
||||
cached: 30,
|
||||
input: 20,
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -392,6 +428,7 @@ describe('StreamJsonFormatter', () => {
|
||||
input: 0,
|
||||
duration_ms: 100,
|
||||
tool_calls: 0,
|
||||
models: {},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -521,6 +558,7 @@ describe('StreamJsonFormatter', () => {
|
||||
input: 0,
|
||||
duration_ms: 0,
|
||||
tool_calls: 0,
|
||||
models: {},
|
||||
},
|
||||
} as ResultEvent,
|
||||
];
|
||||
@@ -544,6 +582,7 @@ describe('StreamJsonFormatter', () => {
|
||||
input: 50,
|
||||
duration_ms: 1200,
|
||||
tool_calls: 2,
|
||||
models: {},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user