chore: update ts docs

pull/444/merge
Travis Fischer 2023-05-01 21:42:44 -05:00
rodzic fb06bebc9c
commit a020bcc9c5
16 zmienionych plików z 153 dodań i 126 usunięć

Wyświetl plik

@ -33,7 +33,7 @@ Creates a new client wrapper around OpenAI's chat completion API, mimicing the o
#### Defined in
[src/chatgpt-api.ts:51](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L51)
[src/chatgpt-api.ts:51](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/chatgpt-api.ts#L51)
## Accessors
@ -47,7 +47,7 @@ Creates a new client wrapper around OpenAI's chat completion API, mimicing the o
#### Defined in
[src/chatgpt-api.ts:345](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L345)
[src/chatgpt-api.ts:345](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/chatgpt-api.ts#L345)
`set` **apiKey**(`apiKey`): `void`
@ -63,7 +63,7 @@ Creates a new client wrapper around OpenAI's chat completion API, mimicing the o
#### Defined in
[src/chatgpt-api.ts:349](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L349)
[src/chatgpt-api.ts:349](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/chatgpt-api.ts#L349)
___
@ -77,7 +77,7 @@ ___
#### Defined in
[src/chatgpt-api.ts:353](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L353)
[src/chatgpt-api.ts:353](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/chatgpt-api.ts#L353)
`set` **apiOrg**(`apiOrg`): `void`
@ -93,7 +93,7 @@ ___
#### Defined in
[src/chatgpt-api.ts:357](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L357)
[src/chatgpt-api.ts:357](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/chatgpt-api.ts#L357)
## Methods
@ -125,4 +125,4 @@ The response from ChatGPT
#### Defined in
[src/chatgpt-api.ts:137](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L137)
[src/chatgpt-api.ts:137](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/chatgpt-api.ts#L137)

Wyświetl plik

@ -39,7 +39,7 @@ Error.constructor
#### Defined in
node_modules/.pnpm/typescript@5.0.3/node_modules/typescript/lib/lib.es5.d.ts:1060
node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es5.d.ts:1060
**new ChatGPTError**(`message?`, `options?`)
@ -56,7 +56,7 @@ Error.constructor
#### Defined in
node_modules/.pnpm/typescript@5.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:28
node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2022.error.d.ts:28
## Properties
@ -66,7 +66,7 @@ node_modules/.pnpm/typescript@5.0.3/node_modules/typescript/lib/lib.es2022.error
#### Defined in
[src/types.ts:86](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L86)
[src/types.ts:86](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L86)
___
@ -76,7 +76,7 @@ ___
#### Defined in
[src/types.ts:85](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L85)
[src/types.ts:85](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L85)
___
@ -86,7 +86,7 @@ ___
#### Defined in
[src/types.ts:83](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L83)
[src/types.ts:83](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L83)
___
@ -96,4 +96,4 @@ ___
#### Defined in
[src/types.ts:84](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L84)
[src/types.ts:84](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L84)

Wyświetl plik

@ -36,7 +36,7 @@
#### Defined in
[src/chatgpt-unofficial-proxy-api.ts:20](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-unofficial-proxy-api.ts#L20)
[src/chatgpt-unofficial-proxy-api.ts:20](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/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/bf66500/src/chatgpt-unofficial-proxy-api.ts#L66)
[src/chatgpt-unofficial-proxy-api.ts:66](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/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/bf66500/src/chatgpt-unofficial-proxy-api.ts#L70)
[src/chatgpt-unofficial-proxy-api.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/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/bf66500/src/chatgpt-unofficial-proxy-api.ts#L97)
[src/chatgpt-unofficial-proxy-api.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/chatgpt-unofficial-proxy-api.ts#L97)

Wyświetl plik

@ -23,7 +23,7 @@
#### Defined in
[src/types.ts:79](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L79)
[src/types.ts:79](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L79)
___
@ -33,7 +33,7 @@ ___
#### Defined in
[src/types.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L70)
[src/types.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L70)
___
@ -43,7 +43,7 @@ ___
#### Defined in
[src/types.ts:71](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L71)
[src/types.ts:71](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L71)
___
@ -53,7 +53,7 @@ ___
#### Defined in
[src/types.ts:66](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L66)
[src/types.ts:66](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L66)
___
@ -63,7 +63,7 @@ ___
#### Defined in
[src/types.ts:69](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L69)
[src/types.ts:69](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L69)
___
@ -73,7 +73,7 @@ ___
#### Defined in
[src/types.ts:76](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L76)
[src/types.ts:76](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L76)
___
@ -83,7 +83,7 @@ ___
#### Defined in
[src/types.ts:68](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L68)
[src/types.ts:68](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L68)
___
@ -93,4 +93,4 @@ ___
#### Defined in
[src/types.ts:67](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L67)
[src/types.ts:67](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L67)

Wyświetl plik

@ -31,7 +31,7 @@
#### Defined in
[src/types.ts:198](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L198)
[src/types.ts:198](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L198)
___
@ -45,7 +45,7 @@ ___
#### Defined in
[src/types.ts:196](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L196)
[src/types.ts:196](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L196)
___
@ -59,7 +59,7 @@ ___
#### Defined in
[src/types.ts:194](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L194)
[src/types.ts:194](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L194)
___
@ -73,7 +73,7 @@ ___
#### Defined in
[src/types.ts:197](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L197)
[src/types.ts:197](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L197)
___
@ -87,7 +87,7 @@ ___
#### Defined in
[src/types.ts:195](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L195)
[src/types.ts:195](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L195)
___
@ -97,4 +97,4 @@ ___
#### Defined in
[src/types.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L97)
[src/types.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L97)

Wyświetl plik

@ -4,8 +4,6 @@
**`Export`**
**`Interface`**
CreateCompletionResponseUsage
## Hierarchy
@ -39,7 +37,7 @@ CreateCompletionResponseUsage
#### Defined in
[src/types.ts:438](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L438)
[src/types.ts:438](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L438)
___
@ -49,7 +47,7 @@ ___
#### Defined in
[src/types.ts:102](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L102)
[src/types.ts:102](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L102)
___
@ -67,7 +65,7 @@ CreateCompletionResponseUsage
#### Defined in
[src/types.ts:432](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L432)
[src/types.ts:432](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L432)
___
@ -85,4 +83,4 @@ CreateCompletionResponseUsage
#### Defined in
[src/types.ts:444](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L444)
[src/types.ts:444](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L444)

Wyświetl plik

@ -6,8 +6,6 @@
**`Export`**
**`Interface`**
ChatCompletionRequestMessage
## Table of contents
@ -32,7 +30,7 @@ ChatCompletionRequestMessage
#### Defined in
[src/types.ts:227](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L227)
[src/types.ts:227](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L227)
___
@ -48,7 +46,7 @@ ChatCompletionRequestMessage
#### Defined in
[src/types.ts:233](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L233)
[src/types.ts:233](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L233)
___
@ -64,4 +62,4 @@ ChatCompletionRequestMessage
#### Defined in
[src/types.ts:221](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L221)
[src/types.ts:221](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L221)

Wyświetl plik

@ -6,8 +6,6 @@
**`Export`**
**`Interface`**
ChatCompletionResponseMessage
## Table of contents
@ -31,7 +29,7 @@ ChatCompletionResponseMessage
#### Defined in
[src/types.ts:259](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L259)
[src/types.ts:259](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L259)
___
@ -47,4 +45,4 @@ ChatCompletionResponseMessage
#### Defined in
[src/types.ts:253](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L253)
[src/types.ts:253](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L253)

Wyświetl plik

@ -28,7 +28,7 @@
#### Defined in
[src/types.ts:198](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L198)
[src/types.ts:198](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L198)
___
@ -38,7 +38,7 @@ ___
#### Defined in
[src/types.ts:196](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L196)
[src/types.ts:196](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L196)
___
@ -48,7 +48,7 @@ ___
#### Defined in
[src/types.ts:194](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L194)
[src/types.ts:194](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L194)
___
@ -58,7 +58,7 @@ ___
#### Defined in
[src/types.ts:197](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L197)
[src/types.ts:197](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L197)
___
@ -68,4 +68,4 @@ ___
#### Defined in
[src/types.ts:195](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L195)
[src/types.ts:195](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L195)

Wyświetl plik

@ -6,8 +6,6 @@
**`Export`**
**`Interface`**
CreateChatCompletionRequest
## Table of contents
@ -41,7 +39,7 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:333](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L333)
[src/types.ts:333](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L333)
___
@ -57,7 +55,7 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:339](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L339)
[src/types.ts:339](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L339)
___
@ -73,7 +71,7 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:321](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L321)
[src/types.ts:321](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L321)
___
@ -89,7 +87,7 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:285](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L285)
[src/types.ts:285](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L285)
___
@ -105,7 +103,7 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:279](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L279)
[src/types.ts:279](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L279)
___
@ -121,7 +119,7 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:303](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L303)
[src/types.ts:303](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L303)
___
@ -137,7 +135,7 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:327](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L327)
[src/types.ts:327](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L327)
___
@ -151,7 +149,7 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:315](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L315)
[src/types.ts:315](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L315)
___
@ -167,7 +165,7 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:309](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L309)
[src/types.ts:309](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L309)
___
@ -183,7 +181,7 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:291](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L291)
[src/types.ts:291](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L291)
___
@ -199,7 +197,7 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:297](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L297)
[src/types.ts:297](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L297)
___
@ -215,4 +213,4 @@ CreateChatCompletionRequest
#### Defined in
[src/types.ts:345](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L345)
[src/types.ts:345](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L345)

