Skip to content

Can this library notify me once chatgpt has finished writing a code block while it's still generating the rest of the response? #272

Answered by adamlui
grayfallstown asked this question in Q&A
Discussion options

You must be logged in to vote

Ok I added it check it out:

chatgpt.send('type me a short code block');
chatgpt.code.isIdle().then(() => alert('code stopped generating')); // non-code may still be generating

...or using await in an async block

(async () => {
    chatgpt.send('type me a short code block');
    await chatgpt.code.isIdle();
    alert('code stopped generating'); // non-code may still be generating
})();

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@adamlui
Comment options

@grayfallstown
Comment options

@adamlui
Comment options

Answer selected by grayfallstown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
2 participants