mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-30 06:54:15 -07:00
Co-authored-by: Yuna Seol <yunaseol@google.com>
This commit is contained in:
@@ -31,6 +31,7 @@ import {
|
||||
PREVIEW_GEMINI_FLASH_MODEL,
|
||||
} from '../config/models.js';
|
||||
import { PreCompressTrigger } from '../hooks/types.js';
|
||||
import { LlmRole } from '../telemetry/types.js';
|
||||
|
||||
/**
|
||||
* Default threshold for compression token count as a fraction of the model's
|
||||
@@ -339,6 +340,7 @@ export class ChatCompressionService {
|
||||
promptId,
|
||||
// TODO(joshualitt): wire up a sensible abort signal,
|
||||
abortSignal: abortSignal ?? new AbortController().signal,
|
||||
role: LlmRole.UTILITY_COMPRESSOR,
|
||||
});
|
||||
const summary = getResponseText(summaryResponse) ?? '';
|
||||
|
||||
@@ -365,6 +367,7 @@ export class ChatCompressionService {
|
||||
],
|
||||
systemInstruction: { text: getCompressionPrompt(config) },
|
||||
promptId: `${promptId}-verify`,
|
||||
role: LlmRole.UTILITY_COMPRESSOR,
|
||||
abortSignal: abortSignal ?? new AbortController().signal,
|
||||
});
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
isFunctionResponse,
|
||||
} from '../utils/messageInspectors.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
import { LlmRole } from '../telemetry/types.js';
|
||||
|
||||
const TOOL_CALL_LOOP_THRESHOLD = 5;
|
||||
const CONTENT_LOOP_THRESHOLD = 10;
|
||||
@@ -554,6 +555,7 @@ export class LoopDetectionService {
|
||||
abortSignal: signal,
|
||||
promptId: this.promptId,
|
||||
maxAttempts: 2,
|
||||
role: LlmRole.UTILITY_LOOP_DETECTOR,
|
||||
});
|
||||
|
||||
if (
|
||||
|
||||
@@ -10,6 +10,7 @@ import { partListUnionToString } from '../core/geminiRequest.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
import type { Content } from '@google/genai';
|
||||
import { getResponseText } from '../utils/partUtils.js';
|
||||
import { LlmRole } from '../telemetry/types.js';
|
||||
|
||||
const DEFAULT_MAX_MESSAGES = 20;
|
||||
const DEFAULT_TIMEOUT_MS = 5000;
|
||||
@@ -124,6 +125,7 @@ export class SessionSummaryService {
|
||||
contents,
|
||||
abortSignal: abortController.signal,
|
||||
promptId: 'session-summary-generation',
|
||||
role: LlmRole.UTILITY_SUMMARIZER,
|
||||
});
|
||||
|
||||
const summary = getResponseText(response);
|
||||
|
||||
Reference in New Issue
Block a user