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 Apr 2, 2023
1 parent bf66500 commit 600b35e
Show file tree
Hide file tree
Showing 16 changed files with 327 additions and 84 deletions.
39 changes: 35 additions & 4 deletions docs/classes/ChatGPTAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Accessors

- [apiKey](ChatGPTAPI.md#apikey)
- [apiOrg](ChatGPTAPI.md#apiorg)

### Methods

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

#### Defined in

[src/chatgpt-api.ts:49](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/chatgpt-api.ts#L49)
[src/chatgpt-api.ts:51](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L51)

## Accessors

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

#### Defined in

[src/chatgpt-api.ts:311](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/chatgpt-api.ts#L311)
[src/chatgpt-api.ts:345](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L345)

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

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

#### Defined in

[src/chatgpt-api.ts:315](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/chatgpt-api.ts#L315)
[src/chatgpt-api.ts:349](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L349)

___

### apiOrg

`get` **apiOrg**(): `string`

#### Returns

`string`

#### Defined in

[src/chatgpt-api.ts:353](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L353)

`set` **apiOrg**(`apiOrg`): `void`

#### Parameters

| Name | Type |
| :------ | :------ |
| `apiOrg` | `string` |

#### Returns

`void`

#### Defined in

[src/chatgpt-api.ts:357](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L357)

## Methods

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

#### Defined in

[src/chatgpt-api.ts:132](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/chatgpt-api.ts#L132)
[src/chatgpt-api.ts:137](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-api.ts#L137)
12 changes: 6 additions & 6 deletions docs/classes/ChatGPTError.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Error.constructor

#### Defined in

node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es5.d.ts:1059
node_modules/.pnpm/typescript@5.0.3/node_modules/typescript/lib/lib.es5.d.ts:1060

**new ChatGPTError**(`message?`, `options?`)

Expand All @@ -56,7 +56,7 @@ Error.constructor

#### Defined in

node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2022.error.d.ts:30
node_modules/.pnpm/typescript@5.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:28

## Properties

Expand All @@ -66,7 +66,7 @@ node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2022.error

#### Defined in

[src/types.ts:80](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L80)
[src/types.ts:86](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L86)

___

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

#### Defined in

[src/types.ts:79](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L79)
[src/types.ts:85](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L85)

___

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

#### Defined in

[src/types.ts:77](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L77)
[src/types.ts:83](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L83)

___

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

#### Defined in

[src/types.ts:78](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L78)
[src/types.ts:84](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L84)
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/9eac18f/src/chatgpt-unofficial-proxy-api.ts#L20)
[src/chatgpt-unofficial-proxy-api.ts:20](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/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/9eac18f/src/chatgpt-unofficial-proxy-api.ts#L66)
[src/chatgpt-unofficial-proxy-api.ts:66](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/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/9eac18f/src/chatgpt-unofficial-proxy-api.ts#L70)
[src/chatgpt-unofficial-proxy-api.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/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/9eac18f/src/chatgpt-unofficial-proxy-api.ts#L97)
[src/chatgpt-unofficial-proxy-api.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/chatgpt-unofficial-proxy-api.ts#L97)
18 changes: 9 additions & 9 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:73](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L73)
[src/types.ts:79](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L79)

___

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

#### Defined in

[src/types.ts:67](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L67)
[src/types.ts:70](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L70)

___

### detail

`Optional` **detail**: `any`
`Optional` **detail**: [`CreateChatCompletionResponse`](openai.CreateChatCompletionResponse.md) \| [`CreateChatCompletionStreamResponse`](CreateChatCompletionStreamResponse.md)

#### Defined in

[src/types.ts:68](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L68)
[src/types.ts:71](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L71)

___

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

#### Defined in

[src/types.ts:63](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L63)
[src/types.ts:66](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L66)

___

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

#### Defined in

[src/types.ts:66](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L66)
[src/types.ts:69](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L69)

___

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

#### Defined in

[src/types.ts:71](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L71)
[src/types.ts:76](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L76)

___

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

#### Defined in

[src/types.ts:65](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L65)
[src/types.ts:68](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L68)

___

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

#### Defined in

[src/types.ts:64](https://github.com/transitive-bullshit/chatgpt-api/blob/9eac18f/src/types.ts#L64)
[src/types.ts:67](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L67)
100 changes: 100 additions & 0 deletions docs/interfaces/CreateChatCompletionStreamResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
[chatgpt](../readme.md) / [Exports](../modules.md) / CreateChatCompletionStreamResponse

# Interface: CreateChatCompletionStreamResponse

## Hierarchy

- [`CreateChatCompletionDeltaResponse`](openai.CreateChatCompletionDeltaResponse.md)

**`CreateChatCompletionStreamResponse`**

## Table of contents

### Properties

- [choices](CreateChatCompletionStreamResponse.md#choices)
- [created](CreateChatCompletionStreamResponse.md#created)
- [id](CreateChatCompletionStreamResponse.md#id)
- [model](CreateChatCompletionStreamResponse.md#model)
- [object](CreateChatCompletionStreamResponse.md#object)
- [usage](CreateChatCompletionStreamResponse.md#usage)

## Properties

### choices

**choices**: [{ `delta`: { `content?`: `string` ; `role`: [`Role`](../modules.md#role) } ; `finish_reason`: `string` ; `index`: `number` }]

#### Inherited from

[CreateChatCompletionDeltaResponse](openai.CreateChatCompletionDeltaResponse.md).[choices](openai.CreateChatCompletionDeltaResponse.md#choices)

#### Defined in

[src/types.ts:198](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L198)

___

### created

**created**: `number`

#### Inherited from

[CreateChatCompletionDeltaResponse](openai.CreateChatCompletionDeltaResponse.md).[created](openai.CreateChatCompletionDeltaResponse.md#created)

#### Defined in

[src/types.ts:196](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L196)

___

### id

**id**: `string`

#### Inherited from

[CreateChatCompletionDeltaResponse](openai.CreateChatCompletionDeltaResponse.md).[id](openai.CreateChatCompletionDeltaResponse.md#id)

#### Defined in

[src/types.ts:194](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L194)

___

### model

**model**: `string`

#### Inherited from

[CreateChatCompletionDeltaResponse](openai.CreateChatCompletionDeltaResponse.md).[model](openai.CreateChatCompletionDeltaResponse.md#model)

#### Defined in

[src/types.ts:197](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L197)

___

### object

**object**: ``"chat.completion.chunk"``

#### Inherited from

[CreateChatCompletionDeltaResponse](openai.CreateChatCompletionDeltaResponse.md).[object](openai.CreateChatCompletionDeltaResponse.md#object)

#### Defined in

[src/types.ts:195](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L195)

___

### usage

**usage**: [`CreateCompletionStreamResponseUsage`](CreateCompletionStreamResponseUsage.md)

#### Defined in

[src/types.ts:97](https://github.com/transitive-bullshit/chatgpt-api/blob/bf66500/src/types.ts#L97)
Loading

0 comments on commit 600b35e

Please sign in to comment.