Skip to content

Commit

Permalink
chore: update auto-generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Dec 12, 2022
1 parent 1d621d0 commit efadd9e
Show file tree
Hide file tree
Showing 5 changed files with 273 additions and 92 deletions.
78 changes: 67 additions & 11 deletions docs/classes/ChatGPTAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

### Accessors

- [clearanceToken](ChatGPTAPI.md#clearancetoken)
- [sessionToken](ChatGPTAPI.md#sessiontoken)
- [user](ChatGPTAPI.md#user)
- [userAgent](ChatGPTAPI.md#useragent)

### Methods

Expand All @@ -28,26 +31,63 @@

Creates a new client wrapper around the unofficial ChatGPT REST API.

Note that your IP address and `userAgent` must match the same values that you used
to obtain your `clearanceToken`.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `opts` | `Object` | - |
| `opts.accessToken?` | `string` | - |
| `opts.accessTokenTTL?` | `number` | **`Default Value`** 60000 (60 seconds) |
| `opts.accessToken?` | `string` | **`Default Value`** `undefined` * |
| `opts.accessTokenTTL?` | `number` | **`Default Value`** 1 hour * |
| `opts.apiBaseUrl?` | `string` | **`Default Value`** `'https://chat.openai.com/api'` * |
| `opts.backendApiBaseUrl?` | `string` | **`Default Value`** `'https://chat.openai.com/backend-api'` * |
| `opts.clearanceToken` | `string` | - |
| `opts.clearanceToken` | `string` | = **Required** Cloudflare `cf_clearance` cookie value (see readme for instructions) |
| `opts.debug?` | `boolean` | **`Default Value`** `false` * |
| `opts.headers?` | `Record`<`string`, `string`\> | **`Default Value`** `undefined` * |
| `opts.markdown?` | `boolean` | **`Default Value`** `true` * |
| `opts.sessionToken` | `string` | = **Required** OpenAI session token which can be found in a valid session's cookies (see readme for instructions) |
| `opts.userAgent?` | `string` | **`Default Value`** `'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'` * |
| `opts.userAgent?` | `string` | **`Default Value`** `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36'` * |

#### Defined in

[src/chatgpt-api.ts:39](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/chatgpt-api.ts#L39)
[src/chatgpt-api.ts:45](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-api.ts#L45)

## Accessors

### clearanceToken

`get` **clearanceToken**(): `string`

Gets the current Cloudflare clearance token (`cf_clearance` cookie value).

#### Returns

`string`

#### Defined in

[src/chatgpt-api.ts:136](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-api.ts#L136)

___

### sessionToken

`get` **sessionToken**(): `string`

Gets the current session token.

#### Returns

`string`

#### Defined in

[src/chatgpt-api.ts:131](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-api.ts#L131)

___

### user

`get` **user**(): [`User`](../modules.md#user)
Expand All @@ -60,7 +100,23 @@ Gets the currently signed-in user, if authenticated, `null` otherwise.

#### Defined in

[src/chatgpt-api.ts:98](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/chatgpt-api.ts#L98)
[src/chatgpt-api.ts:126](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-api.ts#L126)

___

### userAgent

`get` **userAgent**(): `string`

Gets the current user agent.

#### Returns

`string`

#### Defined in

[src/chatgpt-api.ts:141](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-api.ts#L141)

## Methods

Expand All @@ -77,7 +133,7 @@ is still valid.

#### Defined in

[src/chatgpt-api.ts:250](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/chatgpt-api.ts#L250)
[src/chatgpt-api.ts:319](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-api.ts#L319)

___

Expand All @@ -104,7 +160,7 @@ The new conversation instance

#### Defined in

[src/chatgpt-api.ts:344](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/chatgpt-api.ts#L344)
[src/chatgpt-api.ts:425](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-api.ts#L425)

___

Expand All @@ -121,7 +177,7 @@ the token fails.

#### Defined in

[src/chatgpt-api.ts:237](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/chatgpt-api.ts#L237)
[src/chatgpt-api.ts:306](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-api.ts#L306)

___

Expand All @@ -147,7 +203,7 @@ A valid access token

#### Defined in

[src/chatgpt-api.ts:264](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/chatgpt-api.ts#L264)
[src/chatgpt-api.ts:333](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-api.ts#L333)

___

Expand Down Expand Up @@ -178,4 +234,4 @@ The response from ChatGPT

#### Defined in

[src/chatgpt-api.ts:121](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/chatgpt-api.ts#L121)
[src/chatgpt-api.ts:166](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-api.ts#L166)
10 changes: 5 additions & 5 deletions docs/classes/ChatGPTConversation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/8e1cde4/src/chatgpt-conversation.ts#L21)
[src/chatgpt-conversation.ts:21](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-conversation.ts#L21)

## Properties

Expand All @@ -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/8e1cde4/src/chatgpt-conversation.ts#L10)
[src/chatgpt-conversation.ts:10](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-conversation.ts#L10)

___

Expand All @@ -61,7 +61,7 @@ ___

#### Defined in

[src/chatgpt-conversation.ts:11](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/chatgpt-conversation.ts#L11)
[src/chatgpt-conversation.ts:11](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-conversation.ts#L11)

___

Expand All @@ -71,7 +71,7 @@ ___

#### Defined in

[src/chatgpt-conversation.ts:12](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/chatgpt-conversation.ts#L12)
[src/chatgpt-conversation.ts:12](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-conversation.ts#L12)

## Methods

Expand Down Expand Up @@ -104,4 +104,4 @@ The response from ChatGPT

#### Defined in

[src/chatgpt-conversation.ts:48](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/chatgpt-conversation.ts#L48)
[src/chatgpt-conversation.ts:48](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/chatgpt-conversation.ts#L48)
8 changes: 4 additions & 4 deletions docs/classes/ChatGPTError.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2022.error

#### Defined in

[src/types.ts:295](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/types.ts#L295)
[src/types.ts:298](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/types.ts#L298)

___

Expand All @@ -76,7 +76,7 @@ ___

#### Defined in

[src/types.ts:294](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/types.ts#L294)
[src/types.ts:297](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/types.ts#L297)

___

Expand All @@ -86,7 +86,7 @@ ___

#### Defined in

[src/types.ts:292](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/types.ts#L292)
[src/types.ts:295](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/types.ts#L295)

___

Expand All @@ -96,4 +96,4 @@ ___

#### Defined in

[src/types.ts:293](https://github.com/transitive-bullshit/chatgpt-api/blob/8e1cde4/src/types.ts#L293)
[src/types.ts:296](https://github.com/transitive-bullshit/chatgpt-api/blob/1d621d0/src/types.ts#L296)
Loading

0 comments on commit efadd9e

Please sign in to comment.