mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-08-09 00:16:57 -07:00
Feature: Implement V0 Episodic Context Manager
- Re-wrote the monolithic string-based context manipulation logic into an elegant, immutable Episodic IR pipeline. - Implemented four non-destructive degradation processors: `HistorySquashingProcessor`, `ToolMaskingProcessor`, `BlobDegradationProcessor`, and `SemanticCompressionProcessor`. - Added dynamic configuration knobs (`budget` and `strategies`) to precisely tune the retention algorithms. - Implemented a power-user `incrementalGc` flag for maximum context preservation beneath the ceiling. - Enforced strict typing across the new pipeline, replacing unsafe casts with robust mapping interfaces. - Added `powerUserProfile` to support features for those wanting a bit more quality at the cost of tokens.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type { PartListUnion, Part } from '@google/genai';
|
||||
import type { PartListUnion, Part, Content } from '@google/genai';
|
||||
import type { ContentGenerator } from '../core/contentGenerator.js';
|
||||
import { debugLogger } from './debugLogger.js';
|
||||
|
||||
@@ -139,6 +139,7 @@ export async function calculateRequestTokenCount(
|
||||
request: PartListUnion,
|
||||
contentGenerator: ContentGenerator,
|
||||
model: string,
|
||||
history?: readonly Content[],
|
||||
): Promise<number> {
|
||||
const parts: Part[] = Array.isArray(request)
|
||||
? request.map((p) => (typeof p === 'string' ? { text: p } : p))
|
||||
|
||||
Reference in New Issue
Block a user