From a70b25987ebe6a061f71149f74cb20ca008c71e4 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Sun, 25 Jun 2023 00:37:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=92=8C=E4=B8=80=E4=B8=AA=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E5=85=AC=E5=85=B1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/chat.js | 5 ++--- guoba.support.js | 6 ++++++ utils/config.js | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) 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()