mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-11-10 10:34:11 +00:00
Update logging
This commit is contained in:
parent
794702202f
commit
a45289dc2a
3 changed files with 5 additions and 3 deletions
3
dist/index.js
vendored
3
dist/index.js
vendored
|
|
@ -64,7 +64,6 @@ function getPRDetails() {
|
||||||
repo: repository.name,
|
repo: repository.name,
|
||||||
pull_number: number,
|
pull_number: number,
|
||||||
});
|
});
|
||||||
console.log("Yura test Pull Request Response:", prResponse.data);
|
|
||||||
return {
|
return {
|
||||||
owner: repository.owner.login,
|
owner: repository.owner.login,
|
||||||
repo: repository.name,
|
repo: repository.name,
|
||||||
|
|
@ -159,6 +158,7 @@ function getAIResponse(prompt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const queryConfig = getQueryConfig();
|
const queryConfig = getQueryConfig();
|
||||||
|
console.log("Query Config to openai:", queryConfig);
|
||||||
try {
|
try {
|
||||||
const response = yield openai.chat.completions.create(Object.assign(Object.assign(Object.assign({}, queryConfig), (OPENAI_API_MODEL === "o3-mini"
|
const response = yield openai.chat.completions.create(Object.assign(Object.assign(Object.assign({}, queryConfig), (OPENAI_API_MODEL === "o3-mini"
|
||||||
? { response_format: { type: "json_object" } }
|
? { response_format: { type: "json_object" } }
|
||||||
|
|
@ -169,6 +169,7 @@ function getAIResponse(prompt) {
|
||||||
},
|
},
|
||||||
] }));
|
] }));
|
||||||
const res = ((_b = (_a = response.choices[0].message) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.trim()) || "{}";
|
const res = ((_b = (_a = response.choices[0].message) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.trim()) || "{}";
|
||||||
|
console.log("AI Response:", JSON.parse(res));
|
||||||
return JSON.parse(res).reviews;
|
return JSON.parse(res).reviews;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
|
|
||||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -33,7 +33,6 @@ async function getPRDetails(): Promise<PRDetails> {
|
||||||
pull_number: number,
|
pull_number: number,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Yura test Pull Request Response:", prResponse.data);
|
|
||||||
return {
|
return {
|
||||||
owner: repository.owner.login,
|
owner: repository.owner.login,
|
||||||
repo: repository.name,
|
repo: repository.name,
|
||||||
|
|
@ -138,6 +137,7 @@ async function getAIResponse(prompt: string): Promise<Array<{
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryConfig = getQueryConfig();
|
const queryConfig = getQueryConfig();
|
||||||
|
console.log("Query Config to openai:", queryConfig);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await openai.chat.completions.create({
|
const response = await openai.chat.completions.create({
|
||||||
|
|
@ -155,6 +155,7 @@ async function getAIResponse(prompt: string): Promise<Array<{
|
||||||
});
|
});
|
||||||
|
|
||||||
const res = response.choices[0].message?.content?.trim() || "{}";
|
const res = response.choices[0].message?.content?.trim() || "{}";
|
||||||
|
console.log("AI Response:", JSON.parse(res));
|
||||||
return JSON.parse(res).reviews;
|
return JSON.parse(res).reviews;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error:", error);
|
console.error("Error:", error);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue