From 9d7ce207b689d2636465da8088a1d96c1275d27a Mon Sep 17 00:00:00 2001 From: Dean-YZG Date: Mon, 13 May 2024 17:11:35 +0800 Subject: [PATCH] feat: support env var DEFAULT_INPUT_TEMPLATE to custom default template for preprocessing user inputs --- app/store/config.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/store/config.ts b/app/store/config.ts index 0f9f78ed7..94cfcd8ec 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -164,6 +164,13 @@ export const useAppConfig = createPersistStore( state.lastUpdate = Date.now(); } + if (version < 3.9) { + state.modelConfig.template = + state.modelConfig.template !== DEFAULT_INPUT_TEMPLATE + ? state.modelConfig.template + : config?.template ?? DEFAULT_INPUT_TEMPLATE; + } + return state as any; }, },