kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
chore: update ts docs
rodzic
48cb94473d
commit
c87f9c7c8e
|
@ -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
|
||||
|
||||
|
@ -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`
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -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`
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
||||
___
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -33,7 +33,7 @@ CreateChatCompletionResponse
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:339](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L339)
|
||||
[src/types.ts:369](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L369)
|
||||
|
||||
___
|
||||
|
||||
|
@ -47,7 +47,7 @@ CreateChatCompletionResponse
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:327](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L327)
|
||||
[src/types.ts:357](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L357)
|
||||
|
||||
___
|
||||
|
||||
|
@ -61,7 +61,7 @@ CreateChatCompletionResponse
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:315](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L315)
|
||||
[src/types.ts:345](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L345)
|
||||
|
||||
___
|
||||
|
||||
|
@ -75,7 +75,7 @@ CreateChatCompletionResponse
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:333](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L333)
|
||||
[src/types.ts:363](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L363)
|
||||
|
||||
___
|
||||
|
||||
|
@ -89,7 +89,7 @@ CreateChatCompletionResponse
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:321](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L321)
|
||||
[src/types.ts:351](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L351)
|
||||
|
||||
___
|
||||
|
||||
|
@ -103,4 +103,4 @@ CreateChatCompletionResponse
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:345](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L345)
|
||||
[src/types.ts:375](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L375)
|
||||
|
|
|
@ -30,7 +30,7 @@ CreateChatCompletionResponseChoicesInner
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:370](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L370)
|
||||
[src/types.ts:400](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L400)
|
||||
|
||||
___
|
||||
|
||||
|
@ -44,7 +44,7 @@ CreateChatCompletionResponseChoicesInner
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:358](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L358)
|
||||
[src/types.ts:388](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L388)
|
||||
|
||||
___
|
||||
|
||||
|
@ -58,4 +58,4 @@ CreateChatCompletionResponseChoicesInner
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:364](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L364)
|
||||
[src/types.ts:394](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L394)
|
||||
|
|
|
@ -30,7 +30,7 @@ CreateCompletionResponseUsage
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:389](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L389)
|
||||
[src/types.ts:419](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L419)
|
||||
|
||||
___
|
||||
|
||||
|
@ -44,7 +44,7 @@ CreateCompletionResponseUsage
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:383](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L383)
|
||||
[src/types.ts:413](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L413)
|
||||
|
||||
___
|
||||
|
||||
|
@ -58,4 +58,4 @@ CreateCompletionResponseUsage
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:395](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L395)
|
||||
[src/types.ts:425](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L425)
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
### Type Aliases
|
||||
|
||||
- [ChatGPTAPIOptions](modules.md#chatgptapioptions)
|
||||
- [ContentType](modules.md#contenttype)
|
||||
- [ConversationJSONBody](modules.md#conversationjsonbody)
|
||||
- [ConversationResponseEvent](modules.md#conversationresponseevent)
|
||||
|
@ -38,13 +39,39 @@
|
|||
|
||||
## Type Aliases
|
||||
|
||||
### ChatGPTAPIOptions
|
||||
|
||||
Ƭ **ChatGPTAPIOptions**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `apiBaseUrl?` | `string` | **`Default Value`** `'https://api.openai.com'` * |
|
||||
| `apiKey` | `string` | - |
|
||||
| `completionParams?` | `Partial`<`Omit`<[`CreateChatCompletionRequest`](interfaces/openai.CreateChatCompletionRequest.md), ``"messages"`` \| ``"n"``\>\> | - |
|
||||
| `debug?` | `boolean` | **`Default Value`** `false` * |
|
||||
| `fetch?` | [`FetchFn`](modules.md#fetchfn) | - |
|
||||
| `getMessageById?` | [`GetMessageByIdFunction`](modules.md#getmessagebyidfunction) | - |
|
||||
| `maxModelTokens?` | `number` | **`Default Value`** `4096` * |
|
||||
| `maxResponseTokens?` | `number` | **`Default Value`** `1000` * |
|
||||
| `messageStore?` | `Keyv` | - |
|
||||
| `systemMessage?` | `string` | - |
|
||||
| `upsertMessage?` | [`UpsertMessageFunction`](modules.md#upsertmessagefunction) | - |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:7](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
### ContentType
|
||||
|
||||
Ƭ **ContentType**: ``"text"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:103](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L103)
|
||||
[src/types.ts:133](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L133)
|
||||
|
||||
___
|
||||
|
||||
|
@ -66,7 +93,7 @@ https://chat.openapi.com/backend-api/conversation
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:59](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L59)
|
||||
[src/types.ts:89](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L89)
|
||||
|
||||
___
|
||||
|
||||
|
@ -84,7 +111,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:117](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L117)
|
||||
[src/types.ts:147](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L147)
|
||||
|
||||
___
|
||||
|
||||
|
@ -94,7 +121,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:3](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L3)
|
||||
[src/types.ts:5](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L5)
|
||||
|
||||
___
|
||||
|
||||
|
@ -120,7 +147,7 @@ Returns a chat message from a store by it's ID (or null if not found).
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:51](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L51)
|
||||
[src/types.ts:81](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L81)
|
||||
|
||||
___
|
||||
|
||||
|
@ -145,7 +172,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:123](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L123)
|
||||
[src/types.ts:153](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
|
@ -155,7 +182,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:17](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L17)
|
||||
[src/types.ts:47](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L47)
|
||||
|
||||
___
|
||||
|
||||
|
@ -172,7 +199,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:136](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L136)
|
||||
[src/types.ts:166](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L166)
|
||||
|
||||
___
|
||||
|
||||
|
@ -182,7 +209,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:141](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L141)
|
||||
[src/types.ts:171](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L171)
|
||||
|
||||
___
|
||||
|
||||
|
@ -200,7 +227,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:86](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L86)
|
||||
[src/types.ts:116](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
|
@ -217,7 +244,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:105](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L105)
|
||||
[src/types.ts:135](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L135)
|
||||
|
||||
___
|
||||
|
||||
|
@ -227,7 +254,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:1](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L1)
|
||||
[src/types.ts:3](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L3)
|
||||
|
||||
___
|
||||
|
||||
|
@ -249,7 +276,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:19](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L19)
|
||||
[src/types.ts:49](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
|
@ -272,7 +299,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:5](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L5)
|
||||
[src/types.ts:35](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
|
@ -298,4 +325,4 @@ Upserts a chat message to a store.
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:54](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L54)
|
||||
[src/types.ts:84](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L84)
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:186](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L186)
|
||||
[src/types.ts:216](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L216)
|
||||
|
||||
[src/types.ts:191](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L191)
|
||||
[src/types.ts:221](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L221)
|
||||
|
||||
___
|
||||
|
||||
|
@ -45,9 +45,9 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:212](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L212)
|
||||
[src/types.ts:242](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L242)
|
||||
|
||||
[src/types.ts:217](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L217)
|
||||
[src/types.ts:247](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L247)
|
||||
|
||||
___
|
||||
|
||||
|
@ -59,7 +59,7 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:303](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L303)
|
||||
[src/types.ts:333](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L333)
|
||||
|
||||
## Variables
|
||||
|
||||
|
@ -77,9 +77,9 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:186](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L186)
|
||||
[src/types.ts:216](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L216)
|
||||
|
||||
[src/types.ts:191](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L191)
|
||||
[src/types.ts:221](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L221)
|
||||
|
||||
___
|
||||
|
||||
|
@ -97,6 +97,6 @@ ___
|
|||
|
||||
#### Defined in
|
||||
|
||||
[src/types.ts:212](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L212)
|
||||
[src/types.ts:242](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L242)
|
||||
|
||||
[src/types.ts:217](https://github.com/transitive-bullshit/chatgpt-api/blob/1e4ddd6/src/types.ts#L217)
|
||||
[src/types.ts:247](https://github.com/transitive-bullshit/chatgpt-api/blob/48cb944/src/types.ts#L247)
|
||||
|
|
Ładowanie…
Reference in New Issue