mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Logs the auth type in the user prompts, api responses and errors (#3795)
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user