Built new version.

This commit is contained in:
Luke Hollenback 2024-04-02 15:40:47 -06:00
commit c3d3226a52
2 changed files with 4 additions and 4 deletions

6
dist/index.js vendored
View file

@ -51,6 +51,7 @@ const minimatch_1 = __importDefault(__nccwpck_require__(2002));
const GITHUB_TOKEN = core.getInput("GITHUB_TOKEN"); const GITHUB_TOKEN = core.getInput("GITHUB_TOKEN");
const OPENAI_API_KEY = core.getInput("OPENAI_API_KEY"); const OPENAI_API_KEY = core.getInput("OPENAI_API_KEY");
const OPENAI_API_MODEL = core.getInput("OPENAI_API_MODEL"); 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 octokit = new rest_1.Octokit({ auth: GITHUB_TOKEN });
const openai = new openai_1.default({ const openai = new openai_1.default({
apiKey: OPENAI_API_KEY, apiKey: OPENAI_API_KEY,
@ -141,7 +142,7 @@ function getAIResponse(prompt) {
const queryConfig = { const queryConfig = {
model: OPENAI_API_MODEL, model: OPENAI_API_MODEL,
temperature: 0.2, temperature: 0.2,
max_tokens: 700, max_tokens: MAX_TOKENS,
top_p: 1, top_p: 1,
frequency_penalty: 0, frequency_penalty: 0,
presence_penalty: 0, presence_penalty: 0,
@ -155,9 +156,8 @@ function getAIResponse(prompt) {
content: 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()) || "{}"; 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; return JSON.parse(res).reviews;
} }
catch (error) { catch (error) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long