mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-02 09:20:42 -07:00
extract console error to util func (#11675)
This commit is contained in:
@@ -107,10 +107,6 @@ describe('summarizers', () => {
|
||||
|
||||
expect(mockGeminiClient.generateContent).toHaveBeenCalledTimes(1);
|
||||
expect(result).toBe(longText);
|
||||
expect(console.error).toHaveBeenCalledWith(
|
||||
'Failed to summarize tool output.',
|
||||
error,
|
||||
);
|
||||
});
|
||||
|
||||
it('should construct the correct prompt for summarization', async () => {
|
||||
|
||||
@@ -13,6 +13,7 @@ import type {
|
||||
import type { GeminiClient } from '../core/client.js';
|
||||
import { DEFAULT_GEMINI_FLASH_LITE_MODEL } from '../config/models.js';
|
||||
import { getResponseText, partToString } from './partUtils.js';
|
||||
import { debugLogger } from './debugLogger.js';
|
||||
|
||||
/**
|
||||
* A function that summarizes the result of a tool execution.
|
||||
@@ -90,7 +91,7 @@ export async function summarizeToolOutput(
|
||||
)) as unknown as GenerateContentResponse;
|
||||
return getResponseText(parsedResponse) || textToSummarize;
|
||||
} catch (error) {
|
||||
console.error('Failed to summarize tool output.', error);
|
||||
debugLogger.warn('Failed to summarize tool output.', error);
|
||||
return textToSummarize;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user