From 331d18c88fc0ad7e5ef7dd23d9265758efd57ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E4=BA=86=E7=9D=A1=E5=A4=A7=E8=A7=89?= <64798754+stakeswky@users.noreply.github.com> Date: Fri, 5 Jan 2024 12:58:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dm3e=E5=90=91=E9=87=8F?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=AD=97=E7=AC=A6=E4=B8=B2=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#693)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/service/core/ai/embedding/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/service/core/ai/embedding/index.ts b/packages/service/core/ai/embedding/index.ts index 501130923..88edfa74b 100644 --- a/packages/service/core/ai/embedding/index.ts +++ b/packages/service/core/ai/embedding/index.ts @@ -25,7 +25,9 @@ export async function getVectorsByText({ } } } - + if (typeof input === 'string') { + input = [input]; + } try { // 获取 chatAPI const ai = getAIApi();