Fix/connection (#1)

* stuff

* stuff
This commit is contained in:
Felix Anhalt 2023-11-27 14:15:48 +01:00 committed by GitHub
parent c4290da204
commit d158a6fdbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

12
dist/index.js vendored

@ -50,6 +50,7 @@ const parse_diff_1 = __importDefault(__nccwpck_require__(4833));
const minimatch_1 = __importDefault(__nccwpck_require__(2002)); 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 octokit = new rest_1.Octokit({ auth: GITHUB_TOKEN }); const octokit = new rest_1.Octokit({ auth: GITHUB_TOKEN });
const configuration = new openai_1.Configuration({ const configuration = new openai_1.Configuration({
apiKey: OPENAI_API_KEY, apiKey: OPENAI_API_KEY,
@ -151,7 +152,7 @@ function getAIResponse(prompt) {
var _a, _b; var _a, _b;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const queryConfig = { const queryConfig = {
model: "gpt-4", model: OPENAI_API_MODEL,
temperature: 0.2, temperature: 0.2,
max_tokens: 700, max_tokens: 700,
top_p: 1, top_p: 1,
@ -210,16 +211,15 @@ function main() {
const newBaseSha = eventData.before; const newBaseSha = eventData.before;
const newHeadSha = eventData.after; const newHeadSha = eventData.after;
const response = yield octokit.repos.compareCommits({ const response = yield octokit.repos.compareCommits({
headers: {
accept: "application/vnd.github.v3.diff",
},
owner: prDetails.owner, owner: prDetails.owner,
repo: prDetails.repo, repo: prDetails.repo,
base: newBaseSha, base: newBaseSha,
head: newHeadSha, head: newHeadSha,
}); });
diff = response.data.diff_url diff = String(response.data);
? yield octokit
.request({ url: response.data.diff_url })
.then((res) => res.data)
: null;
} }
else { else {
console.log("Unsupported event:", process.env.GITHUB_EVENT_NAME); console.log("Unsupported event:", process.env.GITHUB_EVENT_NAME);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long