mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
code review followup for compress command (#1097)
Followup to https://github.com/google-gemini/gemini-cli/pull/986
This commit is contained in:
@@ -475,9 +475,11 @@ export class GeminiClient {
|
||||
await cg.countTokens({ model: this.model, contents: newHistory })
|
||||
).totalTokens;
|
||||
|
||||
return {
|
||||
originalTokenCount,
|
||||
newTokenCount,
|
||||
};
|
||||
return originalTokenCount && newTokenCount
|
||||
? {
|
||||
originalTokenCount,
|
||||
newTokenCount,
|
||||
}
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,13 +110,13 @@ export type ServerGeminiErrorEvent = {
|
||||
};
|
||||
|
||||
export interface ChatCompressionInfo {
|
||||
originalTokenCount: number | undefined;
|
||||
newTokenCount: number | undefined;
|
||||
originalTokenCount: number;
|
||||
newTokenCount: number;
|
||||
}
|
||||
|
||||
export type ServerGeminiChatCompressedEvent = {
|
||||
type: GeminiEventType.ChatCompressed;
|
||||
value: ChatCompressionInfo;
|
||||
value: ChatCompressionInfo | null;
|
||||
};
|
||||
|
||||
export type ServerGeminiUsageMetadataEvent = {
|
||||
|
||||
Reference in New Issue
Block a user