Commit 73b0b08a authored by chenlongde's avatar chenlongde

fix: change model to sendMessage API

parent 550bd1f8
...@@ -30,7 +30,6 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { ...@@ -30,7 +30,6 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI {
protected _email: string protected _email: string
protected _password: string protected _password: string
protected _model: string
protected _isProAccount: boolean protected _isProAccount: boolean
protected _executablePath: string protected _executablePath: string
...@@ -106,7 +105,6 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { ...@@ -106,7 +105,6 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI {
this._email = email this._email = email
this._password = password this._password = password
this._model = model
this._isProAccount = isProAccount this._isProAccount = isProAccount
this._markdown = !!markdown this._markdown = !!markdown
this._debug = !!debug this._debug = !!debug
...@@ -447,6 +445,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { ...@@ -447,6 +445,7 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI {
opts: types.SendMessageOptions = {} opts: types.SendMessageOptions = {}
): Promise<types.ChatResponse> { ): Promise<types.ChatResponse> {
const { const {
model,
conversationId, conversationId,
parentMessageId = uuidv4(), parentMessageId = uuidv4(),
messageId = uuidv4(), messageId = uuidv4(),
...@@ -468,8 +467,8 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI { ...@@ -468,8 +467,8 @@ export class ChatGPTAPIBrowser extends AChatGPTAPI {
} }
} }
], ],
model: this._model model: model
? this._model ? model
: this._isProAccount : this._isProAccount
? 'text-davinci-002-render-paid' ? 'text-davinci-002-render-paid'
: 'text-davinci-002-render-sha', : 'text-davinci-002-render-sha',
......
...@@ -283,6 +283,7 @@ export type SendMessageOptions = { ...@@ -283,6 +283,7 @@ export type SendMessageOptions = {
timeoutMs?: number timeoutMs?: number
onProgress?: (partialResponse: ChatResponse) => void onProgress?: (partialResponse: ChatResponse) => void
abortSignal?: AbortSignal abortSignal?: AbortSignal
model?: string
} }
export type SendConversationMessageOptions = Omit< export type SendConversationMessageOptions = Omit<
......
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