Commit 4f6077d1 authored by Travis Fischer's avatar Travis Fischer Committed by GitHub

Merge pull request #473 from SmileSmith/v3

parents 168ab1fc 4f034784
......@@ -49,6 +49,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI {
constructor(opts: {
email: string
password: string
model?: string
/** @defaultValue `false` **/
isProAccount?: boolean
......@@ -88,6 +89,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI {
const {
email,
password,
model,
isProAccount = false,
markdown = true,
debug = false,
......@@ -443,6 +445,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI {
opts: types.SendMessageOptions = {}
): Promise<types.ChatResponse> {
const {
model,
conversationId,
parentMessageId = uuidv4(),
messageId = uuidv4(),
......@@ -464,9 +467,11 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI {
}
}
],
model: this._isProAccount
model: model
? model
: this._isProAccount
? 'text-davinci-002-render-paid'
: 'text-davinci-002-render',
: 'text-davinci-002-render-sha',
parent_message_id: parentMessageId
}
......
......@@ -212,7 +212,7 @@ export class ChatGPTAPI extends AChatGPTAPI {
}
}
],
model: 'text-davinci-002-render',
model: 'text-davinci-002-render-sha',
parent_message_id: parentMessageId
}
......
......@@ -283,6 +283,7 @@ export type SendMessageOptions = {
timeoutMs?: number
onProgress?: (partialResponse: ChatResponse) => void
abortSignal?: AbortSignal
model?: string
}
export type SendConversationMessageOptions = Omit<
......
......@@ -155,7 +155,7 @@ export async function browserPostEventStream(
error: {
message: `ChatGPTAPI error ${res.status || res.statusText}`,
statusCode: res.status,
statusText: res.statusText
statusText: res.statusText || (await res.text())
},
conversationId,
messageId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment