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 7, 2022
1 parent 92318f1 commit f723ae5
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 61 deletions.
36 changes: 30 additions & 6 deletions docs/classes/ChatGPTAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Creates a new client wrapper around the unofficial ChatGPT REST API.
| Name | Type | Description |
| :------ | :------ | :------ |
| `opts` | `Object` | - |
| `opts.accessTokenTTL?` | `number` | **`Default Value`** 60000 (60 seconds) |
| `opts.apiBaseUrl?` | `string` | **`Default Value`** `'https://chat.openai.com/api'` * |
| `opts.backendApiBaseUrl?` | `string` | **`Default Value`** `'https://chat.openai.com/backend-api'` * |
| `opts.markdown?` | `boolean` | **`Default Value`** `true` * |
Expand All @@ -37,21 +38,24 @@ Creates a new client wrapper around the unofficial ChatGPT REST API.

#### Defined in

[chatgpt-api.ts:32](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/chatgpt-api.ts#L32)
[chatgpt-api.ts:35](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/chatgpt-api.ts#L35)

## Methods

### ensureAuth

**ensureAuth**(): `Promise`<`string`\>

Refreshes the client's access token which will succeed only if the session
is still valid.

#### Returns

`Promise`<`string`\>

#### Defined in

[chatgpt-api.ts:75](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/chatgpt-api.ts#L75)
[chatgpt-api.ts:221](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/chatgpt-api.ts#L221)

___

Expand All @@ -78,7 +82,7 @@ The new conversation instance

#### Defined in

[chatgpt-api.ts:233](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/chatgpt-api.ts#L233)
[chatgpt-api.ts:285](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/chatgpt-api.ts#L285)

___

Expand All @@ -90,23 +94,38 @@ ___

`Promise`<`boolean`\>

`true` if the client has a valid acces token or `false` if refreshing
the token fails.

#### Defined in

[chatgpt-api.ts:66](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/chatgpt-api.ts#L66)
[chatgpt-api.ts:208](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/chatgpt-api.ts#L208)

___

### refreshAccessToken

**refreshAccessToken**(): `Promise`<`string`\>

Attempts to refresh the current access token using the ChatGPT
`sessionToken` cookie.

Access tokens will be cached for up to `accessTokenTTL` milliseconds to
prevent refreshing access tokens too frequently.

**`Throws`**

An error if refreshing the access token fails.

#### Returns

`Promise`<`string`\>

A valid access token

#### Defined in

[chatgpt-api.ts:183](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/chatgpt-api.ts#L183)
[chatgpt-api.ts:235](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/chatgpt-api.ts#L235)

___

Expand All @@ -117,6 +136,11 @@ ___
Sends a message to ChatGPT, waits for the response to resolve, and returns
the response.

If you want to receive a stream of partial responses, use `opts.onProgress`.
If you want to receive the full response, including message and conversation IDs,
you can use `opts.onConversationResponse` or use the `ChatGPTAPI.getConversation`
helper.

#### Parameters

| Name | Type | Description |
Expand All @@ -132,4 +156,4 @@ The response from ChatGPT

#### Defined in

[chatgpt-api.ts:92](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/chatgpt-api.ts#L92)
[chatgpt-api.ts:94](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/chatgpt-api.ts#L94)
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

[chatgpt-conversation.ts:21](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/chatgpt-conversation.ts#L21)
[chatgpt-conversation.ts:21](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/chatgpt-conversation.ts#L21)

## Properties

Expand All @@ -51,7 +51,7 @@ Creates a new conversation wrapper around the ChatGPT API.

#### Defined in

[chatgpt-conversation.ts:10](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/chatgpt-conversation.ts#L10)
[chatgpt-conversation.ts:10](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/chatgpt-conversation.ts#L10)

___

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

#### Defined in

[chatgpt-conversation.ts:11](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/chatgpt-conversation.ts#L11)
[chatgpt-conversation.ts:11](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/chatgpt-conversation.ts#L11)

___

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

#### Defined in

[chatgpt-conversation.ts:12](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/chatgpt-conversation.ts#L12)
[chatgpt-conversation.ts:12](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/chatgpt-conversation.ts#L12)

## Methods

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

#### Defined in

[chatgpt-conversation.ts:48](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/chatgpt-conversation.ts#L48)
[chatgpt-conversation.ts:48](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/chatgpt-conversation.ts#L48)
47 changes: 24 additions & 23 deletions docs/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

#### Defined in

[types.ts:109](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L109)
[types.ts:109](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L109)

___

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

#### Defined in

[types.ts:1](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L1)
[types.ts:1](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L1)

___

Expand All @@ -78,7 +78,7 @@ https://chat.openapi.com/backend-api/conversation

#### Defined in

[types.ts:134](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L134)
[types.ts:134](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L134)

___

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

#### Defined in

[types.ts:251](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L251)
[types.ts:251](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L251)

___

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

#### Defined in

[types.ts:257](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L257)
[types.ts:257](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L257)

___

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

#### Defined in

[types.ts:270](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L270)
[types.ts:270](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L270)

___

Expand All @@ -160,7 +160,7 @@ https://chat.openapi.com/backend-api/conversation/message_feedback

#### Defined in

[types.ts:193](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L193)
[types.ts:193](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L193)

___

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

#### Defined in

[types.ts:249](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L249)
[types.ts:249](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L249)

___

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

#### Defined in

[types.ts:222](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L222)
[types.ts:222](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L222)

___

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

#### Defined in

[types.ts:220](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L220)
[types.ts:220](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L220)

___

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

#### Defined in

[types.ts:275](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L275)
[types.ts:275](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L275)

___

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

#### Defined in

[types.ts:77](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L77)
[types.ts:77](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L77)

___

Expand All @@ -246,7 +246,7 @@ https://chat.openapi.com/backend-api/models

#### Defined in

[types.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L70)
[types.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L70)

___

Expand All @@ -265,7 +265,7 @@ https://chat.openapi.com/backend-api/moderations

#### Defined in

[types.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L97)
[types.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L97)

___

Expand All @@ -285,7 +285,7 @@ https://chat.openapi.com/backend-api/moderations

#### Defined in

[types.ts:114](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L114)
[types.ts:114](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L114)

___

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

#### Defined in

[types.ts:161](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L161)
[types.ts:161](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L161)

___

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

#### Defined in

[types.ts:178](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L178)
[types.ts:178](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L178)

___

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

#### Defined in

[types.ts:3](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L3)
[types.ts:3](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L3)

___

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

#### Defined in

[types.ts:285](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L285)
[types.ts:286](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L286)

___

Expand All @@ -357,10 +357,11 @@ ___
| `onConversationResponse?` | (`response`: [`ConversationResponseEvent`](modules.md#conversationresponseevent)) => `void` |
| `onProgress?` | (`partialResponse`: `string`) => `void` |
| `parentMessageId?` | `string` |
| `timeoutMs?` | `number` |

#### Defined in

[types.ts:277](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L277)
[types.ts:277](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L277)

___

Expand All @@ -381,7 +382,7 @@ https://chat.openapi.com/api/auth/session

#### Defined in

[types.ts:8](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L8)
[types.ts:8](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L8)

___

Expand All @@ -403,7 +404,7 @@ ___

#### Defined in

[types.ts:30](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/types.ts#L30)
[types.ts:30](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/types.ts#L30)

## Functions

Expand All @@ -423,4 +424,4 @@ ___

#### Defined in

[utils.ts:4](https://github.com/transitive-bullshit/chatgpt-api/blob/8e045b2/src/utils.ts#L4)
[utils.ts:4](https://github.com/transitive-bullshit/chatgpt-api/blob/042b2fe/src/utils.ts#L4)
Loading

0 comments on commit f723ae5

Please sign in to comment.