mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-20 17:46:47 +00:00
CICO-113127: Test2
This commit is contained in:
parent
9afc21f502
commit
987649d2b4
3 changed files with 7 additions and 1 deletions
3
dist/index.js
vendored
3
dist/index.js
vendored
|
@ -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
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue