mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-21 10:06:47 +00:00
Finetuning logging msg [review]
This commit is contained in:
parent
bbd546b889
commit
7f6dd34aa7
3 changed files with 6 additions and 3 deletions
5
dist/index.js
vendored
5
dist/index.js
vendored
|
@ -28,6 +28,9 @@ require("./sourcemap-register.js");
|
||||||
* - OPENAI_BASE_URL: Base URL for the OpenAI API (optional)
|
* - OPENAI_BASE_URL: Base URL for the OpenAI API (optional)
|
||||||
* - DEBUG_HTTP: Enable HTTP request debugging (optional)
|
* - DEBUG_HTTP: Enable HTTP request debugging (optional)
|
||||||
*
|
*
|
||||||
|
* Example Usage:
|
||||||
|
* npx ts-node main.ts
|
||||||
|
*
|
||||||
* Note: It is recommended to set the GITHUB_TOKEN and OPENAI_API_KEY environment variables to avoid exposing sensitive information.
|
* Note: It is recommended to set the GITHUB_TOKEN and OPENAI_API_KEY environment variables to avoid exposing sensitive information.
|
||||||
*/
|
*/
|
||||||
var __createBinding =
|
var __createBinding =
|
||||||
|
@ -424,7 +427,7 @@ ${chunk.changes
|
||||||
: _b.trim()) || "{}";
|
: _b.trim()) || "{}";
|
||||||
return JSON.parse(res).reviews;
|
return JSON.parse(res).reviews;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error:", error);
|
console.error("Could not fetch 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
|
@ -325,7 +325,7 @@ async function getAIResponse(prompt: string): Promise<Array<{
|
||||||
const res = response.choices[0].message?.content?.trim() || "{}";
|
const res = response.choices[0].message?.content?.trim() || "{}";
|
||||||
return JSON.parse(res).reviews;
|
return JSON.parse(res).reviews;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error:", error);
|
console.error("Could not fetch AI response:", error);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue