From db4bcfc5d6aea23e0c28056ebf2ae32295c12bae Mon Sep 17 00:00:00 2001 From: Brian Yang Date: Sun, 28 Apr 2024 11:59:57 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E5=B8=B8=E7=94=A8=E7=9A=84OpenAI=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=8F=8A=E5=85=B6=E6=8F=8F=E8=BF=B0=20&=20=E7=8E=B0=E5=9C=A8?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E9=80=9A=E8=BF=87tooltip=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E6=98=BE=E7=A4=BAModelInfo=E4=B8=ADdesc=E7=9A=84=E5=86=85?= =?UTF-8?q?=E5=AE=B9=20(#269)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../openai_model_provider.py | 35 ++++++- .../template/component/CreateModelDialog.vue | 96 +++++++------------ ui/src/views/template/component/EditModel.vue | 89 ++++++----------- 3 files changed, 93 insertions(+), 127 deletions(-) diff --git a/apps/setting/models_provider/impl/openai_model_provider/openai_model_provider.py b/apps/setting/models_provider/impl/openai_model_provider/openai_model_provider.py index aab6ac08cc3..983561b95a1 100644 --- a/apps/setting/models_provider/impl/openai_model_provider/openai_model_provider.py +++ b/apps/setting/models_provider/impl/openai_model_provider/openai_model_provider.py @@ -57,12 +57,39 @@ def encryption_dict(self, model: Dict[str, object]): openai_llm_model_credential = OpenAILLMModelCredential() model_dict = { - 'gpt-3.5-turbo': ModelInfo('gpt-3.5-turbo', '', ModelTypeConst.LLM, openai_llm_model_credential, + 'gpt-3.5-turbo': ModelInfo('gpt-3.5-turbo', '最新的gpt-3.5-turbo,随OpenAI调整而更新', ModelTypeConst.LLM, + openai_llm_model_credential, ), - 'gpt-3.5-turbo-0613': ModelInfo('gpt-3.5-turbo-0613', '', ModelTypeConst.LLM, openai_llm_model_credential, + 'gpt-3.5-turbo-0125': ModelInfo('gpt-3.5-turbo-0125', + '2024年1月25日的gpt-3.5-turbo快照,支持上下文长度16,385 tokens', ModelTypeConst.LLM, + openai_llm_model_credential, + ), + 'gpt-3.5-turbo-1106': ModelInfo('gpt-3.5-turbo-1106', + '2023年11月6日的gpt-3.5-turbo快照,支持上下文长度16,385 tokens', ModelTypeConst.LLM, + openai_llm_model_credential, + ), + 'gpt-3.5-turbo-0613': ModelInfo('gpt-3.5-turbo-0613', + '[Legacy] 2023年6月13日的gpt-3.5-turbo快照,将于2024年6月13日弃用', + ModelTypeConst.LLM, openai_llm_model_credential, + ), + 'gpt-4': ModelInfo('gpt-4', '最新的gpt-4,随OpenAI调整而更新', ModelTypeConst.LLM, openai_llm_model_credential, + ), + 'gpt-4-turbo': ModelInfo('gpt-4-turbo', '最新的gpt-4-turbo,随OpenAI调整而更新', ModelTypeConst.LLM, + openai_llm_model_credential, + ), + 'gpt-4-turbo-preview': ModelInfo('gpt-4-turbo-preview', '最新的gpt-4-turbo-preview,随OpenAI调整而更新', + ModelTypeConst.LLM, openai_llm_model_credential, + ), + 'gpt-4-turbo-2024-04-09': ModelInfo('gpt-4-turbo-2024-04-09', + '2024年4月9日的gpt-4-turbo快照,支持上下文长度128,000 tokens', + ModelTypeConst.LLM, openai_llm_model_credential, + ), + 'gpt-4-0125-preview': ModelInfo('gpt-4-0125-preview', '2024年1月25日的gpt-4-turbo快照,支持上下文长度128,000 tokens', + ModelTypeConst.LLM, openai_llm_model_credential, + ), + 'gpt-4-1106-preview': ModelInfo('gpt-4-1106-preview', '2023年11月6日的gpt-4-turbo快照,支持上下文长度128,000 tokens', + ModelTypeConst.LLM, openai_llm_model_credential, ), - 'gpt-4': ModelInfo('gpt-4', '', ModelTypeConst.LLM, openai_llm_model_credential, - ) } diff --git a/ui/src/views/template/component/CreateModelDialog.vue b/ui/src/views/template/component/CreateModelDialog.vue index 3741c0d488c..b62d0a3ffb4 100644 --- a/ui/src/views/template/component/CreateModelDialog.vue +++ b/ui/src/views/template/component/CreateModelDialog.vue @@ -1,37 +1,18 @@ @@ -204,6 +171,7 @@ const list_base_model = (model_type: any) => { ) } } + const close = () => { base_form_data.value = { name: '', model_type: '', model_name: '' } credential_form_data.value = {} diff --git a/ui/src/views/template/component/EditModel.vue b/ui/src/views/template/component/EditModel.vue index 07b81508d3c..18503e468b0 100644 --- a/ui/src/views/template/component/EditModel.vue +++ b/ui/src/views/template/component/EditModel.vue @@ -1,31 +1,16 @@