Skip to content

Commit

Permalink
chore: update ts docs
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Mar 2, 2023
1 parent 48cb944 commit c87f9c7
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 92 deletions.
25 changes: 7 additions & 18 deletions docs/classes/ChatGPTAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,13 @@ Creates a new client wrapper around OpenAI's chat completion API, mimicing the o

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `opts` | `Object` | - |
| `opts.apiBaseUrl?` | `string` | **`Default Value`** `'https://api.openai.com'` * |
| `opts.apiKey` | `string` | - |
| `opts.completionParams?` | `Partial`<`Omit`<[`CreateChatCompletionRequest`](../interfaces/openai.CreateChatCompletionRequest.md), ``"messages"`` \| ``"n"``\>\> | - |
| `opts.debug?` | `boolean` | **`Default Value`** `false` * |
| `opts.fetch?` | (`input`: `RequestInfo` \| `URL`, `init?`: `RequestInit`) => `Promise`<`Response`\> | - |
| `opts.getMessageById?` | [`GetMessageByIdFunction`](../modules.md#getmessagebyidfunction) | - |
| `opts.maxModelTokens?` | `number` | **`Default Value`** `4096` * |
| `opts.maxResponseTokens?` | `number` | **`Default Value`** `1000` * |
| `opts.messageStore?` | `Keyv`<`any`, `Record`<`string`, `unknown`\>\> | - |
| `opts.systemMessage?` | `string` | - |
| `opts.upsertMessage?` | [`UpsertMessageFunction`](../modules.md#upsertmessagefunction) | - |
| Name | Type |
| :------ | :------ |
| `opts` | [`ChatGPTAPIOptions`](../modules.md#chatgptapioptions) |

#### Defined in

[src/chatgpt-api.ts:49](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/chatgpt-api.ts#L49)
[src/chatgpt-api.ts:49](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/chatgpt-api.ts#L49)

## Accessors

Expand All @@ -57,7 +46,7 @@ Creates a new client wrapper around OpenAI's chat completion API, mimicing the o

#### Defined in

[src/chatgpt-api.ts:336](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/chatgpt-api.ts#L336)
[src/chatgpt-api.ts:310](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/chatgpt-api.ts#L310)

`set` **apiKey**(`apiKey`): `void`

Expand All @@ -73,7 +62,7 @@ Creates a new client wrapper around OpenAI's chat completion API, mimicing the o

#### Defined in

[src/chatgpt-api.ts:340](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/chatgpt-api.ts#L340)
[src/chatgpt-api.ts:314](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/chatgpt-api.ts#L314)

## Methods

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

#### Defined in

[src/chatgpt-api.ts:157](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/chatgpt-api.ts#L157)
[src/chatgpt-api.ts:131](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/chatgpt-api.ts#L131)
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/typescript@4.9.5/node_modules/typescript/lib/lib.es2022.error

#### Defined in

[src/types.ts:47](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L47)
[src/types.ts:77](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L77)

___

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

#### Defined in

[src/types.ts:46](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L46)
[src/types.ts:76](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L76)

___

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

#### Defined in

[src/types.ts:44](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L44)
[src/types.ts:74](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L74)

___

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

#### Defined in

[src/types.ts:45](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L45)
[src/types.ts:75](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L75)
8 changes: 4 additions & 4 deletions docs/classes/ChatGPTUnofficialProxyAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#### Defined in

[src/chatgpt-unofficial-proxy-api.ts:20](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/chatgpt-unofficial-proxy-api.ts#L20)
[src/chatgpt-unofficial-proxy-api.ts:20](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/chatgpt-unofficial-proxy-api.ts#L20)

## Accessors

Expand All @@ -50,7 +50,7 @@

#### Defined in

[src/chatgpt-unofficial-proxy-api.ts:66](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/chatgpt-unofficial-proxy-api.ts#L66)
[src/chatgpt-unofficial-proxy-api.ts:66](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/chatgpt-unofficial-proxy-api.ts#L66)

`set` **accessToken**(`value`): `void`

Expand All @@ -66,7 +66,7 @@

#### Defined in

[src/chatgpt-unofficial-proxy-api.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/chatgpt-unofficial-proxy-api.ts#L70)
[src/chatgpt-unofficial-proxy-api.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/chatgpt-unofficial-proxy-api.ts#L70)

## Methods

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

#### Defined in

[src/chatgpt-unofficial-proxy-api.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/chatgpt-unofficial-proxy-api.ts#L97)
[src/chatgpt-unofficial-proxy-api.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/chatgpt-unofficial-proxy-api.ts#L97)
16 changes: 8 additions & 8 deletions docs/interfaces/ChatMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#### Defined in

[src/types.ts:40](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L40)
[src/types.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L70)

___

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

#### Defined in

[src/types.ts:34](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L34)
[src/types.ts:64](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L64)

___

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

#### Defined in

[src/types.ts:35](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L35)
[src/types.ts:65](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L65)

___

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

#### Defined in

[src/types.ts:30](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L30)
[src/types.ts:60](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L60)

___

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

#### Defined in

[src/types.ts:33](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L33)
[src/types.ts:63](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L63)

___

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

#### Defined in

[src/types.ts:38](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L38)
[src/types.ts:68](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L68)

___

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

#### Defined in

[src/types.ts:32](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L32)
[src/types.ts:62](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L62)

___

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

#### Defined in

[src/types.ts:31](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L31)
[src/types.ts:61](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L61)
6 changes: 3 additions & 3 deletions docs/interfaces/openai.ChatCompletionRequestMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ChatCompletionRequestMessage

#### Defined in

[src/types.ts:178](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L178)
[src/types.ts:208](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L208)

___

Expand All @@ -48,7 +48,7 @@ ChatCompletionRequestMessage

#### Defined in

[src/types.ts:184](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L184)
[src/types.ts:214](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L214)

___

Expand All @@ -64,4 +64,4 @@ ChatCompletionRequestMessage

#### Defined in

[src/types.ts:172](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L172)
[src/types.ts:202](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L202)
4 changes: 2 additions & 2 deletions docs/interfaces/openai.ChatCompletionResponseMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ChatCompletionResponseMessage

#### Defined in

[src/types.ts:210](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L210)
[src/types.ts:240](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L240)

___

Expand All @@ -47,4 +47,4 @@ ChatCompletionResponseMessage

#### Defined in

[src/types.ts:204](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L204)
[src/types.ts:234](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L234)
10 changes: 5 additions & 5 deletions docs/interfaces/openai.CreateChatCompletionDeltaResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#### Defined in

[src/types.ts:149](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L149)
[src/types.ts:179](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L179)

___

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

#### Defined in

[src/types.ts:147](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L147)
[src/types.ts:177](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L177)

___

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

#### Defined in

[src/types.ts:145](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L145)
[src/types.ts:175](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L175)

___

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

#### Defined in

[src/types.ts:148](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L148)
[src/types.ts:178](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L178)

___

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

#### Defined in

[src/types.ts:146](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L146)
[src/types.ts:176](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L176)
24 changes: 12 additions & 12 deletions docs/interfaces/openai.CreateChatCompletionRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CreateChatCompletionRequest

#### Defined in

[src/types.ts:284](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L284)
[src/types.ts:314](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L314)

___

Expand All @@ -57,7 +57,7 @@ CreateChatCompletionRequest

#### Defined in

[src/types.ts:290](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L290)
[src/types.ts:320](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L320)

___

Expand All @@ -73,7 +73,7 @@ CreateChatCompletionRequest

#### Defined in

[src/types.ts:272](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L272)
[src/types.ts:302](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L302)

___

Expand All @@ -89,7 +89,7 @@ CreateChatCompletionRequest

#### Defined in

[src/types.ts:236](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L236)
[src/types.ts:266](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L266)

___

Expand All @@ -105,7 +105,7 @@ CreateChatCompletionRequest

#### Defined in

[src/types.ts:230](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L230)
[src/types.ts:260](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L260)

___

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

#### Defined in

[src/types.ts:254](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L254)
[src/types.ts:284](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L284)

___

Expand All @@ -137,7 +137,7 @@ CreateChatCompletionRequest

#### Defined in

[src/types.ts:278](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L278)
[src/types.ts:308](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L308)

___

Expand All @@ -151,7 +151,7 @@ CreateChatCompletionRequest

#### Defined in

[src/types.ts:266](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L266)
[src/types.ts:296](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L296)

___

Expand All @@ -167,7 +167,7 @@ CreateChatCompletionRequest

#### Defined in

[src/types.ts:260](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L260)
[src/types.ts:290](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L290)

___

Expand All @@ -183,7 +183,7 @@ CreateChatCompletionRequest

#### Defined in

[src/types.ts:242](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L242)
[src/types.ts:272](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L272)

___

Expand All @@ -199,7 +199,7 @@ CreateChatCompletionRequest

#### Defined in

[src/types.ts:248](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L248)
[src/types.ts:278](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L278)

___

Expand All @@ -215,4 +215,4 @@ CreateChatCompletionRequest

#### Defined in

[src/types.ts:296](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L296)
[src/types.ts:326](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L326)

0 comments on commit c87f9c7

Please sign in to comment.