From 987ddf5f0fdd4626a426a481b82674c2351af570 Mon Sep 17 00:00:00 2001 From: Hk-Gosuto Date: Mon, 21 Aug 2023 23:55:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E7=89=88=E6=9C=AC=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++-- app/components/chat.tsx | 7 ++++--- app/store/chat.ts | 2 +- app/store/config.ts | 2 +- app/store/mask.ts | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ed6510f4f..315aa7466 100644 --- a/README.md +++ b/README.md @@ -62,12 +62,14 @@ - [x] 支持 Agent 参数配置( ~~agentType~~, maxIterations, returnIntermediateSteps 等) - [x] 支持 ChatSession 级别插件功能开关 - 仅在使用 `0613` 版本模型时会出现插件开关,其它模型默认为关闭状态,开关也不会显示。 + 仅在使用非 `0301` 和 `0314` 版本模型时会出现插件开关,其它模型默认为关闭状态,开关也不会显示。 ## 已知问题 -- [x] 使用插件时需将模型切换为 `0613` 版本模型,如:`gpt-3.5-turbo-0613` +- [x] ~~使用插件时需将模型切换为 `0613` 版本模型,如:`gpt-3.5-turbo-0613`~~ 尝试使用 `chat-conversational-react-description` 等类型的 `agent` 使用插件时效果并不理想,不再考虑支持其它版本的模型。 + + 限制修改为非 `0301` 和 `0314` 模型均可调用插件。 [#10](https://github.com/Hk-Gosuto/ChatGPT-Next-Web-LangChain/issues/10) - [x] `SERPAPI_API_KEY` 目前为必填,后续会支持使用 DuckDuckGo 替换搜索插件 - [x] Agent 不支持自定义接口地址 - [x] ~~部分场景下插件会调用失败~~ diff --git a/app/components/chat.tsx b/app/components/chat.tsx index ba9c909f8..eea14c40b 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -511,7 +511,7 @@ export function ChatActions(props: { icon={} /> - {config.pluginConfig.enable && currentModel.endsWith("0613") && ( + {config.pluginConfig.enable && !/03\d{2}$/.test(currentModel) && ( { session.mask.modelConfig.model = s[0] as ModelType; session.mask.syncGlobalConfig = false; - session.mask.usePlugins = - session.mask.modelConfig.model.endsWith("0613"); + session.mask.usePlugins = !/03\d{2}$/.test( + session.mask.modelConfig.model, + ); }); showToast(s[0]); }} diff --git a/app/store/chat.ts b/app/store/chat.ts index d38d188b5..d7f0335ee 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -577,7 +577,7 @@ export const useChatStore = create()( api.llm.chat({ messages: topicMessages, config: { - model: "gpt-3.5-turbo-0613", + model: "gpt-3.5-turbo", }, onFinish(message) { get().updateCurrentSession( diff --git a/app/store/config.ts b/app/store/config.ts index 19e77eb5b..b535e8d6d 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -39,7 +39,7 @@ export const DEFAULT_CONFIG = { models: DEFAULT_MODELS as any as LLMModel[], modelConfig: { - model: "gpt-3.5-turbo-0613" as ModelType, + model: "gpt-3.5-turbo" as ModelType, temperature: 0.5, top_p: 1, max_tokens: 2000, diff --git a/app/store/mask.ts b/app/store/mask.ts index 117a6b3c3..d29c8fda7 100644 --- a/app/store/mask.ts +++ b/app/store/mask.ts @@ -47,7 +47,7 @@ export const createEmptyMask = () => lang: getLang(), builtin: false, createdAt: Date.now(), - usePlugins: useAppConfig.getState().modelConfig.model.endsWith("0613"), + usePlugins: !/03\d{2}$/.test(useAppConfig.getState().modelConfig.model), } as Mask); export const useMaskStore = create()(