Skip to content

Commit

Permalink
feat: improve prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
fiqryq committed May 19, 2024
1 parent 1046af1 commit 1423fb6
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,12 @@ const reviewCodeWithOpenAI = async (code) => {
},
{
role: 'user',
content: `Please review the following code and provide feedback. Additionally, kindly offer your best suggestions for improvement and provide sample code if possible.
Example response with code suggestion:
Feedback:
// Feedback
Suggestions for improvement:
// Suggestions
Code suggestion:
\`\`\`ts
// code
\`\`\`
${code}`,
content: `
Please examine the code snippet provided below and share your feedback. Also, suggest enhancements and provide illustrative sample code in the following format:
\```ts
Suggested code goes here...
\```
\n\n${code}`,
},
],
max_tokens: 150,
Expand All @@ -49,7 +42,6 @@ const reviewCodeWithOpenAI = async (code) => {
);
return response.data.choices[0].message.content.trim();
};

const run = async () => {
try {
const context = github.context;
Expand Down

0 comments on commit 1423fb6

Please sign in to comment.