Skip to content

Commit

Permalink
Improved chatgpt.isIdle() description/example
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Jun 23, 2024
1 parent 9138fd0 commit 37a6076
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/USERGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -950,15 +950,14 @@ console.log(fifthResp); // Example output: 'Hello from ChatGPT!'

### isIdle `async`

Returns a boolean value. `true` if ChatGPT has finished generating a response, `false` otherwise.
Resolves a promise when ChatGPT has finished generating a response.

Example code:

```js
(async () => {
if (await chatgpt.isIdle()) {
// Do something
}
await chatgpt.code.isIdle();
console.log('ChatGPT is idle');
})();
```

Expand Down

0 comments on commit 37a6076

Please sign in to comment.