From 878fda0054b525d89e63ada06469c31e7a3349f5 Mon Sep 17 00:00:00 2001 From: Rafi Date: Fri, 17 Mar 2023 17:01:18 +0800 Subject: [PATCH] Support configuring model parameters in the front-end and storing them in localStorage. --- components/ModelParameters.vue | 191 +++++++++++++++++++++++++++++++++ lang/en-US.json | 7 ++ lang/zh-CN.json | 7 ++ layouts/default.vue | 2 + pages/index.vue | 16 +-- utils/enums.js | 13 ++- utils/localStorage.js | 18 ++-- 7 files changed, 234 insertions(+), 20 deletions(-) create mode 100644 components/ModelParameters.vue diff --git a/components/ModelParameters.vue b/components/ModelParameters.vue new file mode 100644 index 0000000..3c54f34 --- /dev/null +++ b/components/ModelParameters.vue @@ -0,0 +1,191 @@ + + + + + \ No newline at end of file diff --git a/lang/en-US.json b/lang/en-US.json index 07da319..d55b4ca 100644 --- a/lang/en-US.json +++ b/lang/en-US.json @@ -18,6 +18,13 @@ "feedback": "Feedback", "newConversation": "New conversation", "clearConversations": "Clear conversations", + "modelParameters": "Model Parameters", + "model": "Model", + "temperature": "Temperature", + "topP": "Top P", + "frequencyPenalty": "Frequency Penalty", + "presencePenalty": "Presence Penalty", + "maxTokens": "Max Tokens", "roles": { "me": "Me", "ai": "AI" diff --git a/lang/zh-CN.json b/lang/zh-CN.json index 8848229..b7ebe42 100644 --- a/lang/zh-CN.json +++ b/lang/zh-CN.json @@ -18,6 +18,13 @@ "feedback": "反馈", "newConversation": "新的对话", "clearConversations": "清除对话", + "modelParameters": "模型参数", + "model": "模型", + "temperature": "Temperature", + "topP": "Top P", + "frequencyPenalty": "Frequency Penalty", + "presencePenalty": "Presence Penalty", + "maxTokens": "Max Tokens", "roles": { "me": "我", "ai": "AI" diff --git a/layouts/default.vue b/layouts/default.vue index 1460007..1cb6ad1 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -228,6 +228,8 @@ onNuxtReady(async () => { + +