chatgpt / Exports
- ChatGPTErrorType
- ContentType
- ConversationJSONBody
- ConversationResponseEvent
- FetchFn
- GetAccessTokenFn
- GetMessageByIdFunction
- Message
- MessageActionType
- MessageContent
- MessageMetadata
- Prompt
- PromptContent
- Role
- SendMessageBrowserOptions
- SendMessageOptions
- UpsertMessageFunction
Ƭ ChatGPTErrorType: "unknown"
| "chatgpt:pool:account-on-cooldown"
| "chatgpt:pool:account-not-found"
| "chatgpt:pool:no-accounts"
| "chatgpt:pool:timeout"
| "chatgpt:pool:rate-limit"
| "chatgpt:pool:unavailable"
Ƭ ContentType: "text"
Ƭ ConversationJSONBody: Object
https://chat.openapi.com/backend-api/conversation
Name | Type | Description |
---|---|---|
action |
string |
The action to take |
conversation_id? |
string |
The ID of the conversation |
messages |
Prompt [] |
Prompts to provide |
model |
string |
The model to use |
parent_message_id |
string |
The parent message ID |
Ƭ ConversationResponseEvent: Object
Name | Type |
---|---|
conversation_id? |
string |
error? |
string | null |
message? |
Message |
Ƭ FetchFn: typeof fetch
Ƭ GetAccessTokenFn: ({ email, password, sessionToken }
: { email
: string
; password
: string
; sessionToken?
: string
}) => string
| Promise
<string
>
▸ ({ email, password, sessionToken }
): string
| Promise
<string
>
Name | Type |
---|---|
`{ | |
email, | |
password, | |
sessionToken | |
}` | Object |
`{ | |
email, | |
password, | |
sessionToken | |
}.email` | string |
`{ | |
email, | |
password, | |
sessionToken | |
}.password` | string |
`{ | |
email, | |
password, | |
sessionToken | |
}.sessionToken?` | string |
string
| Promise
<string
>
Ƭ GetMessageByIdFunction: (id
: string
) => Promise
<ChatMessage
>
▸ (id
): Promise
<ChatMessage
>
Returns a chat message from a store by it's ID (or null if not found).
Name | Type |
---|---|
id |
string |
Promise
<ChatMessage
>
Ƭ Message: Object
Name | Type |
---|---|
content |
MessageContent |
create_time |
string | null |
end_turn |
null |
id |
string |
metadata |
MessageMetadata |
recipient |
string |
role |
Role |
update_time |
string | null |
user |
string | null |
weight |
number |
Ƭ MessageActionType: "next"
| "variant"
Ƭ MessageContent: Object
Name | Type |
---|---|
content_type |
string |
parts |
string [] |
Ƭ MessageMetadata: any
Ƭ Prompt: Object
Name | Type | Description |
---|---|---|
content |
PromptContent |
The content of the prompt |
id |
string |
The ID of the prompt |
role |
Role |
The role played in the prompt |
Ƭ PromptContent: Object
Name | Type | Description |
---|---|---|
content_type |
ContentType |
The content type of the prompt |
parts |
string [] |
The parts to the prompt |
Ƭ Role: "user"
| "assistant"
Ƭ SendMessageBrowserOptions: Object
Name | Type |
---|---|
abortSignal? |
AbortSignal |
action? |
MessageActionType |
conversationId? |
string |
messageId? |
string |
onProgress? |
(partialResponse : ChatMessage ) => void |
parentMessageId? |
string |
timeoutMs? |
number |
Ƭ SendMessageOptions: Object
Name | Type |
---|---|
abortSignal? |
AbortSignal |
conversationId? |
string |
messageId? |
string |
onProgress? |
(partialResponse : ChatMessage ) => void |
parentMessageId? |
string |
promptPrefix? |
string |
promptSuffix? |
string |
stream? |
boolean |
timeoutMs? |
number |
Ƭ UpsertMessageFunction: (message
: ChatMessage
) => Promise
<void
>
▸ (message
): Promise
<void
>
Upserts a chat message to a store.
Name | Type |
---|---|
message |
ChatMessage |
Promise
<void
>