mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-06-28 12:04:14 +00:00
Built new version.
This commit is contained in:
parent
e31563c690
commit
c3d3226a52
2 changed files with 4 additions and 4 deletions
6
dist/index.js
vendored
6
dist/index.js
vendored
|
@ -51,6 +51,7 @@ const minimatch_1 = __importDefault(__nccwpck_require__(2002));
|
|||
const GITHUB_TOKEN = core.getInput("GITHUB_TOKEN");
|
||||
const OPENAI_API_KEY = core.getInput("OPENAI_API_KEY");
|
||||
const OPENAI_API_MODEL = core.getInput("OPENAI_API_MODEL");
|
||||
const MAX_TOKENS = Number(core.getInput("max_tokens"));
|
||||
const octokit = new rest_1.Octokit({ auth: GITHUB_TOKEN });
|
||||
const openai = new openai_1.default({
|
||||
apiKey: OPENAI_API_KEY,
|
||||
|
@ -141,7 +142,7 @@ function getAIResponse(prompt) {
|
|||
const queryConfig = {
|
||||
model: OPENAI_API_MODEL,
|
||||
temperature: 0.2,
|
||||
max_tokens: 700,
|
||||
max_tokens: MAX_TOKENS,
|
||||
top_p: 1,
|
||||
frequency_penalty: 0,
|
||||
presence_penalty: 0,
|
||||
|
@ -155,9 +156,8 @@ function getAIResponse(prompt) {
|
|||
content: prompt,
|
||||
},
|
||||
] }));
|
||||
console.log(`Completions Response Object: ${response}`);
|
||||
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(`Trimmed Response Message: ${res}`);
|
||||
console.log(`Trimmed Response: ${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
Loading…
Add table
Add a link
Reference in a new issue