Commit abd6dd1c authored by Travis Fischer's avatar Travis Fischer

chore: update auto-generated docs

parent d27238c4
...@@ -53,7 +53,7 @@ to obtain your `clearanceToken`. ...@@ -53,7 +53,7 @@ to obtain your `clearanceToken`.
#### Defined in #### Defined in
[src/chatgpt-api.ts:45](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api.ts#L45) [src/chatgpt-api.ts:45](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api.ts#L45)
## Accessors ## Accessors
...@@ -69,7 +69,7 @@ Gets the current Cloudflare clearance token (`cf_clearance` cookie value). ...@@ -69,7 +69,7 @@ Gets the current Cloudflare clearance token (`cf_clearance` cookie value).
#### Defined in #### Defined in
[src/chatgpt-api.ts:137](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api.ts#L137) [src/chatgpt-api.ts:137](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api.ts#L137)
___ ___
...@@ -85,7 +85,7 @@ Gets the current session token. ...@@ -85,7 +85,7 @@ Gets the current session token.
#### Defined in #### Defined in
[src/chatgpt-api.ts:132](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api.ts#L132) [src/chatgpt-api.ts:132](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api.ts#L132)
___ ___
...@@ -101,7 +101,7 @@ Gets the currently signed-in user, if authenticated, `null` otherwise. ...@@ -101,7 +101,7 @@ Gets the currently signed-in user, if authenticated, `null` otherwise.
#### Defined in #### Defined in
[src/chatgpt-api.ts:127](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api.ts#L127) [src/chatgpt-api.ts:127](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api.ts#L127)
___ ___
...@@ -117,7 +117,7 @@ Gets the current user agent. ...@@ -117,7 +117,7 @@ Gets the current user agent.
#### Defined in #### Defined in
[src/chatgpt-api.ts:142](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api.ts#L142) [src/chatgpt-api.ts:142](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api.ts#L142)
## Methods ## Methods
...@@ -134,7 +134,7 @@ is still valid. ...@@ -134,7 +134,7 @@ is still valid.
#### Defined in #### Defined in
[src/chatgpt-api.ts:359](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api.ts#L359) [src/chatgpt-api.ts:359](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api.ts#L359)
___ ___
...@@ -161,7 +161,7 @@ The new conversation instance ...@@ -161,7 +161,7 @@ The new conversation instance
#### Defined in #### Defined in
[src/chatgpt-api.ts:465](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api.ts#L465) [src/chatgpt-api.ts:465](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api.ts#L465)
___ ___
...@@ -178,7 +178,7 @@ the token fails. ...@@ -178,7 +178,7 @@ the token fails.
#### Defined in #### Defined in
[src/chatgpt-api.ts:346](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api.ts#L346) [src/chatgpt-api.ts:346](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api.ts#L346)
___ ___
...@@ -204,7 +204,7 @@ A valid access token ...@@ -204,7 +204,7 @@ A valid access token
#### Defined in #### Defined in
[src/chatgpt-api.ts:373](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api.ts#L373) [src/chatgpt-api.ts:373](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api.ts#L373)
___ ___
...@@ -235,7 +235,7 @@ The response from ChatGPT ...@@ -235,7 +235,7 @@ The response from ChatGPT
#### Defined in #### Defined in
[src/chatgpt-api.ts:167](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api.ts#L167) [src/chatgpt-api.ts:167](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api.ts#L167)
___ ___
...@@ -255,4 +255,4 @@ ___ ...@@ -255,4 +255,4 @@ ___
#### Defined in #### Defined in
[src/chatgpt-api.ts:303](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api.ts#L303) [src/chatgpt-api.ts:303](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api.ts#L303)
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
- [\_onResponse](ChatGPTAPIBrowser.md#_onresponse) - [\_onResponse](ChatGPTAPIBrowser.md#_onresponse)
- [close](ChatGPTAPIBrowser.md#close) - [close](ChatGPTAPIBrowser.md#close)
- [getIsAuthenticated](ChatGPTAPIBrowser.md#getisauthenticated) - [getIsAuthenticated](ChatGPTAPIBrowser.md#getisauthenticated)
- [getLastMessage](ChatGPTAPIBrowser.md#getlastmessage)
- [getMessages](ChatGPTAPIBrowser.md#getmessages)
- [getPrompts](ChatGPTAPIBrowser.md#getprompts)
- [handle403Error](ChatGPTAPIBrowser.md#handle403error) - [handle403Error](ChatGPTAPIBrowser.md#handle403error)
- [init](ChatGPTAPIBrowser.md#init) - [init](ChatGPTAPIBrowser.md#init)
- [resetThread](ChatGPTAPIBrowser.md#resetthread) - [resetThread](ChatGPTAPIBrowser.md#resetthread)
...@@ -35,16 +32,17 @@ Creates a new client wrapper for automating the ChatGPT webapp. ...@@ -35,16 +32,17 @@ Creates a new client wrapper for automating the ChatGPT webapp.
| Name | Type | Description | | Name | Type | Description |
| :------ | :------ | :------ | | :------ | :------ | :------ |
| `opts` | `Object` | - | | `opts` | `Object` | - |
| `opts.captchaToken?` | `string` | - | | `opts.captchaToken?` | `string` | **`Default Value`** `undefined` * |
| `opts.debug?` | `boolean` | **`Default Value`** `false` * | | `opts.debug?` | `boolean` | **`Default Value`** `false` * |
| `opts.email` | `string` | - | | `opts.email` | `string` | - |
| `opts.isGoogleLogin?` | `boolean` | - | | `opts.isGoogleLogin?` | `boolean` | **`Default Value`** `false` * |
| `opts.markdown?` | `boolean` | **`Default Value`** `true` * | | `opts.markdown?` | `boolean` | **`Default Value`** `true` * |
| `opts.minimize?` | `boolean` | **`Default Value`** `true` * |
| `opts.password` | `string` | - | | `opts.password` | `string` | - |
#### Defined in #### Defined in
[src/chatgpt-api-browser.ts:24](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L24) [src/chatgpt-api-browser.ts:31](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api-browser.ts#L31)
## Methods ## Methods
...@@ -64,7 +62,7 @@ Creates a new client wrapper for automating the ChatGPT webapp. ...@@ -64,7 +62,7 @@ Creates a new client wrapper for automating the ChatGPT webapp.
#### Defined in #### Defined in
[src/chatgpt-api-browser.ts:125](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L125) [src/chatgpt-api-browser.ts:142](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api-browser.ts#L142)
___ ___
...@@ -84,7 +82,7 @@ ___ ...@@ -84,7 +82,7 @@ ___
#### Defined in #### Defined in
[src/chatgpt-api-browser.ts:162](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L162) [src/chatgpt-api-browser.ts:179](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api-browser.ts#L179)
___ ___
...@@ -98,7 +96,7 @@ ___ ...@@ -98,7 +96,7 @@ ___
#### Defined in #### Defined in
[src/chatgpt-api-browser.ts:352](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L352) [src/chatgpt-api-browser.ts:441](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api-browser.ts#L441)
___ ___
...@@ -112,49 +110,7 @@ ___ ...@@ -112,49 +110,7 @@ ___
#### Defined in #### Defined in
[src/chatgpt-api-browser.ts:221](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L221) [src/chatgpt-api-browser.ts:246](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api-browser.ts#L246)
___
### getLastMessage
**getLastMessage**(): `Promise`<`string`\>
#### Returns
`Promise`<`string`\>
#### Defined in
[src/chatgpt-api-browser.ts:231](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L231)
___
### getMessages
**getMessages**(): `Promise`<`string`[]\>
#### Returns
`Promise`<`string`[]\>
#### Defined in
[src/chatgpt-api-browser.ts:251](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L251)
___
### getPrompts
**getPrompts**(): `Promise`<`string`[]\>
#### Returns
`Promise`<`string`[]\>
#### Defined in
[src/chatgpt-api-browser.ts:241](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L241)
___ ___
...@@ -168,7 +124,7 @@ ___ ...@@ -168,7 +124,7 @@ ___
#### Defined in #### Defined in
[src/chatgpt-api-browser.ts:204](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L204) [src/chatgpt-api-browser.ts:227](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api-browser.ts#L227)
___ ___
...@@ -182,7 +138,7 @@ ___ ...@@ -182,7 +138,7 @@ ___
#### Defined in #### Defined in
[src/chatgpt-api-browser.ts:55](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L55) [src/chatgpt-api-browser.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api-browser.ts#L70)
___ ___
...@@ -196,7 +152,7 @@ ___ ...@@ -196,7 +152,7 @@ ___
#### Defined in #### Defined in
[src/chatgpt-api-browser.ts:345](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L345) [src/chatgpt-api-browser.ts:434](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api-browser.ts#L434)
___ ___
...@@ -209,8 +165,7 @@ ___ ...@@ -209,8 +165,7 @@ ___
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `message` | `string` | | `message` | `string` |
| `opts` | `Object` | | `opts` | [`SendMessageOptions`](../modules.md#sendmessageoptions) |
| `opts.timeoutMs?` | `number` |
#### Returns #### Returns
...@@ -218,4 +173,4 @@ ___ ...@@ -218,4 +173,4 @@ ___
#### Defined in #### Defined in
[src/chatgpt-api-browser.ts:291](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L291) [src/chatgpt-api-browser.ts:319](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api-browser.ts#L319)
...@@ -41,7 +41,7 @@ Creates a new conversation wrapper around the ChatGPT API. ...@@ -41,7 +41,7 @@ Creates a new conversation wrapper around the ChatGPT API.
#### Defined in #### Defined in
[src/chatgpt-conversation.ts:21](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-conversation.ts#L21) [src/chatgpt-conversation.ts:21](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-conversation.ts#L21)
## Properties ## Properties
...@@ -51,7 +51,7 @@ Creates a new conversation wrapper around the ChatGPT API. ...@@ -51,7 +51,7 @@ Creates a new conversation wrapper around the ChatGPT API.
#### Defined in #### Defined in
[src/chatgpt-conversation.ts:10](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-conversation.ts#L10) [src/chatgpt-conversation.ts:10](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-conversation.ts#L10)
___ ___
...@@ -61,7 +61,7 @@ ___ ...@@ -61,7 +61,7 @@ ___
#### Defined in #### Defined in
[src/chatgpt-conversation.ts:11](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-conversation.ts#L11) [src/chatgpt-conversation.ts:11](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-conversation.ts#L11)
___ ___
...@@ -71,7 +71,7 @@ ___ ...@@ -71,7 +71,7 @@ ___
#### Defined in #### Defined in
[src/chatgpt-conversation.ts:12](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-conversation.ts#L12) [src/chatgpt-conversation.ts:12](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-conversation.ts#L12)
## Methods ## Methods
...@@ -104,4 +104,4 @@ The response from ChatGPT ...@@ -104,4 +104,4 @@ The response from ChatGPT
#### Defined in #### Defined in
[src/chatgpt-conversation.ts:48](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-conversation.ts#L48) [src/chatgpt-conversation.ts:48](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-conversation.ts#L48)
...@@ -66,7 +66,7 @@ node_modules/.pnpm/typescript@4.9.3/node_modules/typescript/lib/lib.es2022.error ...@@ -66,7 +66,7 @@ node_modules/.pnpm/typescript@4.9.3/node_modules/typescript/lib/lib.es2022.error
#### Defined in #### Defined in
[src/types.ts:298](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L298) [src/types.ts:298](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L298)
___ ___
...@@ -76,7 +76,7 @@ ___ ...@@ -76,7 +76,7 @@ ___
#### Defined in #### Defined in
[src/types.ts:297](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L297) [src/types.ts:297](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L297)
___ ___
...@@ -86,7 +86,7 @@ ___ ...@@ -86,7 +86,7 @@ ___
#### Defined in #### Defined in
[src/types.ts:295](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L295) [src/types.ts:295](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L295)
___ ___
...@@ -96,4 +96,4 @@ ___ ...@@ -96,4 +96,4 @@ ___
#### Defined in #### Defined in
[src/types.ts:296](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L296) [src/types.ts:296](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L296)
This diff is collapsed.
...@@ -6,9 +6,9 @@ On December 11th, OpenAI added Cloudflare protections that make it more difficul ...@@ -6,9 +6,9 @@ On December 11th, OpenAI added Cloudflare protections that make it more difficul
This package has been updated to use Puppeteer to automatically log in to ChatGPT and extract the necessary auth credentials. 🔥 This package has been updated to use Puppeteer to automatically log in to ChatGPT and extract the necessary auth credentials. 🔥
Even with this in place, however, it's not uncommon to run into 429 / 403 errors at the moment using the `getOpenAIAuth` + `ChatGPTAPI` approach. Even with this in place, however, it's common to run into 429 / 403 errors at the moment using the `getOpenAIAuth` + `ChatGPTAPI` approach.
To circumvent these issues, we've also added a full browser-based solution, which uses Puppeteer to log into the webapp and fully automate the web UI. To circumvent these issues, we've also added a full browser-based solution, which uses Puppeteer to login and automate the webapp.
The full browser version is working consistently and can be used via: The full browser version is working consistently and can be used via:
...@@ -26,7 +26,7 @@ const response = await api.sendMessage('Hello World!') ...@@ -26,7 +26,7 @@ const response = await api.sendMessage('Hello World!')
Note that this solution is not lightweight, but it does work a lot more consistently than the REST API-based versions. I'm currently using this solution to power 10 OpenAI accounts concurrently across 10 minimized Chrome windows for my [Twitter bot](https://github.com/transitive-bullshit/chatgpt-twitter-bot). 😂 Note that this solution is not lightweight, but it does work a lot more consistently than the REST API-based versions. I'm currently using this solution to power 10 OpenAI accounts concurrently across 10 minimized Chrome windows for my [Twitter bot](https://github.com/transitive-bullshit/chatgpt-twitter-bot). 😂
If you get a "ChatGPT is at capacity" error when logging in, note that this is also happening quite frequently on the official webapp. Their servers are overloaded, and we're all trying our best to offer access to this amazing technology. If you get a "ChatGPT is at capacity" error when logging in, note that this can also happen on the official webapp as well. Their servers get overloaded at times, and we're all trying our best to offer access to this amazing technology.
To use the updated version, **make sure you're using the latest version of this package and Node.js >= 18**. Then update your code following the examples below, paying special attention to the sections on [Authentication](#authentication) and [Restrictions](#restrictions). To use the updated version, **make sure you're using the latest version of this package and Node.js >= 18**. Then update your code following the examples below, paying special attention to the sections on [Authentication](#authentication) and [Restrictions](#restrictions).
...@@ -35,7 +35,6 @@ We're working hard to improve this process (especially CAPTCHA automation). Keep ...@@ -35,7 +35,6 @@ We're working hard to improve this process (especially CAPTCHA automation). Keep
Lastly, please consider starring this repo and <a href="https://twitter.com/transitive_bs">following me on twitter <img src="https://storage.googleapis.com/saasify-assets/twitter-logo.svg" alt="twitter" height="24px" align="center"></a> to help support the project. Lastly, please consider starring this repo and <a href="https://twitter.com/transitive_bs">following me on twitter <img src="https://storage.googleapis.com/saasify-assets/twitter-logo.svg" alt="twitter" height="24px" align="center"></a> to help support the project.
Thanks && cheers, Thanks && cheers,
[Travis](https://twitter.com/transitive_bs) [Travis](https://twitter.com/transitive_bs)
--- ---
...@@ -181,7 +180,7 @@ async function example() { ...@@ -181,7 +180,7 @@ async function example() {
### Docs ### Docs
See the [auto-generated docs](./docs/classes/ChatGPTAPI.md) for more info on methods and parameters. See the [auto-generated docs](./docs/classes/ChatGPTAPI.md) for more info on methods and parameters. Here are the [docs](./docs/classes/ChatGPTAPIBrowser.md) for the browser-based version.
### Demos ### Demos
...@@ -203,6 +202,12 @@ A [conversation demo](./demos/demo-conversation.ts) is also included: ...@@ -203,6 +202,12 @@ A [conversation demo](./demos/demo-conversation.ts) is also included:
npx tsx demos/demo-conversation.ts npx tsx demos/demo-conversation.ts
``` ```
A [browser-based conversation demo](./demos/demo-conversation-browser.ts) is also included:
```bash
npx tsx demos/demo-conversation-browser.ts
```
### Authentication ### Authentication
On December 11, 2022, OpenAI added some additional Cloudflare protections which make it more difficult to access the unofficial API. On December 11, 2022, OpenAI added some additional Cloudflare protections which make it more difficult to access the unofficial API.
...@@ -310,7 +315,7 @@ This package is ESM-only. It supports: ...@@ -310,7 +315,7 @@ This package is ESM-only. It supports:
## Credits ## Credits
- Huge thanks to [@wong2](https://github.com/wong2), [@simon300000](https://github.com/simon300000), [@RomanHotsiy](https://github.com/RomanHotsiy), [@ElijahPepe](https://github.com/ElijahPepe), and all the other contributors 💪 - Huge thanks to [@abacaj](https://github.com/abacaj), [@waylaidwanderer](https://github.com/waylaidwanderer), [@wong2](https://github.com/wong2), [@simon300000](https://github.com/simon300000), [@RomanHotsiy](https://github.com/RomanHotsiy), [@ElijahPepe](https://github.com/ElijahPepe), and all the other contributors 💪
- The original browser version was inspired by this [Go module](https://github.com/danielgross/whatsapp-gpt) by [Daniel Gross](https://github.com/danielgross) - The original browser version was inspired by this [Go module](https://github.com/danielgross/whatsapp-gpt) by [Daniel Gross](https://github.com/danielgross)
- [OpenAI](https://openai.com) for creating [ChatGPT](https://openai.com/blog/chatgpt/) 🔥 - [OpenAI](https://openai.com) for creating [ChatGPT](https://openai.com/blog/chatgpt/) 🔥
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment