Skip to content

Commit

Permalink
feat: add new build
Browse files Browse the repository at this point in the history
  • Loading branch information
fiqryq committed May 19, 2024
1 parent 9517001 commit f022859
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41597,6 +41597,8 @@ const axios = __nccwpck_require__(8757);

const githubToken = core.getInput('gh-token');
const openaiApiKey = core.getInput('openai-api-key');
const model = core.getInput('model');
const language = core.getInput('language');

const octokit = new Octokit({ auth: githubToken });

Expand All @@ -41607,7 +41609,7 @@ const prompt = (code) => `

- Author: User
- Version: 3.0
- Language: English
- Language: ${language}
- Description: A code reviewer is an individual who critically evaluates a piece of code and provides constructive feedback. They also offer recommendations for code optimization and better practices. If feasible, they provide sample code to illustrate their suggestions.

## Prompt
Expand All @@ -41630,7 +41632,7 @@ const reviewCodeWithOpenAI = async (code) => {
const response = await axios.post(
'https://api.openai.com/v1/chat/completions',
{
model: 'gpt-3.5-turbo',
model: model,
messages: [
{
role: 'system',
Expand All @@ -41641,7 +41643,7 @@ const reviewCodeWithOpenAI = async (code) => {
content: prompt(code),
},
],
max_tokens: 150,
max_tokens: 1000,
n: 1,
stop: null,
temperature: 0.7,
Expand Down
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const axios = require('axios');

const githubToken = core.getInput('gh-token');
const openaiApiKey = core.getInput('openai-api-key');
const model = core.getInput('model');
const language = core.getInput('language');

const octokit = new Octokit({ auth: githubToken });

Expand All @@ -15,7 +17,7 @@ const prompt = (code) => `
- Author: User
- Version: 3.0
- Language: English
- Language: ${language}
- Description: A code reviewer is an individual who critically evaluates a piece of code and provides constructive feedback. They also offer recommendations for code optimization and better practices. If feasible, they provide sample code to illustrate their suggestions.
## Prompt
Expand All @@ -38,7 +40,7 @@ const reviewCodeWithOpenAI = async (code) => {
const response = await axios.post(
'https://api.openai.com/v1/chat/completions',
{
model: 'gpt-3.5-turbo',
model: model,
messages: [
{
role: 'system',
Expand All @@ -49,7 +51,7 @@ const reviewCodeWithOpenAI = async (code) => {
content: prompt(code),
},
],
max_tokens: 150,
max_tokens: 1000,
n: 1,
stop: null,
temperature: 0.7,
Expand Down

0 comments on commit f022859

Please sign in to comment.