Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught (in promise) Error: Final run has not been received #19

Closed
mshepard opened this issue May 17, 2024 · 6 comments
Closed

Uncaught (in promise) Error: Final run has not been received #19

mshepard opened this issue May 17, 2024 · 6 comments

Comments

@mshepard
Copy link

Getting this error when assistant returns longer responses (~250 tokens): "Uncaught (in promise) Error: Final run has not been received"

The response is truncated at this point.

I deployed the app to Vercel. I do not encounter this when running the code in my local dev environment.

Thinking that a possible workaround would be to set max_tokens, but it seems that is not available (yet?) with the Assistants API?

@mshepard
Copy link
Author

Instructing the Assistant to limit responses to ~200 tokens fixes the problem, but that’s a weak workaround.

Seems to be a timeout issue on the Run when executed through the production environment (Vercel). Still investigating.

@Unlok-Simon
Copy link

I am also getting this when using Vercel. Also no issue when running locally. Very annoying..... Use case we are playing with won't work with limiting responses to 200 tokens.

@ameer-clara
Copy link

Pro account timeout configurable upto 5 mins
https://vercel.com/guides/what-can-i-do-about-vercel-serverless-functions-timing-out

@Unlok-Simon
Copy link

Pro account timeout configurable upto 5 mins https://vercel.com/guides/what-can-i-do-about-vercel-serverless-functions-timing-out

This is it! I am currently only on Free plan while we play with ideas so I added:

export const maxDuration = 60; // 60 seconds maximum duration on free plan

to app/api/assistants/threads/[threadId]/messages/route.ts

Can't imagine a reponse needing more than 60 secs (esp. with the assistant using the 4o model!)

Thanks @ameer-clara for the direction. Appreciate it.

@mshepard
Copy link
Author

Ah ok. Thanks @ameer-clara ! Very much appreciated!

@ibigio
Copy link
Collaborator

ibigio commented May 27, 2024

Thanks all for pitching in the advice!

@ibigio ibigio closed this as completed May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants