Skip to content

Commit

Permalink
fix: not use default value when TIMEOUT is unset
Browse files Browse the repository at this point in the history
  • Loading branch information
ourongxing committed Apr 7, 2023
1 parent 32dfc66 commit d2312a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const post: APIRoute = async context => {
"Content-Type": "application/json",
Authorization: `Bearer ${apiKey}`
},
timeout: Number.isNaN(timeout) ? 30000 : timeout,
timeout: !timeout || Number.isNaN(timeout) ? 30000 : timeout,
method: "POST",
body: JSON.stringify({
model: model || "gpt-3.5-turbo",
Expand Down

1 comment on commit d2312a3

@vercel
Copy link

@vercel vercel bot commented on d2312a3 Apr 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.