vercel / ai-chatbot

A full-featured, hackable Next.js AI chatbot built by Vercel
https://chat.vercel.ai
Other
5.51k stars 1.62k forks source link

server problem (500) #342

Open oneOfThePeakyBlinders opened 1 month ago

oneOfThePeakyBlinders commented 1 month ago

Whenever i make requests, server responds with the 500 error: " POST / 500 in 7716ms ⨯ ..\core\util\retry-with-exponential-backoff.ts (51:13) @ _retryWithExponentialBackoff ⨯ AI_RetryError: Failed after 3 attempts. Last error: Failed to process error response at async $$ACTION_1 (./lib/chat/actions.tsx:178:20) digest: "3825323688" 49 | 50 | if (tryNumber > maxRetries) {

51 | throw new RetryError({ | ^ 52 | message: Failed after ${tryNumber} attempts. Last error: ${errorMessage}, 53 | reason: 'maxRetriesExceeded', 54 | errors: newErrors, The streamable UI has been slow to update. This may be a bug or a performance issue or you forgot to call .done(). ⨯ ..\core\util\retry-with-exponential-backoff.ts (51:13) @ _retryWithExponentialBackoff ⨯ AI_RetryError: Failed after 3 attempts. Last error: Failed to process error response at async $$ACTION_1 (./lib/chat/actions.tsx:178:20) digest: "3825323688" 49 | 50 | if (tryNumber > maxRetries) { 51 | throw new RetryError({ | ^ 52 | message: Failed after ${tryNumber} attempts. Last error: ${errorMessage}, 53 | reason: 'maxRetriesExceeded', 54 | errors: newErrors, POST / 500 in 7495ms The streamable UI has been slow to update. This may be a bug or a performance issue or you forgot to call .done(). "

What's the problem? What might it be?

oneOfThePeakyBlinders commented 1 month ago

And also in the console it refers to promt-form.tsx:65: const responseMessage = await submitUserMessage(value) setMessages(currentMessages => [...currentMessages, responseMessage])

skath1 commented 1 month ago

were you able to solve this issue?

oneOfThePeakyBlinders commented 1 month ago

were you able to solve this iss Unfortunately no( Are you facing the same issue?

0xbohu commented 1 month ago

same issue

0xbohu commented 1 month ago

@oneOfThePeakyBlinders I have fixed it, the reason is that you need to add credits to your OpenAI for API usage. https://platform.openai.com/settings/organization/billing/overview

API credits is not included in GPT 4plus subscription. Once you add credits to your API, create a new api key and it should work.

I have also raised an issue in ai repo, it is still a bug to parse openAI error response and team is looking at it. https://github.com/vercel/ai/issues/1694#issuecomment-2132262743

lgrammel commented 1 month ago

The OpenAI SDK Provider here needs to be updated. This is not an AI SDK problem.

oneOfThePeakyBlinders commented 1 month ago

How to update it properly?

lgrammel commented 1 month ago

Update it to the latest version (@ai-sdk/openai)

LKL2017 commented 4 days ago

@oneOfThePeakyBlinders I have fixed it, the reason is that you need to add credits to your OpenAI for API usage. https://platform.openai.com/settings/organization/billing/overview

API credits is not included in GPT 4plus subscription. Once you add credits to your API, create a new api key and it should work.

agree, save my life from same issue 😄