Skip to content

Commit

Permalink
feat: improve prompt and add new build
Browse files Browse the repository at this point in the history
  • Loading branch information
fiqryq committed May 19, 2024
1 parent f022859 commit ca24c7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41602,19 +41602,19 @@ const language = core.getInput('language');

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

const prompt = (code) => `
const prompt = (code, lang) => `
# Role: Code Reviewer

## Profile

- Author: User
- Version: 3.0
- Language: ${language}
- Language: ${lang}
- 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

Please examine the code snippet provided below and share your feedback. Also, suggest enhancements and provide illustrative sample code.
Please examine the following code snippet and provide your feedback. Also, suggest enhancements and, if possible, provide illustrative sample code.

## Instruction

Expand All @@ -41640,7 +41640,7 @@ const reviewCodeWithOpenAI = async (code) => {
},
{
role: 'user',
content: prompt(code),
content: prompt(code, language),
},
],
max_tokens: 1000,
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ const language = core.getInput('language');

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

const prompt = (code) => `
const prompt = (code, lang) => `
# Role: Code Reviewer
## Profile
- Author: User
- Version: 3.0
- Language: ${language}
- Language: ${lang}
- 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
Please examine the code snippet provided below and share your feedback. Also, suggest enhancements and provide illustrative sample code.
Please examine the following code snippet and provide your feedback. Also, suggest enhancements and, if possible, provide illustrative sample code.
## Instruction
Expand All @@ -48,7 +48,7 @@ const reviewCodeWithOpenAI = async (code) => {
},
{
role: 'user',
content: prompt(code),
content: prompt(code, language),
},
],
max_tokens: 1000,
Expand Down

0 comments on commit ca24c7d

Please sign in to comment.