kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
2.8 KiB
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
Methods
close
▸ close(): Promise
<void
>
Returns
Promise
<void
>
Defined in
getIsSignedIn
▸ getIsSignedIn(): Promise
<boolean
>
Returns
Promise
<boolean
>
Defined in
getLastMessage
▸ getLastMessage(): Promise
<string
>
Returns
Promise
<string
>
Defined in
getMessages
▸ getMessages(): Promise
<string
[]>
Returns
Promise
<string
[]>
Defined in
getPrompts
▸ getPrompts(): Promise
<string
[]>
Returns
Promise
<string
[]>
Defined in
init
▸ init(opts?
): Promise
<Page
>
Parameters
Name | Type |
---|---|
opts |
Object |
opts.auth? |
"blocking" | "eager" |
Returns
Promise
<Page
>
Defined in
sendMessage
▸ sendMessage(message
): Promise
<string
>
Parameters
Name | Type |
---|---|
message |
string |
Returns
Promise
<string
>