-
Notifications
You must be signed in to change notification settings - Fork 112
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: better assistant response error handling #3793
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Run & review this pull request in StackBlitz Codeflow. |
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 7ba1602. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 3 targetsSent with 💌 from NxCloud. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 7ba1602:
|
Size Change: 0 B Total Size: 1.02 MB ℹ️ View Unchanged
|
Passing run #7895 ↗︎
Details:
Review all test suite changes for PR #3793 ↗︎ |
This pull request introduces significant improvements to the error handling and response processing in the
paste-website
package. The changes mainly focus on two areas: refining the fetch API calls inassistantAPIs.ts
and enhancing error handling in various components.The most important changes are:
Refactoring fetch API calls in
assistantAPIs.ts
to handle responses and errors more effectively. The changes include awaiting the fetch response, converting it to JSON, and throwing an error if the response is not ok. This is applied to all the mutation functions:useCreateThreadMutation
,useDeleteThreadMutation
,useUpdateThreadMutation
,useCreateAssistantRunMutation
, anduseSimpleCompletionMutation
. [1] [2] [3] [4] [5]Introducing the
AssistantToaster
component and context to handle and display errors in a user-friendly way. TheAssistantToaster
is used across multiple components likeAssistant.tsx
,AssistantCanvas.tsx
,AssistantMessagePoller.ts
,AssistantThreads.tsx
,AsststantHeader.tsx
to handle errors during various operations like creating a thread, deleting a thread, fetching messages, etc. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]Improvements in the
AssistantComposer
component inAssistantComposer.tsx
to handle the case when theselectedThread
isnull
. TheSendButtonPlugin
is also updated to handle thedisabled
prop as optional. [1] [2]Adding content moderation to the message handler in
paste-assistant-message.ts
. The moderation is done using OpenAI's moderation API, and an error is thrown if the message content is flagged.Minor changes include updating the
SendButtonPlugin
inSendButtonPlugin.tsx
to handle thedisabled
prop as optional.