From 1c8fddfa3a04257cfba5c696e01e1c695363def4 Mon Sep 17 00:00:00 2001 From: optionsx <52641788+optionsx@users.noreply.github.com> Date: Mon, 19 Dec 2022 01:32:45 +0300 Subject: [PATCH 1/6] Addition of Microsoft Login. --- legacy/src/chatgpt-api-browser.ts | 11 +++++++++-- legacy/src/openai-auth.ts | 20 +++++++++++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/legacy/src/chatgpt-api-browser.ts b/legacy/src/chatgpt-api-browser.ts index 8dd00163..28db1340 100644 --- a/legacy/src/chatgpt-api-browser.ts +++ b/legacy/src/chatgpt-api-browser.ts @@ -20,6 +20,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { protected _debug: boolean protected _minimize: boolean protected _isGoogleLogin: boolean + protected _isWindowsLogin: boolean protected _captchaToken: string protected _accessToken: string @@ -46,6 +47,9 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { /** @defaultValue `false` **/ isGoogleLogin?: boolean + /** @defaultValue `false` **/ + isWindowsLogin?: boolean + /** @defaultValue `true` **/ minimize?: boolean @@ -63,6 +67,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { markdown = true, debug = false, isGoogleLogin = false, + isWindowsLogin = false, minimize = true, captchaToken, executablePath @@ -74,6 +79,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { this._markdown = !!markdown this._debug = !!debug this._isGoogleLogin = !!isGoogleLogin + this._isWindowsLogin = !!isWindowsLogin this._minimize = !!minimize this._captchaToken = captchaToken this._executablePath = executablePath @@ -124,7 +130,8 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { password: this._password, browser: this._browser, page: this._page, - isGoogleLogin: this._isGoogleLogin + isGoogleLogin: this._isGoogleLogin, + isWindowsLogin: this._isWindowsLogin }) } catch (err) { if (this._browser) { @@ -137,7 +144,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { throw err } - if (!this.isChatPage || this._isGoogleLogin) { + if (!this.isChatPage || this._isGoogleLogin || this._isWindowsLogin) { await this._page.goto(CHAT_PAGE_URL, { waitUntil: 'networkidle2' }) diff --git a/legacy/src/openai-auth.ts b/legacy/src/openai-auth.ts index ed3bf416..fdc9c1a1 100644 --- a/legacy/src/openai-auth.ts +++ b/legacy/src/openai-auth.ts @@ -53,6 +53,7 @@ export async function getOpenAIAuth({ page, timeoutMs = 2 * 60 * 1000, isGoogleLogin = false, + isWindowsLogin = false, captchaToken = process.env.CAPTCHA_TOKEN, nopechaKey = process.env.NOPECHA_KEY, executablePath @@ -63,6 +64,7 @@ export async function getOpenAIAuth({ page?: Page timeoutMs?: number isGoogleLogin?: boolean + isWindowsLogin?: boolean captchaToken?: string nopechaKey?: string executablePath?: string @@ -132,6 +134,23 @@ export async function getOpenAIAuth({ await page.waitForSelector('input[type="password"]', { visible: true }) await page.type('input[type="password"]', password, { delay: 10 }) submitP = () => page.keyboard.press('Enter') + } else if (isWindowsLogin) { + await page.click('button[data-provider="windowslive"]') + await page.waitForSelector('input[type="email"]') + await page.type('input[type="email"]', email, { delay: 10 }) + await Promise.all([ + page.waitForNavigation(), + await page.keyboard.press('Enter') + ]) + await delay(1500) + await page.waitForSelector('input[type="password"]', { visible: true }) + await page.type('input[type="password"]', password, { delay: 10 }) + submitP = () => page.keyboard.press('Enter') + await Promise.all([ + page.waitForNavigation(), + await page.keyboard.press('Enter') + ]) + await delay(1000) } else { await page.waitForSelector('#username') await page.type('#username', email, { delay: 20 }) @@ -293,7 +312,6 @@ export async function getBrowser( const page = (await browser.pages())[0] || (await browser.newPage()) await page.goto(`https://nopecha.com/setup#${nopechaKey}`) await delay(1000) - try { const page3 = await browser.newPage() await page.close() From afe41d2c77483b1e5c53b811e4d1b1c18e12c755 Mon Sep 17 00:00:00 2001 From: optionsx <52641788+optionsx@users.noreply.github.com> Date: Mon, 19 Dec 2022 01:59:33 +0300 Subject: [PATCH 2/6] Document Microsoft Login Change --- legacy/docs/classes/ChatGPTAPIBrowser.md | 1 + legacy/docs/modules.md | 1 + legacy/docs/readme.md | 3 ++- legacy/readme.md | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/legacy/docs/classes/ChatGPTAPIBrowser.md b/legacy/docs/classes/ChatGPTAPIBrowser.md index ed96c9f0..1641144b 100644 --- a/legacy/docs/classes/ChatGPTAPIBrowser.md +++ b/legacy/docs/classes/ChatGPTAPIBrowser.md @@ -48,6 +48,7 @@ Creates a new client for automating the ChatGPT webapp. | `opts.email` | `string` | - | | `opts.executablePath?` | `string` | **`Default Value`** `undefined` * | | `opts.isGoogleLogin?` | `boolean` | **`Default Value`** `false` * | +| `opts.isWindowsLogin?` | `boolean` | **`Default Value`** `false` * | | `opts.markdown?` | `boolean` | **`Default Value`** `true` * | | `opts.minimize?` | `boolean` | **`Default Value`** `true` * | | `opts.password` | `string` | - | diff --git a/legacy/docs/modules.md b/legacy/docs/modules.md index c4b940f1..9465469f 100644 --- a/legacy/docs/modules.md +++ b/legacy/docs/modules.md @@ -588,6 +588,7 @@ with your updated credentials. | `__namedParameters.email?` | `string` | | `__namedParameters.executablePath?` | `string` | | `__namedParameters.isGoogleLogin?` | `boolean` | +| `__namedParameters.isWindowsLogin?` | `boolean` | | `__namedParameters.nopechaKey?` | `string` | | `__namedParameters.page?` | `Page` | | `__namedParameters.password?` | `string` | diff --git a/legacy/docs/readme.md b/legacy/docs/readme.md index 0d802a36..919f9376 100644 --- a/legacy/docs/readme.md +++ b/legacy/docs/readme.md @@ -262,13 +262,14 @@ Basic Cloudflare CAPTCHAs are handled by default, but if you want to automate th - More well-known solution that's been around longer - Set the `CAPTCHA_TOKEN` env var to your 2captcha API token -Alternatively, if your OpenAI account uses Google Auth, you shouldn't encounter any of the more complicated Recaptchas — and can avoid using these third-party providers. To use Google auth, make sure your OpenAI account is using Google and then set `isGoogleLogin` to `true` whenever you're passing your `email` and `password`. For example: +Alternatively, if your OpenAI account uses Google Auth and Microsoft, you shouldn't encounter any of the more complicated Recaptchas — and can avoid using these third-party providers. To use Google auth, make sure your OpenAI account is using Google or Microsoft and then set either `isGoogleLogin` or `isWindowsLogin` to `true` whenever you're passing your `email` and `password`. For example: ```ts const api = new ChatGPTAPIBrowser({ email: process.env.OPENAI_EMAIL, password: process.env.OPENAI_PASSWORD, isGoogleLogin: true + isWindowsLogin: true // use only one of this options. }) ``` diff --git a/legacy/readme.md b/legacy/readme.md index 8ad3a037..d7fa14f1 100644 --- a/legacy/readme.md +++ b/legacy/readme.md @@ -254,13 +254,14 @@ Basic Cloudflare CAPTCHAs are handled by default, but if you want to automate th - More well-known solution that's been around longer - Set the `CAPTCHA_TOKEN` env var to your 2captcha API token -Alternatively, if your OpenAI account uses Google Auth, you shouldn't encounter any of the more complicated Recaptchas — and can avoid using these third-party providers. To use Google auth, make sure your OpenAI account is using Google and then set `isGoogleLogin` to `true` whenever you're passing your `email` and `password`. For example: +Alternatively, if your OpenAI account uses Google Auth and Microsoft, you shouldn't encounter any of the more complicated Recaptchas — and can avoid using these third-party providers. To use Google auth, make sure your OpenAI account is using Google or Microsoft and then set either `isGoogleLogin` or `isWindowsLogin` to `true` whenever you're passing your `email` and `password`. For example: ```ts const api = new ChatGPTAPIBrowser({ email: process.env.OPENAI_EMAIL, password: process.env.OPENAI_PASSWORD, isGoogleLogin: true + isWindowsLogin: true // use only one of this options. }) ``` From 3e108d19fa257034e4f7c4243a0a7ee8543acffc Mon Sep 17 00:00:00 2001 From: optionsx <52641788+optionsx@users.noreply.github.com> Date: Mon, 19 Dec 2022 02:52:27 +0300 Subject: [PATCH 3/6] revision of last changes --- legacy/docs/classes/ChatGPTAPIBrowser.md | 1 - legacy/docs/readme.md | 3 +-- legacy/readme.md | 3 +-- legacy/src/chatgpt-api-browser.ts | 12 ++++++------ legacy/src/openai-auth.ts | 14 +++++++------- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/legacy/docs/classes/ChatGPTAPIBrowser.md b/legacy/docs/classes/ChatGPTAPIBrowser.md index 1641144b..ed96c9f0 100644 --- a/legacy/docs/classes/ChatGPTAPIBrowser.md +++ b/legacy/docs/classes/ChatGPTAPIBrowser.md @@ -48,7 +48,6 @@ Creates a new client for automating the ChatGPT webapp. | `opts.email` | `string` | - | | `opts.executablePath?` | `string` | **`Default Value`** `undefined` * | | `opts.isGoogleLogin?` | `boolean` | **`Default Value`** `false` * | -| `opts.isWindowsLogin?` | `boolean` | **`Default Value`** `false` * | | `opts.markdown?` | `boolean` | **`Default Value`** `true` * | | `opts.minimize?` | `boolean` | **`Default Value`** `true` * | | `opts.password` | `string` | - | diff --git a/legacy/docs/readme.md b/legacy/docs/readme.md index 919f9376..0d802a36 100644 --- a/legacy/docs/readme.md +++ b/legacy/docs/readme.md @@ -262,14 +262,13 @@ Basic Cloudflare CAPTCHAs are handled by default, but if you want to automate th - More well-known solution that's been around longer - Set the `CAPTCHA_TOKEN` env var to your 2captcha API token -Alternatively, if your OpenAI account uses Google Auth and Microsoft, you shouldn't encounter any of the more complicated Recaptchas — and can avoid using these third-party providers. To use Google auth, make sure your OpenAI account is using Google or Microsoft and then set either `isGoogleLogin` or `isWindowsLogin` to `true` whenever you're passing your `email` and `password`. For example: +Alternatively, if your OpenAI account uses Google Auth, you shouldn't encounter any of the more complicated Recaptchas — and can avoid using these third-party providers. To use Google auth, make sure your OpenAI account is using Google and then set `isGoogleLogin` to `true` whenever you're passing your `email` and `password`. For example: ```ts const api = new ChatGPTAPIBrowser({ email: process.env.OPENAI_EMAIL, password: process.env.OPENAI_PASSWORD, isGoogleLogin: true - isWindowsLogin: true // use only one of this options. }) ``` diff --git a/legacy/readme.md b/legacy/readme.md index d7fa14f1..8ad3a037 100644 --- a/legacy/readme.md +++ b/legacy/readme.md @@ -254,14 +254,13 @@ Basic Cloudflare CAPTCHAs are handled by default, but if you want to automate th - More well-known solution that's been around longer - Set the `CAPTCHA_TOKEN` env var to your 2captcha API token -Alternatively, if your OpenAI account uses Google Auth and Microsoft, you shouldn't encounter any of the more complicated Recaptchas — and can avoid using these third-party providers. To use Google auth, make sure your OpenAI account is using Google or Microsoft and then set either `isGoogleLogin` or `isWindowsLogin` to `true` whenever you're passing your `email` and `password`. For example: +Alternatively, if your OpenAI account uses Google Auth, you shouldn't encounter any of the more complicated Recaptchas — and can avoid using these third-party providers. To use Google auth, make sure your OpenAI account is using Google and then set `isGoogleLogin` to `true` whenever you're passing your `email` and `password`. For example: ```ts const api = new ChatGPTAPIBrowser({ email: process.env.OPENAI_EMAIL, password: process.env.OPENAI_PASSWORD, isGoogleLogin: true - isWindowsLogin: true // use only one of this options. }) ``` diff --git a/legacy/src/chatgpt-api-browser.ts b/legacy/src/chatgpt-api-browser.ts index 28db1340..31685451 100644 --- a/legacy/src/chatgpt-api-browser.ts +++ b/legacy/src/chatgpt-api-browser.ts @@ -20,7 +20,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { protected _debug: boolean protected _minimize: boolean protected _isGoogleLogin: boolean - protected _isWindowsLogin: boolean + protected _isMicrosoftLogin: boolean protected _captchaToken: string protected _accessToken: string @@ -48,7 +48,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { isGoogleLogin?: boolean /** @defaultValue `false` **/ - isWindowsLogin?: boolean + isMicrosoftLogin?: boolean /** @defaultValue `true` **/ minimize?: boolean @@ -67,7 +67,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { markdown = true, debug = false, isGoogleLogin = false, - isWindowsLogin = false, + isMicrosoftLogin = false, minimize = true, captchaToken, executablePath @@ -79,7 +79,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { this._markdown = !!markdown this._debug = !!debug this._isGoogleLogin = !!isGoogleLogin - this._isWindowsLogin = !!isWindowsLogin + this._isMicrosoftLogin = !!isMicrosoftLogin this._minimize = !!minimize this._captchaToken = captchaToken this._executablePath = executablePath @@ -131,7 +131,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { browser: this._browser, page: this._page, isGoogleLogin: this._isGoogleLogin, - isWindowsLogin: this._isWindowsLogin + isMicrosoftLogin: this._isMicrosoftLogin }) } catch (err) { if (this._browser) { @@ -144,7 +144,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { throw err } - if (!this.isChatPage || this._isGoogleLogin || this._isWindowsLogin) { + if (!this.isChatPage || this._isGoogleLogin || this._isMicrosoftLogin) { await this._page.goto(CHAT_PAGE_URL, { waitUntil: 'networkidle2' }) diff --git a/legacy/src/openai-auth.ts b/legacy/src/openai-auth.ts index fdc9c1a1..31ca66cd 100644 --- a/legacy/src/openai-auth.ts +++ b/legacy/src/openai-auth.ts @@ -53,7 +53,7 @@ export async function getOpenAIAuth({ page, timeoutMs = 2 * 60 * 1000, isGoogleLogin = false, - isWindowsLogin = false, + isMicrosoftLogin = false, captchaToken = process.env.CAPTCHA_TOKEN, nopechaKey = process.env.NOPECHA_KEY, executablePath @@ -64,7 +64,7 @@ export async function getOpenAIAuth({ page?: Page timeoutMs?: number isGoogleLogin?: boolean - isWindowsLogin?: boolean + isMicrosoftLogin?: boolean captchaToken?: string nopechaKey?: string executablePath?: string @@ -134,7 +134,7 @@ export async function getOpenAIAuth({ await page.waitForSelector('input[type="password"]', { visible: true }) await page.type('input[type="password"]', password, { delay: 10 }) submitP = () => page.keyboard.press('Enter') - } else if (isWindowsLogin) { + } else if (isMicrosoftLogin) { await page.click('button[data-provider="windowslive"]') await page.waitForSelector('input[type="email"]') await page.type('input[type="email"]', email, { delay: 10 }) @@ -146,10 +146,10 @@ export async function getOpenAIAuth({ await page.waitForSelector('input[type="password"]', { visible: true }) await page.type('input[type="password"]', password, { delay: 10 }) submitP = () => page.keyboard.press('Enter') - await Promise.all([ - page.waitForNavigation(), - await page.keyboard.press('Enter') - ]) + // await Promise.all([ + // page.waitForNavigation(), + // await page.keyboard.press('Enter') + // ]) await delay(1000) } else { await page.waitForSelector('#username') From 67cfe206aca587d12fcee9f6035d574e55ad9886 Mon Sep 17 00:00:00 2001 From: optionsx <52641788+optionsx@users.noreply.github.com> Date: Mon, 19 Dec 2022 02:54:17 +0300 Subject: [PATCH 4/6] Last One :) --- legacy/src/openai-auth.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/legacy/src/openai-auth.ts b/legacy/src/openai-auth.ts index 31ca66cd..64d3122f 100644 --- a/legacy/src/openai-auth.ts +++ b/legacy/src/openai-auth.ts @@ -146,10 +146,10 @@ export async function getOpenAIAuth({ await page.waitForSelector('input[type="password"]', { visible: true }) await page.type('input[type="password"]', password, { delay: 10 }) submitP = () => page.keyboard.press('Enter') - // await Promise.all([ - // page.waitForNavigation(), - // await page.keyboard.press('Enter') - // ]) + await Promise.all([ + page.waitForNavigation(), + await page.keyboard.press('Enter') + ]) await delay(1000) } else { await page.waitForSelector('#username') From fc429898511e883f32384c280de7270f65a44712 Mon Sep 17 00:00:00 2001 From: optionsx <52641788+optionsx@users.noreply.github.com> Date: Mon, 19 Dec 2022 03:11:44 +0300 Subject: [PATCH 5/6] Update modules.md --- legacy/docs/modules.md | 349 ++++++++++++++++++++--------------------- 1 file changed, 174 insertions(+), 175 deletions(-) diff --git a/legacy/docs/modules.md b/legacy/docs/modules.md index 9465469f..f04d7df2 100644 --- a/legacy/docs/modules.md +++ b/legacy/docs/modules.md @@ -55,13 +55,13 @@ ### AvailableModerationModels -Ƭ **AvailableModerationModels**: ``"text-moderation-playground"`` +Ƭ **AvailableModerationModels**: `"text-moderation-playground"` #### Defined in [src/types.ts:109](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L109) -___ +--- ### ChatError @@ -69,20 +69,20 @@ ___ #### Type declaration -| Name | Type | -| :------ | :------ | -| `conversationId?` | `string` | -| `error` | { `message`: `string` ; `statusCode?`: `number` ; `statusText?`: `string` } | -| `error.message` | `string` | -| `error.statusCode?` | `number` | -| `error.statusText?` | `string` | -| `messageId?` | `string` | +| Name | Type | +| :------------------ | :-------------------------------------------------------------------------- | +| `conversationId?` | `string` | +| `error` | { `message`: `string` ; `statusCode?`: `number` ; `statusText?`: `string` } | +| `error.message` | `string` | +| `error.statusCode?` | `number` | +| `error.statusText?` | `string` | +| `messageId?` | `string` | #### Defined in [src/types.ts:300](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L300) -___ +--- ### ChatResponse @@ -90,27 +90,27 @@ ___ #### Type declaration -| Name | Type | -| :------ | :------ | +| Name | Type | +| :--------------- | :------- | | `conversationId` | `string` | -| `messageId` | `string` | -| `response` | `string` | +| `messageId` | `string` | +| `response` | `string` | #### Defined in [src/types.ts:306](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L306) -___ +--- ### ContentType -Ƭ **ContentType**: ``"text"`` +Ƭ **ContentType**: `"text"` #### Defined in [src/types.ts:1](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L1) -___ +--- ### ConversationJSONBody @@ -120,19 +120,19 @@ https://chat.openapi.com/backend-api/conversation #### Type declaration -| Name | Type | Description | -| :------ | :------ | :------ | -| `action` | `string` | The action to take | -| `conversation_id?` | `string` | The ID of the conversation | -| `messages` | [`Prompt`](modules.md#prompt)[] | Prompts to provide | -| `model` | `string` | The model to use | -| `parent_message_id` | `string` | The parent message ID | +| Name | Type | Description | +| :------------------ | :------------------------------ | :------------------------- | +| `action` | `string` | The action to take | +| `conversation_id?` | `string` | The ID of the conversation | +| `messages` | [`Prompt`](modules.md#prompt)[] | Prompts to provide | +| `model` | `string` | The model to use | +| `parent_message_id` | `string` | The parent message ID | #### Defined in [src/types.ts:134](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L134) -___ +--- ### ConversationResponseEvent @@ -140,17 +140,17 @@ ___ #### Type declaration -| Name | Type | -| :------ | :------ | -| `conversation_id?` | `string` | -| `error?` | `string` \| ``null`` | -| `message?` | [`Message`](modules.md#message) | +| Name | Type | +| :----------------- | :------------------------------ | +| `conversation_id?` | `string` | +| `error?` | `string` \| `null` | +| `message?` | [`Message`](modules.md#message) | #### Defined in [src/types.ts:251](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L251) -___ +--- ### Message @@ -158,34 +158,34 @@ ___ #### Type declaration -| Name | Type | -| :------ | :------ | -| `content` | [`MessageContent`](modules.md#messagecontent) | -| `create_time` | `string` \| ``null`` | -| `end_turn` | ``null`` | -| `id` | `string` | -| `metadata` | [`MessageMetadata`](modules.md#messagemetadata) | -| `recipient` | `string` | -| `role` | `string` | -| `update_time` | `string` \| ``null`` | -| `user` | `string` \| ``null`` | -| `weight` | `number` | +| Name | Type | +| :------------ | :---------------------------------------------- | +| `content` | [`MessageContent`](modules.md#messagecontent) | +| `create_time` | `string` \| `null` | +| `end_turn` | `null` | +| `id` | `string` | +| `metadata` | [`MessageMetadata`](modules.md#messagemetadata) | +| `recipient` | `string` | +| `role` | `string` | +| `update_time` | `string` \| `null` | +| `user` | `string` \| `null` | +| `weight` | `number` | #### Defined in [src/types.ts:257](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L257) -___ +--- ### MessageActionType -Ƭ **MessageActionType**: ``"next"`` \| ``"variant"`` +Ƭ **MessageActionType**: `"next"` \| `"variant"` #### Defined in [src/types.ts:276](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L276) -___ +--- ### MessageContent @@ -193,16 +193,16 @@ ___ #### Type declaration -| Name | Type | -| :------ | :------ | -| `content_type` | `string` | -| `parts` | `string`[] | +| Name | Type | +| :------------- | :--------- | +| `content_type` | `string` | +| `parts` | `string`[] | #### Defined in [src/types.ts:270](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L270) -___ +--- ### MessageFeedbackJSONBody @@ -212,29 +212,29 @@ https://chat.openapi.com/backend-api/conversation/message_feedback #### Type declaration -| Name | Type | Description | -| :------ | :------ | :------ | -| `conversation_id` | `string` | The ID of the conversation | -| `message_id` | `string` | The message ID | -| `rating` | [`MessageFeedbackRating`](modules.md#messagefeedbackrating) | The rating | -| `tags?` | [`MessageFeedbackTags`](modules.md#messagefeedbacktags)[] | Tags to give the rating | -| `text?` | `string` | The text to include | +| Name | Type | Description | +| :---------------- | :---------------------------------------------------------- | :------------------------- | +| `conversation_id` | `string` | The ID of the conversation | +| `message_id` | `string` | The message ID | +| `rating` | [`MessageFeedbackRating`](modules.md#messagefeedbackrating) | The rating | +| `tags?` | [`MessageFeedbackTags`](modules.md#messagefeedbacktags)[] | Tags to give the rating | +| `text?` | `string` | The text to include | #### Defined in [src/types.ts:193](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L193) -___ +--- ### MessageFeedbackRating -Ƭ **MessageFeedbackRating**: ``"thumbsUp"`` \| ``"thumbsDown"`` +Ƭ **MessageFeedbackRating**: `"thumbsUp"` \| `"thumbsDown"` #### Defined in [src/types.ts:249](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L249) -___ +--- ### MessageFeedbackResult @@ -242,29 +242,29 @@ ___ #### Type declaration -| Name | Type | Description | -| :------ | :------ | :------ | -| `conversation_id` | `string` | The ID of the conversation | -| `message_id` | `string` | The message ID | -| `rating` | [`MessageFeedbackRating`](modules.md#messagefeedbackrating) | The rating | -| `text?` | `string` | The text the server received, including tags | -| `user_id` | `string` | The ID of the user | +| Name | Type | Description | +| :---------------- | :---------------------------------------------------------- | :------------------------------------------- | +| `conversation_id` | `string` | The ID of the conversation | +| `message_id` | `string` | The message ID | +| `rating` | [`MessageFeedbackRating`](modules.md#messagefeedbackrating) | The rating | +| `text?` | `string` | The text the server received, including tags | +| `user_id` | `string` | The ID of the user | #### Defined in [src/types.ts:222](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L222) -___ +--- ### MessageFeedbackTags -Ƭ **MessageFeedbackTags**: ``"harmful"`` \| ``"false"`` \| ``"not-helpful"`` +Ƭ **MessageFeedbackTags**: `"harmful"` \| `"false"` \| `"not-helpful"` #### Defined in [src/types.ts:220](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L220) -___ +--- ### MessageMetadata @@ -274,7 +274,7 @@ ___ [src/types.ts:275](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L275) -___ +--- ### Model @@ -282,17 +282,17 @@ ___ #### Type declaration -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :----------- | :-------- | :---------------------------------- | | `is_special` | `boolean` | Whether or not the model is special | -| `max_tokens` | `number` | Max tokens of the model | -| `slug` | `string` | Name of the model | +| `max_tokens` | `number` | Max tokens of the model | +| `slug` | `string` | Name of the model | #### Defined in [src/types.ts:77](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L77) -___ +--- ### ModelsResult @@ -302,15 +302,15 @@ https://chat.openapi.com/backend-api/models #### Type declaration -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :------- | :---------------------------- | :-------------- | | `models` | [`Model`](modules.md#model)[] | Array of models | #### Defined in [src/types.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L70) -___ +--- ### ModerationsJSONBody @@ -320,16 +320,16 @@ https://chat.openapi.com/backend-api/moderations #### Type declaration -| Name | Type | Description | -| :------ | :------ | :------ | -| `input` | `string` | Input for the moderation decision | -| `model` | [`AvailableModerationModels`](modules.md#availablemoderationmodels) | The model to use in the decision | +| Name | Type | Description | +| :------ | :------------------------------------------------------------------ | :-------------------------------- | +| `input` | `string` | Input for the moderation decision | +| `model` | [`AvailableModerationModels`](modules.md#availablemoderationmodels) | The model to use in the decision | #### Defined in [src/types.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L97) -___ +--- ### ModerationsJSONResult @@ -339,17 +339,17 @@ https://chat.openapi.com/backend-api/moderations #### Type declaration -| Name | Type | Description | -| :------ | :------ | :------ | -| `blocked` | `boolean` | Whether or not the input is blocked | -| `flagged` | `boolean` | Whether or not the input is flagged | -| `moderation_id` | `string` | The ID of the decision | +| Name | Type | Description | +| :-------------- | :-------- | :---------------------------------- | +| `blocked` | `boolean` | Whether or not the input is blocked | +| `flagged` | `boolean` | Whether or not the input is flagged | +| `moderation_id` | `string` | The ID of the decision | #### Defined in [src/types.ts:114](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L114) -___ +--- ### OpenAIAuth @@ -360,18 +360,18 @@ to authenticate with the unofficial ChatGPT API. #### Type declaration -| Name | Type | -| :------ | :------ | -| `clearanceToken` | `string` | -| `cookies?` | `Record`<`string`, `Protocol.Network.Cookie`\> | -| `sessionToken` | `string` | -| `userAgent` | `string` | +| Name | Type | +| :--------------- | :--------------------------------------------- | +| `clearanceToken` | `string` | +| `cookies?` | `Record`<`string`, `Protocol.Network.Cookie`\> | +| `sessionToken` | `string` | +| `userAgent` | `string` | #### Defined in [src/openai-auth.ts:27](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/openai-auth.ts#L27) -___ +--- ### Prompt @@ -379,17 +379,17 @@ ___ #### Type declaration -| Name | Type | Description | -| :------ | :------ | :------ | -| `content` | [`PromptContent`](modules.md#promptcontent) | The content of the prompt | -| `id` | `string` | The ID of the prompt | -| `role` | [`Role`](modules.md#role) | The role played in the prompt | +| Name | Type | Description | +| :-------- | :------------------------------------------ | :---------------------------- | +| `content` | [`PromptContent`](modules.md#promptcontent) | The content of the prompt | +| `id` | `string` | The ID of the prompt | +| `role` | [`Role`](modules.md#role) | The role played in the prompt | #### Defined in [src/types.ts:161](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L161) -___ +--- ### PromptContent @@ -397,36 +397,36 @@ ___ #### Type declaration -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :------------- | :-------------------------------------- | :----------------------------- | | `content_type` | [`ContentType`](modules.md#contenttype) | The content type of the prompt | -| `parts` | `string`[] | The parts to the prompt | +| `parts` | `string`[] | The parts to the prompt | #### Defined in [src/types.ts:178](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L178) -___ +--- ### Role -Ƭ **Role**: ``"user"`` \| ``"assistant"`` +Ƭ **Role**: `"user"` \| `"assistant"` #### Defined in [src/types.ts:3](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L3) -___ +--- ### SendConversationMessageOptions -Ƭ **SendConversationMessageOptions**: `Omit`<[`SendMessageOptions`](modules.md#sendmessageoptions), ``"conversationId"`` \| ``"parentMessageId"``\> +Ƭ **SendConversationMessageOptions**: `Omit`<[`SendMessageOptions`](modules.md#sendmessageoptions), `"conversationId"` \| `"parentMessageId"`\> #### Defined in [src/types.ts:288](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L288) -___ +--- ### SendMessageOptions @@ -434,21 +434,21 @@ ___ #### Type declaration -| Name | Type | -| :------ | :------ | -| `abortSignal?` | `AbortSignal` | -| `action?` | [`MessageActionType`](modules.md#messageactiontype) | -| `conversationId?` | `string` | -| `messageId?` | `string` | -| `onProgress?` | (`partialResponse`: [`ChatResponse`](modules.md#chatresponse)) => `void` | -| `parentMessageId?` | `string` | -| `timeoutMs?` | `number` | +| Name | Type | +| :----------------- | :----------------------------------------------------------------------- | +| `abortSignal?` | `AbortSignal` | +| `action?` | [`MessageActionType`](modules.md#messageactiontype) | +| `conversationId?` | `string` | +| `messageId?` | `string` | +| `onProgress?` | (`partialResponse`: [`ChatResponse`](modules.md#chatresponse)) => `void` | +| `parentMessageId?` | `string` | +| `timeoutMs?` | `number` | #### Defined in [src/types.ts:278](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L278) -___ +--- ### SessionResult @@ -458,18 +458,18 @@ https://chat.openapi.com/api/auth/session #### Type declaration -| Name | Type | Description | -| :------ | :------ | :------ | -| `accessToken` | `string` | The access token | -| `error?` | `string` \| ``null`` | If there was an error associated with this request | -| `expires` | `string` | ISO date of the expiration date of the access token | -| `user` | [`User`](modules.md#user) | Authenticated user | +| Name | Type | Description | +| :------------ | :------------------------ | :-------------------------------------------------- | +| `accessToken` | `string` | The access token | +| `error?` | `string` \| `null` | If there was an error associated with this request | +| `expires` | `string` | ISO date of the expiration date of the access token | +| `user` | [`User`](modules.md#user) | Authenticated user | #### Defined in [src/types.ts:8](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L8) -___ +--- ### User @@ -477,15 +477,15 @@ ___ #### Type declaration -| Name | Type | Description | -| :------ | :------ | :------ | -| `email?` | `string` | Email of the user | +| Name | Type | Description | +| :--------- | :--------- | :---------------------- | +| `email?` | `string` | Email of the user | | `features` | `string`[] | Features the user is in | -| `groups` | `string`[] | Groups the user is in | -| `id` | `string` | ID of the user | -| `image` | `string` | Image of the user | -| `name` | `string` | Name of the user | -| `picture` | `string` | Picture of the user | +| `groups` | `string`[] | Groups the user is in | +| `id` | `string` | ID of the user | +| `image` | `string` | Image of the user | +| `name` | `string` | Name of the user | +| `picture` | `string` | Picture of the user | #### Defined in @@ -503,12 +503,12 @@ included them in here. #### Parameters -| Name | Type | -| :------ | :------ | -| `url` | `string` | -| `accessToken` | `string` | -| `body` | [`ConversationJSONBody`](modules.md#conversationjsonbody) | -| `timeoutMs?` | `number` | +| Name | Type | +| :------------ | :-------------------------------------------------------- | +| `url` | `string` | +| `accessToken` | `string` | +| `body` | [`ConversationJSONBody`](modules.md#conversationjsonbody) | +| `timeoutMs?` | `number` | #### Returns @@ -518,7 +518,7 @@ included them in here. [src/utils.ts:73](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/utils.ts#L73) -___ +--- ### defaultChromeExecutablePath @@ -534,7 +534,7 @@ Gets the default path to chrome's executable for the current platform. [src/openai-auth.ts:362](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/openai-auth.ts#L362) -___ +--- ### getBrowser @@ -546,9 +546,9 @@ recognizes it and blocks access. #### Parameters -| Name | Type | -| :------ | :------ | -| `opts` | `PuppeteerLaunchOptions` & { `captchaToken?`: `string` ; `nopechaKey?`: `string` } | +| Name | Type | +| :----- | :--------------------------------------------------------------------------------- | +| `opts` | `PuppeteerLaunchOptions` & { `captchaToken?`: `string` ; `nopechaKey?`: `string` } | #### Returns @@ -558,7 +558,7 @@ recognizes it and blocks access. [src/openai-auth.ts:215](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/openai-auth.ts#L215) -___ +--- ### getOpenAIAuth @@ -580,19 +580,18 @@ with your updated credentials. #### Parameters -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.browser?` | `Browser` | -| `__namedParameters.captchaToken?` | `string` | -| `__namedParameters.email?` | `string` | -| `__namedParameters.executablePath?` | `string` | -| `__namedParameters.isGoogleLogin?` | `boolean` | -| `__namedParameters.isWindowsLogin?` | `boolean` | -| `__namedParameters.nopechaKey?` | `string` | -| `__namedParameters.page?` | `Page` | -| `__namedParameters.password?` | `string` | -| `__namedParameters.timeoutMs?` | `number` | +| Name | Type | +| :---------------------------------- | :-------- | +| `__namedParameters` | `Object` | +| `__namedParameters.browser?` | `Browser` | +| `__namedParameters.captchaToken?` | `string` | +| `__namedParameters.email?` | `string` | +| `__namedParameters.executablePath?` | `string` | +| `__namedParameters.isGoogleLogin?` | `boolean` | +| `__namedParameters.nopechaKey?` | `string` | +| `__namedParameters.page?` | `Page` | +| `__namedParameters.password?` | `string` | +| `__namedParameters.timeoutMs?` | `number` | #### Returns @@ -602,7 +601,7 @@ with your updated credentials. [src/openai-auth.ts:49](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/openai-auth.ts#L49) -___ +--- ### isRelevantRequest @@ -610,8 +609,8 @@ ___ #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :---- | :------- | | `url` | `string` | #### Returns @@ -622,7 +621,7 @@ ___ [src/utils.ts:39](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/utils.ts#L39) -___ +--- ### markdownToText @@ -630,8 +629,8 @@ ___ #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :---------- | :------- | | `markdown?` | `string` | #### Returns @@ -642,7 +641,7 @@ ___ [src/utils.ts:12](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/utils.ts#L12) -___ +--- ### maximizePage @@ -650,8 +649,8 @@ ___ #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :----- | :----- | | `page` | `Page` | #### Returns @@ -662,7 +661,7 @@ ___ [src/utils.ts:29](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/utils.ts#L29) -___ +--- ### minimizePage @@ -670,8 +669,8 @@ ___ #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :----- | :----- | | `page` | `Page` | #### Returns From 5fc507fbc6b27421facba0bd87857f188e4b3477 Mon Sep 17 00:00:00 2001 From: optionsx <52641788+optionsx@users.noreply.github.com> Date: Mon, 19 Dec 2022 03:12:55 +0300 Subject: [PATCH 6/6] Update modules.md --- legacy/docs/modules.md | 348 ++++++++++++++++++++--------------------- 1 file changed, 174 insertions(+), 174 deletions(-) diff --git a/legacy/docs/modules.md b/legacy/docs/modules.md index f04d7df2..c4b940f1 100644 --- a/legacy/docs/modules.md +++ b/legacy/docs/modules.md @@ -55,13 +55,13 @@ ### AvailableModerationModels -Ƭ **AvailableModerationModels**: `"text-moderation-playground"` +Ƭ **AvailableModerationModels**: ``"text-moderation-playground"`` #### Defined in [src/types.ts:109](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L109) ---- +___ ### ChatError @@ -69,20 +69,20 @@ #### Type declaration -| Name | Type | -| :------------------ | :-------------------------------------------------------------------------- | -| `conversationId?` | `string` | -| `error` | { `message`: `string` ; `statusCode?`: `number` ; `statusText?`: `string` } | -| `error.message` | `string` | -| `error.statusCode?` | `number` | -| `error.statusText?` | `string` | -| `messageId?` | `string` | +| Name | Type | +| :------ | :------ | +| `conversationId?` | `string` | +| `error` | { `message`: `string` ; `statusCode?`: `number` ; `statusText?`: `string` } | +| `error.message` | `string` | +| `error.statusCode?` | `number` | +| `error.statusText?` | `string` | +| `messageId?` | `string` | #### Defined in [src/types.ts:300](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L300) ---- +___ ### ChatResponse @@ -90,27 +90,27 @@ #### Type declaration -| Name | Type | -| :--------------- | :------- | +| Name | Type | +| :------ | :------ | | `conversationId` | `string` | -| `messageId` | `string` | -| `response` | `string` | +| `messageId` | `string` | +| `response` | `string` | #### Defined in [src/types.ts:306](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L306) ---- +___ ### ContentType -Ƭ **ContentType**: `"text"` +Ƭ **ContentType**: ``"text"`` #### Defined in [src/types.ts:1](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L1) ---- +___ ### ConversationJSONBody @@ -120,19 +120,19 @@ https://chat.openapi.com/backend-api/conversation #### Type declaration -| Name | Type | Description | -| :------------------ | :------------------------------ | :------------------------- | -| `action` | `string` | The action to take | -| `conversation_id?` | `string` | The ID of the conversation | -| `messages` | [`Prompt`](modules.md#prompt)[] | Prompts to provide | -| `model` | `string` | The model to use | -| `parent_message_id` | `string` | The parent message ID | +| Name | Type | Description | +| :------ | :------ | :------ | +| `action` | `string` | The action to take | +| `conversation_id?` | `string` | The ID of the conversation | +| `messages` | [`Prompt`](modules.md#prompt)[] | Prompts to provide | +| `model` | `string` | The model to use | +| `parent_message_id` | `string` | The parent message ID | #### Defined in [src/types.ts:134](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L134) ---- +___ ### ConversationResponseEvent @@ -140,17 +140,17 @@ https://chat.openapi.com/backend-api/conversation #### Type declaration -| Name | Type | -| :----------------- | :------------------------------ | -| `conversation_id?` | `string` | -| `error?` | `string` \| `null` | -| `message?` | [`Message`](modules.md#message) | +| Name | Type | +| :------ | :------ | +| `conversation_id?` | `string` | +| `error?` | `string` \| ``null`` | +| `message?` | [`Message`](modules.md#message) | #### Defined in [src/types.ts:251](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L251) ---- +___ ### Message @@ -158,34 +158,34 @@ https://chat.openapi.com/backend-api/conversation #### Type declaration -| Name | Type | -| :------------ | :---------------------------------------------- | -| `content` | [`MessageContent`](modules.md#messagecontent) | -| `create_time` | `string` \| `null` | -| `end_turn` | `null` | -| `id` | `string` | -| `metadata` | [`MessageMetadata`](modules.md#messagemetadata) | -| `recipient` | `string` | -| `role` | `string` | -| `update_time` | `string` \| `null` | -| `user` | `string` \| `null` | -| `weight` | `number` | +| Name | Type | +| :------ | :------ | +| `content` | [`MessageContent`](modules.md#messagecontent) | +| `create_time` | `string` \| ``null`` | +| `end_turn` | ``null`` | +| `id` | `string` | +| `metadata` | [`MessageMetadata`](modules.md#messagemetadata) | +| `recipient` | `string` | +| `role` | `string` | +| `update_time` | `string` \| ``null`` | +| `user` | `string` \| ``null`` | +| `weight` | `number` | #### Defined in [src/types.ts:257](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L257) ---- +___ ### MessageActionType -Ƭ **MessageActionType**: `"next"` \| `"variant"` +Ƭ **MessageActionType**: ``"next"`` \| ``"variant"`` #### Defined in [src/types.ts:276](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L276) ---- +___ ### MessageContent @@ -193,16 +193,16 @@ https://chat.openapi.com/backend-api/conversation #### Type declaration -| Name | Type | -| :------------- | :--------- | -| `content_type` | `string` | -| `parts` | `string`[] | +| Name | Type | +| :------ | :------ | +| `content_type` | `string` | +| `parts` | `string`[] | #### Defined in [src/types.ts:270](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L270) ---- +___ ### MessageFeedbackJSONBody @@ -212,29 +212,29 @@ https://chat.openapi.com/backend-api/conversation/message_feedback #### Type declaration -| Name | Type | Description | -| :---------------- | :---------------------------------------------------------- | :------------------------- | -| `conversation_id` | `string` | The ID of the conversation | -| `message_id` | `string` | The message ID | -| `rating` | [`MessageFeedbackRating`](modules.md#messagefeedbackrating) | The rating | -| `tags?` | [`MessageFeedbackTags`](modules.md#messagefeedbacktags)[] | Tags to give the rating | -| `text?` | `string` | The text to include | +| Name | Type | Description | +| :------ | :------ | :------ | +| `conversation_id` | `string` | The ID of the conversation | +| `message_id` | `string` | The message ID | +| `rating` | [`MessageFeedbackRating`](modules.md#messagefeedbackrating) | The rating | +| `tags?` | [`MessageFeedbackTags`](modules.md#messagefeedbacktags)[] | Tags to give the rating | +| `text?` | `string` | The text to include | #### Defined in [src/types.ts:193](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L193) ---- +___ ### MessageFeedbackRating -Ƭ **MessageFeedbackRating**: `"thumbsUp"` \| `"thumbsDown"` +Ƭ **MessageFeedbackRating**: ``"thumbsUp"`` \| ``"thumbsDown"`` #### Defined in [src/types.ts:249](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L249) ---- +___ ### MessageFeedbackResult @@ -242,29 +242,29 @@ https://chat.openapi.com/backend-api/conversation/message_feedback #### Type declaration -| Name | Type | Description | -| :---------------- | :---------------------------------------------------------- | :------------------------------------------- | -| `conversation_id` | `string` | The ID of the conversation | -| `message_id` | `string` | The message ID | -| `rating` | [`MessageFeedbackRating`](modules.md#messagefeedbackrating) | The rating | -| `text?` | `string` | The text the server received, including tags | -| `user_id` | `string` | The ID of the user | +| Name | Type | Description | +| :------ | :------ | :------ | +| `conversation_id` | `string` | The ID of the conversation | +| `message_id` | `string` | The message ID | +| `rating` | [`MessageFeedbackRating`](modules.md#messagefeedbackrating) | The rating | +| `text?` | `string` | The text the server received, including tags | +| `user_id` | `string` | The ID of the user | #### Defined in [src/types.ts:222](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L222) ---- +___ ### MessageFeedbackTags -Ƭ **MessageFeedbackTags**: `"harmful"` \| `"false"` \| `"not-helpful"` +Ƭ **MessageFeedbackTags**: ``"harmful"`` \| ``"false"`` \| ``"not-helpful"`` #### Defined in [src/types.ts:220](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L220) ---- +___ ### MessageMetadata @@ -274,7 +274,7 @@ https://chat.openapi.com/backend-api/conversation/message_feedback [src/types.ts:275](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L275) ---- +___ ### Model @@ -282,17 +282,17 @@ https://chat.openapi.com/backend-api/conversation/message_feedback #### Type declaration -| Name | Type | Description | -| :----------- | :-------- | :---------------------------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `is_special` | `boolean` | Whether or not the model is special | -| `max_tokens` | `number` | Max tokens of the model | -| `slug` | `string` | Name of the model | +| `max_tokens` | `number` | Max tokens of the model | +| `slug` | `string` | Name of the model | #### Defined in [src/types.ts:77](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L77) ---- +___ ### ModelsResult @@ -302,15 +302,15 @@ https://chat.openapi.com/backend-api/models #### Type declaration -| Name | Type | Description | -| :------- | :---------------------------- | :-------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `models` | [`Model`](modules.md#model)[] | Array of models | #### Defined in [src/types.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L70) ---- +___ ### ModerationsJSONBody @@ -320,16 +320,16 @@ https://chat.openapi.com/backend-api/moderations #### Type declaration -| Name | Type | Description | -| :------ | :------------------------------------------------------------------ | :-------------------------------- | -| `input` | `string` | Input for the moderation decision | -| `model` | [`AvailableModerationModels`](modules.md#availablemoderationmodels) | The model to use in the decision | +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `string` | Input for the moderation decision | +| `model` | [`AvailableModerationModels`](modules.md#availablemoderationmodels) | The model to use in the decision | #### Defined in [src/types.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L97) ---- +___ ### ModerationsJSONResult @@ -339,17 +339,17 @@ https://chat.openapi.com/backend-api/moderations #### Type declaration -| Name | Type | Description | -| :-------------- | :-------- | :---------------------------------- | -| `blocked` | `boolean` | Whether or not the input is blocked | -| `flagged` | `boolean` | Whether or not the input is flagged | -| `moderation_id` | `string` | The ID of the decision | +| Name | Type | Description | +| :------ | :------ | :------ | +| `blocked` | `boolean` | Whether or not the input is blocked | +| `flagged` | `boolean` | Whether or not the input is flagged | +| `moderation_id` | `string` | The ID of the decision | #### Defined in [src/types.ts:114](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L114) ---- +___ ### OpenAIAuth @@ -360,18 +360,18 @@ to authenticate with the unofficial ChatGPT API. #### Type declaration -| Name | Type | -| :--------------- | :--------------------------------------------- | -| `clearanceToken` | `string` | -| `cookies?` | `Record`<`string`, `Protocol.Network.Cookie`\> | -| `sessionToken` | `string` | -| `userAgent` | `string` | +| Name | Type | +| :------ | :------ | +| `clearanceToken` | `string` | +| `cookies?` | `Record`<`string`, `Protocol.Network.Cookie`\> | +| `sessionToken` | `string` | +| `userAgent` | `string` | #### Defined in [src/openai-auth.ts:27](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/openai-auth.ts#L27) ---- +___ ### Prompt @@ -379,17 +379,17 @@ to authenticate with the unofficial ChatGPT API. #### Type declaration -| Name | Type | Description | -| :-------- | :------------------------------------------ | :---------------------------- | -| `content` | [`PromptContent`](modules.md#promptcontent) | The content of the prompt | -| `id` | `string` | The ID of the prompt | -| `role` | [`Role`](modules.md#role) | The role played in the prompt | +| Name | Type | Description | +| :------ | :------ | :------ | +| `content` | [`PromptContent`](modules.md#promptcontent) | The content of the prompt | +| `id` | `string` | The ID of the prompt | +| `role` | [`Role`](modules.md#role) | The role played in the prompt | #### Defined in [src/types.ts:161](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L161) ---- +___ ### PromptContent @@ -397,36 +397,36 @@ to authenticate with the unofficial ChatGPT API. #### Type declaration -| Name | Type | Description | -| :------------- | :-------------------------------------- | :----------------------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `content_type` | [`ContentType`](modules.md#contenttype) | The content type of the prompt | -| `parts` | `string`[] | The parts to the prompt | +| `parts` | `string`[] | The parts to the prompt | #### Defined in [src/types.ts:178](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L178) ---- +___ ### Role -Ƭ **Role**: `"user"` \| `"assistant"` +Ƭ **Role**: ``"user"`` \| ``"assistant"`` #### Defined in [src/types.ts:3](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L3) ---- +___ ### SendConversationMessageOptions -Ƭ **SendConversationMessageOptions**: `Omit`<[`SendMessageOptions`](modules.md#sendmessageoptions), `"conversationId"` \| `"parentMessageId"`\> +Ƭ **SendConversationMessageOptions**: `Omit`<[`SendMessageOptions`](modules.md#sendmessageoptions), ``"conversationId"`` \| ``"parentMessageId"``\> #### Defined in [src/types.ts:288](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L288) ---- +___ ### SendMessageOptions @@ -434,21 +434,21 @@ to authenticate with the unofficial ChatGPT API. #### Type declaration -| Name | Type | -| :----------------- | :----------------------------------------------------------------------- | -| `abortSignal?` | `AbortSignal` | -| `action?` | [`MessageActionType`](modules.md#messageactiontype) | -| `conversationId?` | `string` | -| `messageId?` | `string` | -| `onProgress?` | (`partialResponse`: [`ChatResponse`](modules.md#chatresponse)) => `void` | -| `parentMessageId?` | `string` | -| `timeoutMs?` | `number` | +| Name | Type | +| :------ | :------ | +| `abortSignal?` | `AbortSignal` | +| `action?` | [`MessageActionType`](modules.md#messageactiontype) | +| `conversationId?` | `string` | +| `messageId?` | `string` | +| `onProgress?` | (`partialResponse`: [`ChatResponse`](modules.md#chatresponse)) => `void` | +| `parentMessageId?` | `string` | +| `timeoutMs?` | `number` | #### Defined in [src/types.ts:278](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L278) ---- +___ ### SessionResult @@ -458,18 +458,18 @@ https://chat.openapi.com/api/auth/session #### Type declaration -| Name | Type | Description | -| :------------ | :------------------------ | :-------------------------------------------------- | -| `accessToken` | `string` | The access token | -| `error?` | `string` \| `null` | If there was an error associated with this request | -| `expires` | `string` | ISO date of the expiration date of the access token | -| `user` | [`User`](modules.md#user) | Authenticated user | +| Name | Type | Description | +| :------ | :------ | :------ | +| `accessToken` | `string` | The access token | +| `error?` | `string` \| ``null`` | If there was an error associated with this request | +| `expires` | `string` | ISO date of the expiration date of the access token | +| `user` | [`User`](modules.md#user) | Authenticated user | #### Defined in [src/types.ts:8](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/types.ts#L8) ---- +___ ### User @@ -477,15 +477,15 @@ https://chat.openapi.com/api/auth/session #### Type declaration -| Name | Type | Description | -| :--------- | :--------- | :---------------------- | -| `email?` | `string` | Email of the user | +| Name | Type | Description | +| :------ | :------ | :------ | +| `email?` | `string` | Email of the user | | `features` | `string`[] | Features the user is in | -| `groups` | `string`[] | Groups the user is in | -| `id` | `string` | ID of the user | -| `image` | `string` | Image of the user | -| `name` | `string` | Name of the user | -| `picture` | `string` | Picture of the user | +| `groups` | `string`[] | Groups the user is in | +| `id` | `string` | ID of the user | +| `image` | `string` | Image of the user | +| `name` | `string` | Name of the user | +| `picture` | `string` | Picture of the user | #### Defined in @@ -503,12 +503,12 @@ included them in here. #### Parameters -| Name | Type | -| :------------ | :-------------------------------------------------------- | -| `url` | `string` | -| `accessToken` | `string` | -| `body` | [`ConversationJSONBody`](modules.md#conversationjsonbody) | -| `timeoutMs?` | `number` | +| Name | Type | +| :------ | :------ | +| `url` | `string` | +| `accessToken` | `string` | +| `body` | [`ConversationJSONBody`](modules.md#conversationjsonbody) | +| `timeoutMs?` | `number` | #### Returns @@ -518,7 +518,7 @@ included them in here. [src/utils.ts:73](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/utils.ts#L73) ---- +___ ### defaultChromeExecutablePath @@ -534,7 +534,7 @@ Gets the default path to chrome's executable for the current platform. [src/openai-auth.ts:362](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/openai-auth.ts#L362) ---- +___ ### getBrowser @@ -546,9 +546,9 @@ recognizes it and blocks access. #### Parameters -| Name | Type | -| :----- | :--------------------------------------------------------------------------------- | -| `opts` | `PuppeteerLaunchOptions` & { `captchaToken?`: `string` ; `nopechaKey?`: `string` } | +| Name | Type | +| :------ | :------ | +| `opts` | `PuppeteerLaunchOptions` & { `captchaToken?`: `string` ; `nopechaKey?`: `string` } | #### Returns @@ -558,7 +558,7 @@ recognizes it and blocks access. [src/openai-auth.ts:215](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/openai-auth.ts#L215) ---- +___ ### getOpenAIAuth @@ -580,18 +580,18 @@ with your updated credentials. #### Parameters -| Name | Type | -| :---------------------------------- | :-------- | -| `__namedParameters` | `Object` | -| `__namedParameters.browser?` | `Browser` | -| `__namedParameters.captchaToken?` | `string` | -| `__namedParameters.email?` | `string` | -| `__namedParameters.executablePath?` | `string` | -| `__namedParameters.isGoogleLogin?` | `boolean` | -| `__namedParameters.nopechaKey?` | `string` | -| `__namedParameters.page?` | `Page` | -| `__namedParameters.password?` | `string` | -| `__namedParameters.timeoutMs?` | `number` | +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `Object` | +| `__namedParameters.browser?` | `Browser` | +| `__namedParameters.captchaToken?` | `string` | +| `__namedParameters.email?` | `string` | +| `__namedParameters.executablePath?` | `string` | +| `__namedParameters.isGoogleLogin?` | `boolean` | +| `__namedParameters.nopechaKey?` | `string` | +| `__namedParameters.page?` | `Page` | +| `__namedParameters.password?` | `string` | +| `__namedParameters.timeoutMs?` | `number` | #### Returns @@ -601,7 +601,7 @@ with your updated credentials. [src/openai-auth.ts:49](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/openai-auth.ts#L49) ---- +___ ### isRelevantRequest @@ -609,8 +609,8 @@ with your updated credentials. #### Parameters -| Name | Type | -| :---- | :------- | +| Name | Type | +| :------ | :------ | | `url` | `string` | #### Returns @@ -621,7 +621,7 @@ with your updated credentials. [src/utils.ts:39](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/utils.ts#L39) ---- +___ ### markdownToText @@ -629,8 +629,8 @@ with your updated credentials. #### Parameters -| Name | Type | -| :---------- | :------- | +| Name | Type | +| :------ | :------ | | `markdown?` | `string` | #### Returns @@ -641,7 +641,7 @@ with your updated credentials. [src/utils.ts:12](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/utils.ts#L12) ---- +___ ### maximizePage @@ -649,8 +649,8 @@ with your updated credentials. #### Parameters -| Name | Type | -| :----- | :----- | +| Name | Type | +| :------ | :------ | | `page` | `Page` | #### Returns @@ -661,7 +661,7 @@ with your updated credentials. [src/utils.ts:29](https://github.com/transitive-bullshit/chatgpt-api/blob/d87ae67/src/utils.ts#L29) ---- +___ ### minimizePage @@ -669,8 +669,8 @@ with your updated credentials. #### Parameters -| Name | Type | -| :----- | :----- | +| Name | Type | +| :------ | :------ | | `page` | `Page` | #### Returns