Wyświetl plik

@ -6,8 +6,6 @@
**`Export`**
**`Interface`**
CreateChatCompletionResponse
## Table of contents
@ -33,7 +31,7 @@ CreateChatCompletionResponse
#### Defined in
[src/types.ts:388](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L388)
[src/types.ts:388](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L388)
___
@ -47,7 +45,7 @@ CreateChatCompletionResponse
#### Defined in
[src/types.ts:376](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L376)
[src/types.ts:376](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L376)
___
@ -61,7 +59,7 @@ CreateChatCompletionResponse
#### Defined in
[src/types.ts:364](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L364)
[src/types.ts:364](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L364)
___
@ -75,7 +73,7 @@ CreateChatCompletionResponse
#### Defined in
[src/types.ts:382](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L382)
[src/types.ts:382](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L382)
___
@ -89,7 +87,7 @@ CreateChatCompletionResponse
#### Defined in
[src/types.ts:370](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L370)
[src/types.ts:370](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L370)
___
@ -103,4 +101,4 @@ CreateChatCompletionResponse
#### Defined in
[src/types.ts:394](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L394)
[src/types.ts:394](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L394)

Wyświetl plik

@ -6,8 +6,6 @@
**`Export`**
**`Interface`**
CreateChatCompletionResponseChoicesInner
## Table of contents
@ -30,7 +28,7 @@ CreateChatCompletionResponseChoicesInner
#### Defined in
[src/types.ts:419](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L419)
[src/types.ts:419](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L419)
___
@ -44,7 +42,7 @@ CreateChatCompletionResponseChoicesInner
#### Defined in
[src/types.ts:407](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L407)
[src/types.ts:407](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L407)
___
@ -58,4 +56,4 @@ CreateChatCompletionResponseChoicesInner
#### Defined in
[src/types.ts:413](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L413)
[src/types.ts:413](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L413)

