eneax / x-writer

📝 AI writing assistant built with GPT-3 and OpenAI.
19 stars 4 forks source link

Great script! #8

Closed vnunez85 closed 1 year ago

vnunez85 commented 1 year ago

Hello, trying your app, and was able to launch it on Vercel and looks like it needs to. Im having an issue when I click the button to generate, if just spins. It was working correctly on my localhost, and it did generate, but not on Vercel. Am I missing something?

Thanks for the help!

eneax commented 1 year ago

Thank you for trying the app!

The problem is that OpenAI API request take up to 30 or 40 seconds to process if you use a very long prompt, but if you have a free Vercel plan, Serverless Functions timeout after 10 seconds.

From the Vercel docs:

The amount of time (in seconds) that a Serverless Function is allowed to process an HTTP request before it must respond. The maximum execution timeout is 10 seconds when deployed on a Personal Account (Hobby plan). For Teams, the execution timeout is 60 seconds (Pro plan) or 900 seconds (Enterprise plan).

To solve the timeout problem, you would have to get a paid Vercel plan or perhaps try another deployment service with a more generous free plan.