Skip to content

Commit

Permalink
Improved OpenAI query.
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dunc committed Dec 14, 2024
1 parent 604def8 commit 6d76412
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/utils/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ export const generatePrompt = (
type: CommitType
) =>
[
'Generate a concise git commit message written in present tense for the following code diff with the given specifications below:',
`Message language: ${locale}`,
`Commit message must be a maximum of ${maxLength} characters.`,
'Exclude anything unnecessary such as translation. Your entire response will be passed directly into git commit.',
commitTypes[type],
specifyCommitFormat(type),
]
.filter(Boolean)
.join('\n');
'Write a concise, present-tense git commit message summarizing the following code diff. Adhere to these guidelines:',
`- Language: ${locale}`,
`- Maximum length: ${maxLength} characters.`,
'- Focus on meaningful changes only; exclude unnecessary details like translations or unrelated commentary.',
`- Use the commit type: ${commitTypes[type]}`,
`- Follow this format: ${specifyCommitFormat(type)}`,
'Ensure your response is directly usable as a git commit message.'
].filter(Boolean).join('\n');

0 comments on commit 6d76412

Please sign in to comment.