mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-09-09 11:17:08 +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,
|
||||
pull_number: number,
|
||||
});
|
||||
console.log("Yura test Pull Request Response:", prResponse.data);
|
||||
return {
|
||||
owner: repository.owner.login,
|
||||
repo: repository.name,
|
||||
|
@ -159,6 +158,7 @@ function getAIResponse(prompt) {
|
|||
}
|
||||
}
|
||||
const queryConfig = getQueryConfig();
|
||||
console.log("Query Config to openai:", queryConfig);
|
||||
try {
|
||||
const response = yield openai.chat.completions.create(Object.assign(Object.assign(Object.assign({}, queryConfig), (OPENAI_API_MODEL === "o3-mini"
|
||||
? { 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()) || "{}";
|
||||
console.log("AI Response:", JSON.parse(res));
|
||||
return JSON.parse(res).reviews;
|
||||
}
|
||||
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,
|
||||
});
|
||||
|
||||
console.log("Yura test Pull Request Response:", prResponse.data);
|
||||
return {
|
||||
owner: repository.owner.login,
|
||||
repo: repository.name,
|
||||
|
@ -138,6 +137,7 @@ async function getAIResponse(prompt: string): Promise<Array<{
|
|||
}
|
||||
|
||||
const queryConfig = getQueryConfig();
|
||||
console.log("Query Config to openai:", queryConfig);
|
||||
|
||||
try {
|
||||
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() || "{}";
|
||||
console.log("AI Response:", JSON.parse(res));
|
||||
return JSON.parse(res).reviews;
|
||||
} catch (error) {
|
||||
console.error("Error:", error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue