From de2820ecf2f3bd43ab13aa79fc95a474e56875ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=91=E8=BD=BB=E7=8B=82?= <1677568218@qq.com> Date: Thu, 31 Aug 2023 01:55:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E8=80=A6LLM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/motion/chain/chain.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/motion/chain/chain.ts b/package/motion/chain/chain.ts index 72ee950..0db77ee 100644 --- a/package/motion/chain/chain.ts +++ b/package/motion/chain/chain.ts @@ -8,6 +8,7 @@ import { TypeScriptChain, } from "@idealeap/gwt"; export interface chainSchema { + llm?: LLM; llmSchema?: createLLMSchema; chainName?: string; } @@ -27,8 +28,8 @@ export class Chain { chainName?: string; chain: FunctionChain | TypeScriptChain; constructor(params: chainSchema) { - const { llmSchema, chainName } = params; - this.llm = new LLM(llmSchema || {}); + const { llmSchema, chainName, llm } = params; + this.llm = llm || new LLM(llmSchema || {}); this.chainName = chainName || ""; switch (this.chainName) { case "typeChat":