-
Notifications
You must be signed in to change notification settings - Fork 237
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
feat: add error handling and use EventSource for AI assistant #1265
Conversation
jczhong84
commented
Jun 10, 2023
- send errors through the event stream and show it on frontend with toast
- adopted the SSE stream format
- using EventSource on frontend to better handling the stream, instead of fetch
return func(self, *args, **kwargs) | ||
except Exception as e: | ||
LOG.error(e, exc_info=True) | ||
callback_handler = kwargs.get("callback_handler") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
callback_handler is required, can you make it more explicit (not just in except)
it would be useful to note that callback_handler must be passed as kwargs not args
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually callback_handler is not always required, only when it's a streaming function. and catch_error will also handle non streaming functions as well. will update
…est#1265) * feat: add error handling and use EventSource * fix linter * address comments * raise from