mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
feat: support openai api baseurl
This commit is contained in:
parent
17fb123e3b
commit
f84663e2a9
4 changed files with 11 additions and 1 deletions
|
|
@ -675,6 +675,7 @@ export class chatgpt extends plugin {
|
||||||
let promptPrefix = `You are ${Config.assistantLabel}, a large language model trained by OpenAI. ${Config.promptPrefixOverride || defaultPropmtPrefix}
|
let promptPrefix = `You are ${Config.assistantLabel}, a large language model trained by OpenAI. ${Config.promptPrefixOverride || defaultPropmtPrefix}
|
||||||
Current date: ${currentDate}`
|
Current date: ${currentDate}`
|
||||||
this.chatGPTApi = new ChatGPTAPI({
|
this.chatGPTApi = new ChatGPTAPI({
|
||||||
|
apiBaseUrl: Config.openAiBaseUrl,
|
||||||
apiKey: Config.apiKey,
|
apiKey: Config.apiKey,
|
||||||
debug: false,
|
debug: false,
|
||||||
upsertMessage,
|
upsertMessage,
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ export default {
|
||||||
// 以下为API方式(默认)的配置 *
|
// 以下为API方式(默认)的配置 *
|
||||||
// ***********************************************************************************************************************************
|
// ***********************************************************************************************************************************
|
||||||
apiKey: API_KEY,
|
apiKey: API_KEY,
|
||||||
|
// 如果有openai api的加速反代可以写
|
||||||
|
openAiBaseUrl: '',
|
||||||
// 模型名称,选填。如无特殊需求保持默认即可,会使用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: '',
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,12 @@ export function supportGuoba () {
|
||||||
bottomHelpMessage: 'OpenAI的ApiKey,用于访问OpenAI的API接口。',
|
bottomHelpMessage: 'OpenAI的ApiKey,用于访问OpenAI的API接口。',
|
||||||
component: 'InputPassword'
|
component: 'InputPassword'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'openAiBaseUrl',
|
||||||
|
label: 'OpenAI API服务器地址',
|
||||||
|
bottomHelpMessage: 'OpenAI的API服务器地址。默认为https://api.openai.com',
|
||||||
|
component: 'Input'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'model',
|
field: 'model',
|
||||||
label: '模型',
|
label: '模型',
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ const defaultConfig = {
|
||||||
cacheUrl: 'https://content.alcedogroup.com',
|
cacheUrl: 'https://content.alcedogroup.com',
|
||||||
cacheEntry: false,
|
cacheEntry: false,
|
||||||
apiKey: '',
|
apiKey: '',
|
||||||
|
openAiBaseUrl: '',
|
||||||
drawCD: 30,
|
drawCD: 30,
|
||||||
model: '',
|
model: '',
|
||||||
temperature: 0.8,
|
temperature: 0.8,
|
||||||
|
|
@ -33,7 +34,7 @@ const defaultConfig = {
|
||||||
debug: true,
|
debug: true,
|
||||||
defaultTimeoutMs: 120000,
|
defaultTimeoutMs: 120000,
|
||||||
chromeTimeoutMS: 120000,
|
chromeTimeoutMS: 120000,
|
||||||
version: '2.0.6'
|
version: '2.0.7'
|
||||||
}
|
}
|
||||||
const _path = process.cwd()
|
const _path = process.cwd()
|
||||||
let config = {}
|
let config = {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue