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 support for passing AbortSignal to fetch #6

Merged
merged 1 commit into from
Apr 8, 2023

Conversation

debanjandhar12
Copy link
Contributor

This will allow to abort a ChatGPT call.

https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal

NB: I may have made mistakes in the JSDoc part, as this is my first time working with it. If there are any issues, please let me know and I'll be happy to fix them.

@TABmk TABmk merged commit 050d603 into TABmk:master Apr 8, 2023
@TABmk
Copy link
Owner

TABmk commented Apr 8, 2023

Merged, I’ll check it and push new release if everything is ok

@TABmk
Copy link
Owner

TABmk commented Apr 8, 2023

@debanjandhar12 I removed FetchOptions since we can just use RequestInit from node-fetch. We willl avoid errors with this and types handling will be better.

Also added an example of using AbortController in ReadMe — https://github.com/TABmk/chatgpt-wrapper#how-to-implement-stop-command

v1.1.4 is already on npm, thank you for contributing 🎉

@debanjandhar12
Copy link
Contributor Author

Thanks for merging the pull request. Also, thanks for the heads up about FetchOptions, that makes sense.

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.

None yet

2 participants