kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
chore: update auto-generated docs
rodzic
d27238c49a
commit
abd6dd1c2f
|
@ -53,7 +53,7 @@ to obtain your `clearanceToken`.
|
|||
|
||||
#### 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
|
||||
|
||||
|
@ -69,7 +69,7 @@ Gets the current Cloudflare clearance token (`cf_clearance` cookie value).
|
|||
|
||||
#### 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.
|
|||
|
||||
#### 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.
|
|||
|
||||
#### 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.
|
|||
|
||||
#### 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
|
||||
|
||||
|
@ -134,7 +134,7 @@ is still valid.
|
|||
|
||||
#### 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
|
|||
|
||||
#### 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.
|
|||
|
||||
#### 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
|
|||
|
||||
#### 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
|
|||
|
||||
#### 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 @@ ___
|
|||
|
||||
#### 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 @@
|
|||
- [\_onResponse](ChatGPTAPIBrowser.md#_onresponse)
|
||||
- [close](ChatGPTAPIBrowser.md#close)
|
||||
- [getIsAuthenticated](ChatGPTAPIBrowser.md#getisauthenticated)
|
||||
- [getLastMessage](ChatGPTAPIBrowser.md#getlastmessage)
|
||||
- [getMessages](ChatGPTAPIBrowser.md#getmessages)
|
||||
- [getPrompts](ChatGPTAPIBrowser.md#getprompts)
|
||||
- [handle403Error](ChatGPTAPIBrowser.md#handle403error)
|
||||
- [init](ChatGPTAPIBrowser.md#init)
|
||||
- [resetThread](ChatGPTAPIBrowser.md#resetthread)
|
||||
|
@ -35,16 +32,17 @@ Creates a new client wrapper for automating the ChatGPT webapp.
|
|||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `opts` | `Object` | - |
|
||||
| `opts.captchaToken?` | `string` | - |
|
||||
| `opts.captchaToken?` | `string` | **`Default Value`** `undefined` * |
|
||||
| `opts.debug?` | `boolean` | **`Default Value`** `false` * |
|
||||
| `opts.email` | `string` | - |
|
||||
| `opts.isGoogleLogin?` | `boolean` | - |
|
||||
| `opts.isGoogleLogin?` | `boolean` | **`Default Value`** `false` * |
|
||||
| `opts.markdown?` | `boolean` | **`Default Value`** `true` * |
|
||||
| `opts.minimize?` | `boolean` | **`Default Value`** `true` * |
|
||||
| `opts.password` | `string` | - |
|
||||
|
||||
#### 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
|
||||
|
||||
|
@ -64,7 +62,7 @@ Creates a new client wrapper for automating the ChatGPT webapp.
|
|||
|
||||
#### 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 @@ ___
|
|||
|
||||
#### 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 @@ ___
|
|||
|
||||
#### 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 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/chatgpt-api-browser.ts:221](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/chatgpt-api-browser.ts#L221)
|
||||
|
||||
___
|
||||
|
||||
### 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)
|
||||
[src/chatgpt-api-browser.ts:246](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/chatgpt-api-browser.ts#L246)
|
||||
|
||||
___
|
||||
|
||||
|
@ -168,7 +124,7 @@ ___
|
|||
|
||||
#### 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 @@ ___
|
|||
|
||||
#### 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 @@ ___
|
|||
|
||||
#### 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 @@ ___
|
|||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `message` | `string` |
|
||||
| `opts` | `Object` |
|
||||
| `opts.timeoutMs?` | `number` |
|
||||
| `opts` | [`SendMessageOptions`](../modules.md#sendmessageoptions) |
|
||||
|
||||
#### Returns
|
||||
|
||||
|
@ -218,4 +173,4 @@ ___
|
|||
|
||||
#### 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.
|
|||
|
||||
#### 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
|
||||
|
||||
|
@ -51,7 +51,7 @@ Creates a new conversation wrapper around the ChatGPT API.
|
|||
|
||||
#### 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 @@ ___
|
|||
|
||||
#### 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 @@ ___
|
|||
|
||||
#### 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
|
||||
|
||||
|
@ -104,4 +104,4 @@ The response from ChatGPT
|
|||
|
||||
#### 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
|
|||
|
||||
#### 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 @@ ___
|
|||
|
||||
#### 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 @@ ___
|
|||
|
||||
#### 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 @@ ___
|
|||
|
||||
#### 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)
|
||||
|
|
135
docs/modules.md
135
docs/modules.md
|
@ -14,6 +14,8 @@
|
|||
### Type Aliases
|
||||
|
||||
- [AvailableModerationModels](modules.md#availablemoderationmodels)
|
||||
- [ChatError](modules.md#chaterror)
|
||||
- [ChatResponse](modules.md#chatresponse)
|
||||
- [ContentType](modules.md#contenttype)
|
||||
- [ConversationJSONBody](modules.md#conversationjsonbody)
|
||||
- [ConversationResponseEvent](modules.md#conversationresponseevent)
|
||||
|
@ -40,6 +42,7 @@
|
|||
|
||||
### Functions
|
||||
|
||||
- [browserPostEventStream](modules.md#browserposteventstream)
|
||||
- [defaultChromeExecutablePath](modules.md#defaultchromeexecutablepath)
|
||||
- [getBrowser](modules.md#getbrowser)
|
||||
- [getOpenAIAuth](modules.md#getopenaiauth)
|
||||
|
@ -56,7 +59,50 @@
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:109](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L109)
|
||||
[src/types.ts:109](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L109)
|
||||
|
||||
___
|
||||
|
||||
### ChatError
|
||||
|
||||
Ƭ **ChatError**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `conversationId?` | `string` |
|
||||
| `conversationResponse?` | [`ConversationResponseEvent`](modules.md#conversationresponseevent) |
|
||||
| `error` | { `message`: `string` ; `statusCode?`: `number` ; `statusText?`: `string` } |
|
||||
| `error.message` | `string` |
|
||||
| `error.statusCode?` | `number` |
|
||||
| `error.statusText?` | `string` |
|
||||
| `messageId?` | `string` |
|
||||
| `response` | ``null`` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:301](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L301)
|
||||
|
||||
___
|
||||
|
||||
### ChatResponse
|
||||
|
||||
Ƭ **ChatResponse**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `conversationId` | `string` |
|
||||
| `conversationResponse?` | [`ConversationResponseEvent`](modules.md#conversationresponseevent) |
|
||||
| `error` | ``null`` |
|
||||
| `messageId` | `string` |
|
||||
| `response` | `string` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:309](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L309)
|
||||
|
||||
___
|
||||
|
||||
|
@ -66,7 +112,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:1](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L1)
|
||||
[src/types.ts:1](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L1)
|
||||
|
||||
___
|
||||
|
||||
|
@ -88,7 +134,7 @@ https://chat.openapi.com/backend-api/conversation
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:134](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L134)
|
||||
[src/types.ts:134](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L134)
|
||||
|
||||
___
|
||||
|
||||
|
@ -106,7 +152,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:251](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L251)
|
||||
[src/types.ts:251](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L251)
|
||||
|
||||
___
|
||||
|
||||
|
@ -131,7 +177,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:257](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L257)
|
||||
[src/types.ts:257](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L257)
|
||||
|
||||
___
|
||||
|
||||
|
@ -141,7 +187,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:276](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L276)
|
||||
[src/types.ts:276](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L276)
|
||||
|
||||
___
|
||||
|
||||
|
@ -158,7 +204,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:270](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L270)
|
||||
[src/types.ts:270](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L270)
|
||||
|
||||
___
|
||||
|
||||
|
@ -180,7 +226,7 @@ https://chat.openapi.com/backend-api/conversation/message_feedback
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:193](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L193)
|
||||
[src/types.ts:193](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L193)
|
||||
|
||||
___
|
||||
|
||||
|
@ -190,7 +236,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:249](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L249)
|
||||
[src/types.ts:249](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L249)
|
||||
|
||||
___
|
||||
|
||||
|
@ -210,7 +256,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:222](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L222)
|
||||
[src/types.ts:222](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L222)
|
||||
|
||||
___
|
||||
|
||||
|
@ -220,7 +266,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:220](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L220)
|
||||
[src/types.ts:220](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L220)
|
||||
|
||||
___
|
||||
|
||||
|
@ -230,7 +276,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:275](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L275)
|
||||
[src/types.ts:275](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L275)
|
||||
|
||||
___
|
||||
|
||||
|
@ -248,7 +294,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:77](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L77)
|
||||
[src/types.ts:77](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
|
@ -266,7 +312,7 @@ https://chat.openapi.com/backend-api/models
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L70)
|
||||
[src/types.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
|
@ -285,7 +331,7 @@ https://chat.openapi.com/backend-api/moderations
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L97)
|
||||
[src/types.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
|
@ -305,7 +351,7 @@ https://chat.openapi.com/backend-api/moderations
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:114](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L114)
|
||||
[src/types.ts:114](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L114)
|
||||
|
||||
___
|
||||
|
||||
|
@ -327,7 +373,7 @@ to authenticate with the unofficial ChatGPT API.
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/openai-auth.ts:20](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/openai-auth.ts#L20)
|
||||
[src/openai-auth.ts:20](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/openai-auth.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
|
@ -345,7 +391,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:161](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L161)
|
||||
[src/types.ts:161](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L161)
|
||||
|
||||
___
|
||||
|
||||
|
@ -362,7 +408,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:178](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L178)
|
||||
[src/types.ts:178](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L178)
|
||||
|
||||
___
|
||||
|
||||
|
@ -372,7 +418,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:3](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L3)
|
||||
[src/types.ts:3](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L3)
|
||||
|
||||
___
|
||||
|
||||
|
@ -382,7 +428,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:289](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L289)
|
||||
[src/types.ts:289](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L289)
|
||||
|
||||
___
|
||||
|
||||
|
@ -405,7 +451,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:278](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L278)
|
||||
[src/types.ts:278](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L278)
|
||||
|
||||
___
|
||||
|
||||
|
@ -426,7 +472,7 @@ https://chat.openapi.com/api/auth/session
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:8](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L8)
|
||||
[src/types.ts:8](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
|
@ -448,10 +494,37 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:30](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/types.ts#L30)
|
||||
[src/types.ts:30](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/types.ts#L30)
|
||||
|
||||
## Functions
|
||||
|
||||
### browserPostEventStream
|
||||
|
||||
▸ **browserPostEventStream**(`url`, `accessToken`, `body`, `timeoutMs?`): `Promise`<[`ChatError`](modules.md#chaterror) \| [`ChatResponse`](modules.md#chatresponse)\>
|
||||
|
||||
This function is injected into the ChatGPT webapp page using puppeteer. It
|
||||
has to be fully self-contained, so we copied a few third-party sources and
|
||||
included them in here.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `url` | `string` |
|
||||
| `accessToken` | `string` |
|
||||
| `body` | [`ConversationJSONBody`](modules.md#conversationjsonbody) |
|
||||
| `timeoutMs?` | `number` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatError`](modules.md#chaterror) \| [`ChatResponse`](modules.md#chatresponse)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/utils.ts:73](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/utils.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### defaultChromeExecutablePath
|
||||
|
||||
▸ **defaultChromeExecutablePath**(): `string`
|
||||
|
@ -464,7 +537,7 @@ Gets the default path to chrome's executable for the current platform.
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/openai-auth.ts:216](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/openai-auth.ts#L216)
|
||||
[src/openai-auth.ts:218](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/openai-auth.ts#L218)
|
||||
|
||||
___
|
||||
|
||||
|
@ -488,7 +561,7 @@ recognizes it and blocks access.
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/openai-auth.ts:182](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/openai-auth.ts#L182)
|
||||
[src/openai-auth.ts:184](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/openai-auth.ts#L184)
|
||||
|
||||
___
|
||||
|
||||
|
@ -529,7 +602,7 @@ with your updated credentials.
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/openai-auth.ts:42](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/openai-auth.ts#L42)
|
||||
[src/openai-auth.ts:42](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/openai-auth.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
|
@ -549,7 +622,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/utils.ts:32](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/utils.ts#L32)
|
||||
[src/utils.ts:39](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/utils.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
|
@ -569,7 +642,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/utils.ts:5](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/utils.ts#L5)
|
||||
[src/utils.ts:12](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/utils.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
|
@ -589,7 +662,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/utils.ts:22](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/utils.ts#L22)
|
||||
[src/utils.ts:29](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/utils.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
|
@ -609,4 +682,4 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/utils.ts:12](https://github.com/transitive-bullshit/chatgpt-api/blob/16d1699/src/utils.ts#L12)
|
||||
[src/utils.ts:19](https://github.com/transitive-bullshit/chatgpt-api/blob/d27238c/src/utils.ts#L19)
|
||||
|
|
|
@ -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. 🔥
|
||||
|
||||
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:
|
||||
|
||||
|
@ -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). 😂
|
||||
|
||||
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).
|
||||
|
||||
|
@ -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.
|
||||
|
||||
Thanks && cheers,
|
||||
|
||||
[Travis](https://twitter.com/transitive_bs)
|
||||
|
||||
---
|
||||
|
@ -181,7 +180,7 @@ async function example() {
|
|||
|
||||
### 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
|
||||
|
||||
|
@ -203,6 +202,12 @@ A [conversation demo](./demos/demo-conversation.ts) is also included:
|
|||
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
|
||||
|
||||
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:
|
|||
|
||||
## 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)
|
||||
- [OpenAI](https://openai.com) for creating [ChatGPT](https://openai.com/blog/chatgpt/) 🔥
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue