From 20877aaa373667745d869e58ef163c5f92c48e20 Mon Sep 17 00:00:00 2001 From: uncle Date: Fri, 29 Sep 2023 15:29:46 +0900 Subject: [PATCH] Fix timeout values --- src/ai.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ai.ts b/src/ai.ts index c4692b1..f9a4538 100644 --- a/src/ai.ts +++ b/src/ai.ts @@ -7,6 +7,7 @@ export async function completionRequest( ): Promise { try { const openai = new OpenAI({ apiKey }) + const timeout = 300 * 1000 // 5 minutes const response = await openai.chat.completions.create( { messages: [ @@ -16,7 +17,7 @@ export async function completionRequest( model: 'gpt-3.5-turbo' }, { - timeout: 60 * 1000 // 60s + timeout: timeout } ) if (