mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
feat: add support for configurable reverse proxy url
This commit is contained in:
parent
58e1d00453
commit
11f35af89e
2 changed files with 6 additions and 1 deletions
|
|
@ -347,7 +347,7 @@ export class chatgpt extends plugin {
|
||||||
const clientOptions = {
|
const clientOptions = {
|
||||||
// (Optional) Support for a reverse proxy for the completions endpoint (private API server).
|
// (Optional) Support for a reverse proxy for the completions endpoint (private API server).
|
||||||
// Warning: This will expose your `openaiApiKey` to a third-party. Consider the risks before using this.
|
// Warning: This will expose your `openaiApiKey` to a third-party. Consider the risks before using this.
|
||||||
reverseProxyUrl: 'https://chatgpt.pawan.krd/api/completions',
|
reverseProxyUrl: Config.reverseProxy || 'https://chatgpt.pawan.krd/api/completions',
|
||||||
// (Optional) Parameters as described in https://platform.openai.com/docs/api-reference/completions
|
// (Optional) Parameters as described in https://platform.openai.com/docs/api-reference/completions
|
||||||
modelOptions: {
|
modelOptions: {
|
||||||
// You can override the model name and any other parameters here.
|
// You can override the model name and any other parameters here.
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,11 @@ export const Config = {
|
||||||
// ***********************************************************************************************************************************
|
// ***********************************************************************************************************************************
|
||||||
// 如果购买了plus,改为true将使用收费模型,响应更快
|
// 如果购买了plus,改为true将使用收费模型,响应更快
|
||||||
plus: false,
|
plus: false,
|
||||||
|
// 使用谁提供的第三方API。github开源的有几个,没特别要求保持默认就好
|
||||||
|
// https://chatgpt.pawan.krd/api/completions 来自https://github.com/PawanOsman 使用Cloudflare CDN,三网延迟可能都较高。目前看起来最稳定
|
||||||
|
// https://chatgpt.roki.best/api/completions 对上面那个的二次反代,搭建在Hong Kong(本人自建,不保证稳定性)
|
||||||
|
// https://chatgpt.hato.ai/completions 来自https://github.com/waylaidwanderer(本插件使用的chatgpt库之一的作者)
|
||||||
|
reverseProxy: 'https://chatgpt.pawan.krd/api/completions',
|
||||||
// ***********************************************************************************************************************************
|
// ***********************************************************************************************************************************
|
||||||
// 以下为API/API2方式公用的配置 *
|
// 以下为API/API2方式公用的配置 *
|
||||||
// ***********************************************************************************************************************************
|
// ***********************************************************************************************************************************
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue