chatgpt-api/docs/classes/ChatGPTAPI.md

2.8 KiB

chatgpt / Exports / ChatGPTAPI

Class: ChatGPTAPI

Table of contents

Constructors

Methods

Constructors

constructor

new ChatGPTAPI(opts?)

Parameters

Name Type Description
opts Object -
opts.chatUrl? string Default Value 'https://chat.openai.com/' *
opts.headless? boolean Default Value false *
opts.markdown? boolean Default Value true *
opts.userDataDir? string Default Value '/tmp/chatgpt' *

Defined in

chatgpt-api.ts:20

Methods

close

close(): Promise<void>

Returns

Promise<void>

Defined in

chatgpt-api.ts:186


getIsSignedIn

getIsSignedIn(): Promise<boolean>

Returns

Promise<boolean>

Defined in

chatgpt-api.ts:94


getLastMessage

getLastMessage(): Promise<string>

Returns

Promise<string>

Defined in

chatgpt-api.ts:104


getMessages

getMessages(): Promise<string[]>

Returns

Promise<string[]>

Defined in

chatgpt-api.ts:124


getPrompts

getPrompts(): Promise<string[]>

Returns

Promise<string[]>

Defined in

chatgpt-api.ts:114


init

init(opts?): Promise<Page>

Parameters

Name Type
opts Object
opts.auth? "blocking" | "eager"

Returns

Promise<Page>

Defined in

chatgpt-api.ts:48


sendMessage

sendMessage(message): Promise<string>

Parameters

Name Type
message string

Returns

Promise<string>

Defined in

chatgpt-api.ts:162