diff --git a/apps/chat.js b/apps/chat.js index 89adb0d..e8f5015 100644 --- a/apps/chat.js +++ b/apps/chat.js @@ -1964,8 +1964,6 @@ export class chatgpt extends plugin { new KickOutTool(), new WeatherTool(), new SendPictureTool(), - - new ImageCaptionTool(), serpTool ] let img = [] @@ -1989,7 +1987,8 @@ export class chatgpt extends plugin { if (e.img) { img.push(...e.img) } - if (img.length > 0) { + if (img.length > 0 && Config.extraUrl) { + tools.push(new ImageCaptionTool()) prompt += `\nthe url of the picture(s) above: ${img.join(', ')}` } else { tools.push(new SerpImageTool()) diff --git a/guoba.support.js b/guoba.support.js index 719e914..9a76c7e 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -813,6 +813,12 @@ export function supportGuoba () { ] } }, + { + field: 'extraUrl', + label: '额外工具url', + bottomHelpMessage: '(测试期间提供一个公益接口,一段时间后撤掉)参考搭建:https://github.com/ikechan8370/chatgpt-plugin-extras', + component: 'Input' + } ], // 获取配置数据方法(用于前端填充显示数据) getConfigData () { diff --git a/utils/config.js b/utils/config.js index 92044fa..d50e42e 100644 --- a/utils/config.js +++ b/utils/config.js @@ -128,7 +128,7 @@ const defaultConfig = { amapKey: '', azSerpKey: '', serpSource: 'ikechan8370', - extraUrl: '', + extraUrl: 'https://cpe.ikechan8370.com', version: 'v2.7.0' } const _path = process.cwd()