CICO-113127: Test2

This commit is contained in:
Arun Murugan 2024-09-24 22:23:09 +05:30
parent 9afc21f502
commit 987649d2b4
3 changed files with 7 additions and 1 deletions

3
dist/index.js vendored
View file

@ -97,6 +97,8 @@ function analyzeCode(parsedDiff, prDetails) {
continue; continue;
const prompt = createPrompt(file, chunk, prDetails); const prompt = createPrompt(file, chunk, prDetails);
const aiResponse = yield getAIResponse(prompt); const aiResponse = yield getAIResponse(prompt);
console.log('AI Prompt:', prompt);
console.log('AI Response:', aiResponse);
if (aiResponse) { if (aiResponse) {
const newComments = createComment(file, chunk, aiResponse, existingComments); const newComments = createComment(file, chunk, aiResponse, existingComments);
if (newComments) { if (newComments) {
@ -168,6 +170,7 @@ function getAIResponse(prompt) {
return JSON.parse(jsonContent).reviews; return JSON.parse(jsonContent).reviews;
} }
catch (error) { catch (error) {
console.error("Error in AI Response:", error);
return null; return null;
} }
}); });

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -71,6 +71,8 @@ async function analyzeCode(
const prompt = createPrompt(file, chunk, prDetails); const prompt = createPrompt(file, chunk, prDetails);
const aiResponse = await getAIResponse(prompt); const aiResponse = await getAIResponse(prompt);
console.log('AI Prompt:', prompt);
console.log('AI Response:', aiResponse);
if (aiResponse) { if (aiResponse) {
const newComments = createComment(file, chunk, aiResponse, existingComments); const newComments = createComment(file, chunk, aiResponse, existingComments);
@ -156,6 +158,7 @@ async function getAIResponse(prompt: string): Promise<Array<{
return JSON.parse(jsonContent).reviews; return JSON.parse(jsonContent).reviews;
} catch (error) { } catch (error) {
console.error("Error in AI Response:", error);
return null; return null;
} }
} }