From 000b500f2fb37afb30fa6c8161c4f3b2c272c08b Mon Sep 17 00:00:00 2001 From: uncle Date: Fri, 29 Sep 2023 15:34:09 +0900 Subject: [PATCH] fix timeout valiable name --- badges/coverage.svg | 2 +- dist/index.js | 3 ++- src/ai.ts | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/badges/coverage.svg b/badges/coverage.svg index 87a9754..3223905 100644 --- a/badges/coverage.svg +++ b/badges/coverage.svg @@ -1 +1 @@ -Coverage: 95.23%Coverage95.23% \ No newline at end of file +Coverage: 95.31%Coverage95.31% \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 90e893a..5883345 100644 --- a/dist/index.js +++ b/dist/index.js @@ -11402,6 +11402,7 @@ const openai_1 = __importDefault(__nccwpck_require__(47)); async function completionRequest(apiKey, systemPrompt, userPrompt) { try { const openai = new openai_1.default({ apiKey }); + const requestTimeout = 300 * 1000; // 5 minutes const response = await openai.chat.completions.create({ messages: [ { role: 'system', content: systemPrompt }, @@ -11409,7 +11410,7 @@ async function completionRequest(apiKey, systemPrompt, userPrompt) { ], model: 'gpt-3.5-turbo' }, { - timeout: 60 * 1000 // 60s + timeout: requestTimeout }); if (response.choices && response.choices[0] && diff --git a/src/ai.ts b/src/ai.ts index f9a4538..0afe676 100644 --- a/src/ai.ts +++ b/src/ai.ts @@ -7,7 +7,7 @@ export async function completionRequest( ): Promise { try { const openai = new OpenAI({ apiKey }) - const timeout = 300 * 1000 // 5 minutes + const requestTimeout = 300 * 1000 // 5 minutes const response = await openai.chat.completions.create( { messages: [ @@ -17,7 +17,7 @@ export async function completionRequest( model: 'gpt-3.5-turbo' }, { - timeout: timeout + timeout: requestTimeout } ) if (