Skip to content

Commit

Permalink
Fix timeout values
Browse files Browse the repository at this point in the history
  • Loading branch information
ouchi2501 committed Sep 29, 2023
1 parent 72f8f4d commit 20877aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export async function completionRequest(
): Promise<string> {
try {
const openai = new OpenAI({ apiKey })
const timeout = 300 * 1000 // 5 minutes
const response = await openai.chat.completions.create(
{
messages: [
Expand All @@ -16,7 +17,7 @@ export async function completionRequest(
model: 'gpt-3.5-turbo'
},
{
timeout: 60 * 1000 // 60s
timeout: timeout
}
)
if (
Expand Down

0 comments on commit 20877aa

Please sign in to comment.