Logs the auth type in the user prompts, api responses and errors (#3795)

This commit is contained in:
uttamkanodia14
2025-07-11 22:17:46 +05:30
committed by GitHub
parent ed00612cf7
commit 93284281de
9 changed files with 65 additions and 4 deletions

View File

@@ -127,7 +127,12 @@ describe('loggers', () => {
} as unknown as Config;
it('should log a user prompt', () => {
const event = new UserPromptEvent(11, 'prompt-id-8', 'test-prompt');
const event = new UserPromptEvent(
11,
'prompt-id-8',
AuthType.USE_VERTEX_AI,
'test-prompt',
);
logUserPrompt(mockConfig, event);
@@ -151,7 +156,11 @@ describe('loggers', () => {
getTargetDir: () => 'target-dir',
getUsageStatisticsEnabled: () => true,
} as unknown as Config;
const event = new UserPromptEvent(11, 'test-prompt');
const event = new UserPromptEvent(
11,
'test-prompt',
AuthType.CLOUD_SHELL,
);
logUserPrompt(mockConfig, event);
@@ -202,6 +211,7 @@ describe('loggers', () => {
'test-model',
100,
'prompt-id-1',
AuthType.LOGIN_WITH_GOOGLE,
usageData,
'test-response',
);
@@ -226,6 +236,7 @@ describe('loggers', () => {
total_token_count: 0,
response_text: 'test-response',
prompt_id: 'prompt-id-1',
auth_type: 'oauth-personal',
},
});
@@ -263,6 +274,7 @@ describe('loggers', () => {
'test-model',
100,
'prompt-id-1',
AuthType.USE_GEMINI,
usageData,
'test-response',
'test-error',