From 5a506b750e7b70c090e1cf192f62662f51363067 Mon Sep 17 00:00:00 2001 From: hiroki osame Date: Wed, 22 Feb 2023 04:19:05 -0500 Subject: [PATCH] fix: improve large diff error message (#101) --- src/utils/openai.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/openai.ts b/src/utils/openai.ts index 918d9951..cf31c1ec 100644 --- a/src/utils/openai.ts +++ b/src/utils/openai.ts @@ -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 }));