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

Add stop helper to useAssistant #1503

Closed
jferrettiboke opened this issue May 6, 2024 · 4 comments
Closed

Add stop helper to useAssistant #1503

jferrettiboke opened this issue May 6, 2024 · 4 comments
Assignees

Comments

@jferrettiboke
Copy link

Feature Description

Could we add support for canceling a call that is in progress in the AI SDK UI? I know this feature is available in the AI SDK Core and AI SDK RSC, but can we incorporate it into the AI SDK UI as well?

Use Case

Many users see no value in waiting for the full response from the server if they notice that the response does not align with their desires or if they realize the response is incorrect. It would be beneficial to have the ability to cancel a call that is in progress while using the AI SDK UI.

Additional context

No response

@lgrammel
Copy link
Collaborator

lgrammel commented May 6, 2024

The AI SDK UI functions ( useChat, useCompletion ) return a stop helper (see https://sdk.vercel.ai/docs/reference/ai-sdk-ui/use-chat#stop ). Would this work for your use case?

@jferrettiboke
Copy link
Author

@lgrammel But this doesn't exist in useAssistant. Right? I need it there.

@lgrammel lgrammel changed the title [Feature request] Add ability to cancel in-progress calls in AI SDK UI Add stop helper to useAssistant May 7, 2024
@lgrammel lgrammel self-assigned this May 7, 2024
@lgrammel
Copy link
Collaborator

lgrammel commented May 8, 2024

PR: #1524

Unfortunately it seems that OpenAI does not correctly abort the assistant from running when an abort signal is sent, and prevents further chat responses until it has finished completely.

@jferrettiboke
Copy link
Author

@lgrammel Thanks!

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

2 participants