Wyświetl plik

@ -6,8 +6,6 @@
**`Export`**
**`Interface`**
CreateCompletionResponseUsage
## Hierarchy
@ -36,7 +34,7 @@ CreateCompletionResponseUsage
#### Defined in
[src/types.ts:438](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L438)
[src/types.ts:438](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L438)
___
@ -50,7 +48,7 @@ CreateCompletionResponseUsage
#### Defined in
[src/types.ts:432](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L432)
[src/types.ts:432](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L432)
___
@ -64,4 +62,4 @@ CreateCompletionResponseUsage
#### Defined in
[src/types.ts:444](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L444)
[src/types.ts:444](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L444)

Wyświetl plik

@ -64,7 +64,7 @@
#### Defined in
[src/types.ts:7](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L7)
[src/types.ts:7](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L7)
___
@ -74,7 +74,7 @@ ___
#### Defined in
[src/types.ts:152](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L152)
[src/types.ts:152](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L152)
___
@ -96,7 +96,7 @@ https://chat.openapi.com/backend-api/conversation
#### Defined in
[src/types.ts:108](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L108)
[src/types.ts:108](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L108)
___
@ -114,7 +114,7 @@ ___
#### Defined in
[src/types.ts:166](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L166)
[src/types.ts:166](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L166)
___
@ -124,7 +124,7 @@ ___
#### Defined in
[src/types.ts:5](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L5)
[src/types.ts:5](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L5)
___
@ -150,7 +150,7 @@ Returns a chat message from a store by it's ID (or null if not found).
#### Defined in
[src/types.ts:90](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L90)
[src/types.ts:90](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L90)
___
@ -175,7 +175,7 @@ ___
#### Defined in
[src/types.ts:172](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L172)
[src/types.ts:172](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L172)
___
@ -185,7 +185,7 @@ ___
#### Defined in
[src/types.ts:53](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L53)
[src/types.ts:53](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L53)
___
@ -202,7 +202,7 @@ ___
#### Defined in
[src/types.ts:185](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L185)
[src/types.ts:185](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L185)
___
@ -212,7 +212,7 @@ ___
#### Defined in
[src/types.ts:190](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L190)
[src/types.ts:190](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L190)
___
@ -230,7 +230,7 @@ ___
#### Defined in
[src/types.ts:135](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L135)
[src/types.ts:135](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L135)
___
@ -247,7 +247,7 @@ ___
#### Defined in
[src/types.ts:154](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L154)
[src/types.ts:154](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L154)
___
@ -257,7 +257,7 @@ ___
#### Defined in
[src/types.ts:3](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L3)
[src/types.ts:3](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L3)
___
@ -279,7 +279,7 @@ ___
#### Defined in
[src/types.ts:55](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L55)
[src/types.ts:55](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L55)
___
@ -304,7 +304,7 @@ ___
#### Defined in
[src/types.ts:37](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L37)
[src/types.ts:37](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L37)
___
@ -330,4 +330,4 @@ Upserts a chat message to a store.
#### Defined in
[src/types.ts:93](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L93)
[src/types.ts:93](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L93)

