mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
feat: add other api base url for API
This commit is contained in:
parent
47f6bb8dfb
commit
c0c43461c1
2 changed files with 4 additions and 2 deletions
|
|
@ -336,7 +336,7 @@ export class chatgpt extends plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
async sendMessage (prompt, conversation = {}, use) {
|
async sendMessage (prompt, conversation = {}, use) {
|
||||||
|
conversation.timeoutMs = 120000
|
||||||
// console.log(use)
|
// console.log(use)
|
||||||
if (use === 'browser') {
|
if (use === 'browser') {
|
||||||
return await this.chatgptBrowserBased(prompt, conversation)
|
return await this.chatgptBrowserBased(prompt, conversation)
|
||||||
|
|
@ -409,6 +409,7 @@ export class chatgpt extends plugin {
|
||||||
upsertMessage,
|
upsertMessage,
|
||||||
getMessageById,
|
getMessageById,
|
||||||
completionParams,
|
completionParams,
|
||||||
|
apiBaseUrl: Config.api || 'https://api.openai.com',
|
||||||
assistantLabel: Config.assistantLabel
|
assistantLabel: Config.assistantLabel
|
||||||
})
|
})
|
||||||
const currentDate = new Date().toISOString().split('T')[0]
|
const currentDate = new Date().toISOString().split('T')[0]
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ export const Config = {
|
||||||
apiKey: API_KEY,
|
apiKey: API_KEY,
|
||||||
// 模型名称,选填。如无特殊需求保持默认即可,会使用chatgpt-api库提供的当前可用的最适合的默认值。保底可用的是 text-davinci-003。当发现新的可用的chatGPT模型会更新这里的值
|
// 模型名称,选填。如无特殊需求保持默认即可,会使用chatgpt-api库提供的当前可用的最适合的默认值。保底可用的是 text-davinci-003。当发现新的可用的chatGPT模型会更新这里的值
|
||||||
// 20230211: text-chat-davinci-002-sh-alpha-aoruigiofdj83 中午存活了几分钟
|
// 20230211: text-chat-davinci-002-sh-alpha-aoruigiofdj83 中午存活了几分钟
|
||||||
model: '',
|
model: 'text-davinci-002-render',
|
||||||
|
api: '',
|
||||||
// ***********************************************************************************************************************************
|
// ***********************************************************************************************************************************
|
||||||
// 以下为API2方式的配置 *
|
// 以下为API2方式的配置 *
|
||||||
// ***********************************************************************************************************************************
|
// ***********************************************************************************************************************************
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue