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 button for streaming responses #64

Closed
wants to merge 3 commits into from

Conversation

AtlantisPleb
Copy link
Contributor

This PR addresses issue #63 by adding a stop button functionality to the InputBar component. The changes include:

  1. Added a new onStop prop to the InputBarProps interface.
  2. Modified the loading button to show a stop icon on hover.
  3. Added a click handler for the stop button to call the onStop function.

These changes allow users to stop the streaming response by clicking on the stop button that appears when hovering over the loading spinner.

To fully implement this feature, the parent component using InputBar will need to:

  1. Implement the onStop function to handle stopping the stream.
  2. Pass the onStop function as a prop to InputBar.

The stopping functionality should be implemented using the useChat hook as mentioned in the issue description. Please refer to the Vercel AI SDK documentation for more details on how to stop streams:
https://sdk.vercel.ai/docs/reference/ai-sdk-ui/use-chat
https://sdk.vercel.ai/docs/advanced/stopping-streams

Copy link

vercel bot commented Aug 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 27, 2024 10:08pm

Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

@AtlantisPleb
Copy link
Contributor Author

Clicking the stop button does nothing.

Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

1 similar comment
Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

@AtlantisPleb
Copy link
Contributor Author

Superceded by #66

@AtlantisPleb AtlantisPleb deleted the issue-63-add-stop-button branch August 28, 2024 01:24
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

Successfully merging this pull request may close these issues.

1 participant