From f6207a51206dfc006ed1069a932b1eeb15440a22 Mon Sep 17 00:00:00 2001 From: Oren Zhang Date: Fri, 28 Jun 2024 15:32:19 +0800 Subject: [PATCH] feat: model desc --- src/components/ChatInput.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ChatInput.vue b/src/components/ChatInput.vue index 68b6e8f..0bd0ba0 100644 --- a/src/components/ChatInput.vue +++ b/src/components/ChatInput.vue @@ -44,6 +44,7 @@ const store = useStore(); // model const model = computed(() => store.state.currentModel); const modelName = ref(''); +const modelDesc = ref(''); const allModels = computed(() => store.state.models); const localModelKey = ref('local-model'); watch(() => allModels.value, () => { @@ -56,6 +57,7 @@ watch(() => allModels.value, () => { if (item.id === value) { store.commit('setCurrentModel', value); modelName.value = item.name; + modelDesc.value = item.desc; matched = true; } }); @@ -64,6 +66,7 @@ watch(() => allModels.value, () => { } store.commit('setCurrentModel', allModels.value[0].id); modelName.value = allModels.value[0].name; + modelDesc.value = allModels.value[0].desc; }, {deep: true, immediate: true}); watch(() => model.value, () => { if (!allModels.value.length) { @@ -73,6 +76,7 @@ watch(() => model.value, () => { allModels.value.forEach((item) => { if (item.id === model.value) { modelName.value = item.name; + modelDesc.value = item.desc; matched = true; } }); @@ -80,6 +84,7 @@ watch(() => model.value, () => { return; } modelName.value = model.value; + modelDesc.value = model.value.desc; }); // chat @@ -305,7 +310,7 @@ defineExpose({reGenerate, promptForm}); >