Wyświetl plik

@ -33,9 +33,9 @@
#### Defined in
[src/types.ts:235](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L235)
[src/types.ts:235](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L235)
[src/types.ts:240](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L240)
[src/types.ts:240](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L240)
___
@ -45,9 +45,9 @@ ___
#### Defined in
[src/types.ts:261](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L261)
[src/types.ts:261](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L261)
[src/types.ts:266](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L266)
[src/types.ts:266](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L266)
___
@ -59,7 +59,7 @@ ___
#### Defined in
[src/types.ts:352](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L352)
[src/types.ts:352](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L352)
## Variables
@ -77,9 +77,9 @@ ___
#### Defined in
[src/types.ts:235](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L235)
[src/types.ts:235](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L235)
[src/types.ts:240](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L240)
[src/types.ts:240](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L240)
___
@ -97,6 +97,6 @@ ___
#### Defined in
[src/types.ts:261](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L261)
[src/types.ts:261](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L261)
[src/types.ts:266](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L266)
[src/types.ts:266](https://github.com/transitive-bullshit/chatgpt-api/blob/fb06beb/src/types.ts#L266)

Wyświetl plik

@ -33,6 +33,44 @@ This package is a Node.js wrapper around [ChatGPT](https://openai.com/blog/chatg
## Updates
<details open>
<summary><strong>April 10, 2023</strong></summary>
<br/>
This package now **fully supports GPT-4**! 🔥
We also just released a [TypeScript chatgpt-plugin package](https://github.com/transitive-bullshit/chatgpt-plugin-ts) which contains helpers and examples to make it as easy as possible to start building your own ChatGPT Plugins in JS/TS. Even if you don't have developer access to ChatGPT Plugins yet, you can still use the [chatgpt-plugin](https://github.com/transitive-bullshit/chatgpt-plugin-ts) repo to get a head start on building your own plugins locally.
If you have access to the `gpt-4` model, you can run the following to test out the CLI with GPT-4:
```bash
npx chatgpt@latest --model gpt-4 "Hello world"
```
<p align="center">
<img src="https://user-images.githubusercontent.com/552829/229368245-d22fbac7-4b56-4a5e-810b-5ac5793b6ac3.png" width="600px" alt="Using the chatgpt CLI with gpt-4">
</p>
We still support both the official ChatGPT API and the unofficial proxy API, but we now recommend using the official API since it's significantly more robust and supports **GPT-4**.
| Method | Free? | Robust? | Quality? |
| --------------------------- | ------ | ------- | ------------------------------- |
| `ChatGPTAPI` | ❌ No | ✅ Yes | ✅️ Real ChatGPT models + GPT-4 |
| `ChatGPTUnofficialProxyAPI` | ✅ Yes | ❌ No | ✅ ChatGPT webapp |
**Note**: We strongly recommend using `ChatGPTAPI` since it uses the officially supported API from OpenAI. We will likely remove support for `ChatGPTUnofficialProxyAPI` in a future release.
1. `ChatGPTAPI` - Uses the `gpt-3.5-turbo` model with the official OpenAI chat completions API (official, robust approach, but it's not free)
2. `ChatGPTUnofficialProxyAPI` - Uses an unofficial proxy server to access ChatGPT's backend API in a way that circumvents Cloudflare (uses the real ChatGPT and is pretty lightweight, but relies on a third-party server and is rate-limited)
</details>
<details>
<summary><strong>Previous Updates</strong></summary>
<br/>
<details>
<summary><strong>March 1, 2023</strong></summary>
<br/>
@ -46,16 +84,11 @@ The [official OpenAI chat completions API](https://platform.openai.com/docs/guid
**Note**: We strongly recommend using `ChatGPTAPI` since it uses the officially supported API from OpenAI. We may remove support for `ChatGPTUnofficialProxyAPI` in a future release.
1. `ChatGPTAPI` - Uses the `gpt-3.5-turbo-0301` model with the official OpenAI chat completions API (official, robust approach, but it's not free)
1. `ChatGPTAPI` - Uses the `gpt-3.5-turbo` model with the official OpenAI chat completions API (official, robust approach, but it's not free)
2. `ChatGPTUnofficialProxyAPI` - Uses an unofficial proxy server to access ChatGPT's backend API in a way that circumvents Cloudflare (uses the real ChatGPT and is pretty lightweight, but relies on a third-party server and is rate-limited)
</details>
<details>
<summary><strong>Previous Updates</strong></summary>
<br/>
<details>
<summary><strong>Feb 19, 2023</strong></summary>
@ -113,7 +146,7 @@ Huge shoutout to [@waylaidwanderer](https://github.com/waylaidwanderer) for disc
</details>
</details>
If you run into any issues, we do have a pretty active [Discord](https://discord.gg/v9gERj825w) with a bunch of ChatGPT hackers from the Node.js & Python communities.
If you run into any issues, we do have a pretty active [ChatGPT Hackers Discord](https://www.chatgpthackers.dev/) with over 8k developers from the Node.js & Python communities.
Lastly, please consider starring this repo and <a href="https://twitter.com/transitive_bs">following me on twitter <img src="https://storage.googleapis.com/saasify-assets/twitter-logo.svg" alt="twitter" height="24px" align="center"></a> to help support the project.
@ -158,6 +191,12 @@ Options:
-v, --version Display version number
```
If you have access to the `gpt-4` model, you can run the following to test out the CLI with GPT-4:
<p align="center">
<img src="https://user-images.githubusercontent.com/552829/229368245-d22fbac7-4b56-4a5e-810b-5ac5793b6ac3.png" width="600px" alt="Using the chatgpt CLI with gpt-4">
</p>
## Install
```bash
@ -170,18 +209,18 @@ Make sure you're using `node >= 18` so `fetch` is available (or `node >= 14` if
To use this module from Node.js, you need to pick between two methods:
| Method | Free? | Robust? | Quality? |
| --------------------------- | ------ | -------- | ----------------------- |
| `ChatGPTAPI` | ❌ No | ✅ Yes | ✅️ Real ChatGPT models |
| `ChatGPTUnofficialProxyAPI` | ✅ Yes | ☑️ Maybe | ✅ Real ChatGPT |
| Method | Free? | Robust? | Quality? |
| --------------------------- | ------ | ------- | ------------------------------- |
| `ChatGPTAPI` | ❌ No | ✅ Yes | ✅️ Real ChatGPT models + GPT-4 |
| `ChatGPTUnofficialProxyAPI` | ✅ Yes | ❌ No | ✅ Real ChatGPT webapp |
1. `ChatGPTAPI` - Uses the `gpt-3.5-turbo-0301` model with the official OpenAI chat completions API (official, robust approach, but it's not free). You can override the model, completion params, and system message to fully customize your assistant.
1. `ChatGPTAPI` - Uses the `gpt-3.5-turbo` model with the official OpenAI chat completions API (official, robust approach, but it's not free). You can override the model, completion params, and system message to fully customize your assistant.
2. `ChatGPTUnofficialProxyAPI` - Uses an unofficial proxy server to access ChatGPT's backend API in a way that circumvents Cloudflare (uses the real ChatGPT and is pretty lightweight, but relies on a third-party server and is rate-limited)
Both approaches have very similar APIs, so it should be simple to swap between them.
**Note**: We strongly recommend using `ChatGPTAPI` since it uses the officially supported API from OpenAI. We may remove support for `ChatGPTUnofficialProxyAPI` in a future release.
**Note**: We strongly recommend using `ChatGPTAPI` since it uses the officially supported API from OpenAI and it also supports `gpt-4`. We will likely remove support for `ChatGPTUnofficialProxyAPI` in a future release.
### Usage - ChatGPTAPI
@ -200,12 +239,13 @@ async function example() {
}
```
You can override the default `model` (`gpt-3.5-turbo-0301`) and any [OpenAI chat completion params](https://platform.openai.com/docs/api-reference/chat/create) using `completionParams`:
You can override the default `model` (`gpt-3.5-turbo`) and any [OpenAI chat completion params](https://platform.openai.com/docs/api-reference/chat/create) using `completionParams`:
```ts
const api = new ChatGPTAPI({
apiKey: process.env.OPENAI_API_KEY,
completionParams: {
model: 'gpt-4',
temperature: 0.5,
top_p: 0.8
}
@ -336,10 +376,10 @@ const api = new ChatGPTUnofficialProxyAPI({
Known reverse proxies run by community members include:
| Reverse Proxy URL | Author | Rate Limits | Last Checked |
| ------------------------------------------------ | -------------------------------------------- | ----------------- | ------------ |
| `https://bypass.churchless.tech/api/conversation` | [@acheong08](https://github.com/acheong08) | 5 req / 10 seconds by IP | 3/24/2023 |
| `https://api.pawan.krd/backend-api/conversation` | [@PawanOsman](https://github.com/PawanOsman) | 50 req / 15 seconds (~3 r/s) | 3/23/2023 |
| Reverse Proxy URL | Author | Rate Limits | Last Checked |
| ------------------------------------------------- | -------------------------------------------- | ---------------------------- | ------------ |
| `https://ai.fakeopen.com/api/conversation` | [@pengzhile](https://github.com/pengzhile) | 5 req / 10 seconds by IP | 4/18/2023 |
| `https://api.pawan.krd/backend-api/conversation` | [@PawanOsman](https://github.com/PawanOsman) | 50 req / 15 seconds (~3 r/s) | 3/23/2023 |
Note: info on how the reverse proxies work is not being published at this time in order to prevent OpenAI from disabling access.
@ -498,6 +538,7 @@ All of these awesome projects are built using the `chatgpt` package. 🤯
- [wechaty-chatgpt - A chatbot based on Wechaty & ChatGPT](https://github.com/zhengxs2018/wechaty-chatgpt)
- [Julius GPT](https://github.com/christophebe/julius-gpt) - Generate and publish your content from the CLI
- [OpenAI-API-Service](https://github.com/Jarvan-via/api-service) - Provides OpenAI related APIs for businesses
- [Discord Daily News Bot](https://github.com/ZirionNeft/chatgpt-discord-daily-news-bot) - Discord bot that generate funny daily news
If you create a cool integration, feel free to open a PR and add it to the list.
@ -513,8 +554,8 @@ If you create a cool integration, feel free to open a PR and add it to the list.
## Credits
- Huge thanks to [@waylaidwanderer](https://github.com/waylaidwanderer), [@abacaj](https://github.com/abacaj), [@wong2](https://github.com/wong2), [@simon300000](https://github.com/simon300000), [@RomanHotsiy](https://github.com/RomanHotsiy), [@ElijahPepe](https://github.com/ElijahPepe), and all the other contributors 💪
- The original browser version was inspired by this [Go module](https://github.com/danielgross/whatsapp-gpt) by [Daniel Gross](https://github.com/danielgross)
- [OpenAI](https://openai.com) for creating [ChatGPT](https://openai.com/blog/chatgpt/) 🔥
- I run the [ChatGPT Hackers Discord](https://www.chatgpthackers.dev/) with over 8k developers – come join us!
## License