From 315b16ac0d113f4c9358e77a60109aa1bfc8e23b Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Thu, 14 Dec 2023 17:31:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/GoogleGeminiClient.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/GoogleGeminiClient.js b/client/GoogleGeminiClient.js index abe6d69..cdc63c8 100644 --- a/client/GoogleGeminiClient.js +++ b/client/GoogleGeminiClient.js @@ -13,6 +13,9 @@ try { } export class GoogleGeminiClient extends BaseClient { constructor (props) { + if (!GoogleGenerativeAI) { + throw new Error('未安装@google/generative-ai,无法使用Gemini,请在chatgpt-plugin目录下执行pnpm i安装新依赖') + } if (!props.upsertMessage) { props.upsertMessage = async function umGemini (message) { return await upsertMessage(message, 'Gemini')