Skip to content

Commit

Permalink
fix: improve large diff error message (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Feb 22, 2023
1 parent bd08566 commit 5a506b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const generateCommitMessage = async (

// Accounting for GPT-3's input req of 4k tokens (approx 8k chars)
if (prompt.length > 8000) {
throw new Error('The diff is too large for the OpenAI API');
throw new Error('The diff is too large for the OpenAI API. Try reducing the number of staged changes, or write your own commit message.');
}

const openai = new OpenAIApi(new Configuration({ apiKey }));
Expand Down

0 comments on commit 5a506b7

Please sign in to comment.