gitlab-ai-review 3.2.5 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +38 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -275,9 +275,28 @@ export class GitLabAIReview {
|
|
|
275
275
|
// 构建整个文件的批量审查消息
|
|
276
276
|
const messages = PromptTools.buildFileReviewMessages(fileName, meaningfulChanges, projectPrompt);
|
|
277
277
|
|
|
278
|
+
// 🔍 输出完整的 Prompt(用于调试)
|
|
279
|
+
console.log('\n' + '='.repeat(80));
|
|
280
|
+
console.log('🔍 发送给 AI 的完整 Prompt:');
|
|
281
|
+
console.log('='.repeat(80));
|
|
282
|
+
messages.forEach((msg, index) => {
|
|
283
|
+
console.log(`\n📝 消息 ${index + 1} [${msg.role}]:`);
|
|
284
|
+
console.log('-'.repeat(80));
|
|
285
|
+
console.log(msg.content);
|
|
286
|
+
});
|
|
287
|
+
console.log('\n' + '='.repeat(80));
|
|
288
|
+
console.log('⏳ 等待 AI 响应...\n');
|
|
289
|
+
|
|
278
290
|
// 调用 AI(一次调用审查整个文件)
|
|
279
291
|
const response = await aiClient.sendMessage(messages);
|
|
280
292
|
|
|
293
|
+
// 🔍 输出 AI 的原始返回(用于调试)
|
|
294
|
+
console.log('\n' + '='.repeat(80));
|
|
295
|
+
console.log('📥 AI 原始返回:');
|
|
296
|
+
console.log('='.repeat(80));
|
|
297
|
+
console.log(response.content);
|
|
298
|
+
console.log('='.repeat(80) + '\n');
|
|
299
|
+
|
|
281
300
|
// 解析 AI 返回的 JSON
|
|
282
301
|
try {
|
|
283
302
|
// 提取 JSON(可能被包裹在 ```json ``` 中)
|
|
@@ -451,9 +470,28 @@ export class GitLabAIReview {
|
|
|
451
470
|
? PromptTools.buildFileReviewWithImpactMessages(fileName, meaningfulChanges, impactAnalysis, projectPrompt)
|
|
452
471
|
: PromptTools.buildFileReviewMessages(fileName, meaningfulChanges, projectPrompt);
|
|
453
472
|
|
|
473
|
+
// 🔍 输出完整的 Prompt(用于调试)
|
|
474
|
+
console.log('\n' + '='.repeat(80));
|
|
475
|
+
console.log('🔍 发送给 AI 的完整 Prompt (包含影响分析):');
|
|
476
|
+
console.log('='.repeat(80));
|
|
477
|
+
messages.forEach((msg, index) => {
|
|
478
|
+
console.log(`\n📝 消息 ${index + 1} [${msg.role}]:`);
|
|
479
|
+
console.log('-'.repeat(80));
|
|
480
|
+
console.log(msg.content);
|
|
481
|
+
});
|
|
482
|
+
console.log('\n' + '='.repeat(80));
|
|
483
|
+
console.log('⏳ 等待 AI 响应...\n');
|
|
484
|
+
|
|
454
485
|
// 调用 AI(一次调用审查整个文件)
|
|
455
486
|
const response = await aiClient.sendMessage(messages);
|
|
456
487
|
|
|
488
|
+
// 🔍 输出 AI 的原始返回(用于调试)
|
|
489
|
+
console.log('\n' + '='.repeat(80));
|
|
490
|
+
console.log('📥 AI 原始返回 (包含影响分析):');
|
|
491
|
+
console.log('='.repeat(80));
|
|
492
|
+
console.log(response.content);
|
|
493
|
+
console.log('='.repeat(80) + '\n');
|
|
494
|
+
|
|
457
495
|
// 解析 AI 返回的 JSON
|
|
458
496
|
try {
|
|
459
497
|
// 提取 JSON(可能被包裹在 ```json ``` 中)
|