-
-
Notifications
You must be signed in to change notification settings - Fork 575
feat: make it possible to abort AI requests #1806
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
if (state === "closed") { | ||
throw new Error("abort() is only valid during LLM execution"); | ||
} | ||
if (state.status !== "thinking" && state.status !== "ai-writing") { | ||
throw new Error("abort() is only valid during LLM execution"); | ||
} |
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.
I think this should be an early return, user-facing functionality should not throw errors when it is trivial to know.
This would be similar to having to check if you can abort something before you abort it. It should just no-op
} else { | ||
// we were not writing yet. Set to the previous state | ||
if (startState.status === "error") { | ||
this.setAIResponseStatus({ status: startState.status, error: e }); |
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.
We want to show the abort error again?
<Components.SuggestionMenu.Loader | ||
className={"bn-suggestion-menu-loader bn-combobox-right-section"} | ||
/> | ||
// TODO |
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.
Still todo?
closes #1751