Skip to content

Commit

Permalink
Merge pull request #27 from OVINC-CN/feat_model_desc
Browse files Browse the repository at this point in the history
feat: model desc
  • Loading branch information
OrenZhang authored Jun 28, 2024
2 parents 2d7b550 + f6207a5 commit aa68002
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/ChatInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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, () => {
Expand All @@ -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;
}
});
Expand All @@ -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) {
Expand All @@ -73,13 +76,15 @@ watch(() => model.value, () => {
allModels.value.forEach((item) => {
if (item.id === model.value) {
modelName.value = item.name;
modelDesc.value = item.desc;
matched = true;
}
});
if (matched) {
return;
}
modelName.value = model.value;
modelDesc.value = model.value.desc;
});
// chat
Expand Down Expand Up @@ -305,7 +310,7 @@ defineExpose({reGenerate, promptForm});
>
<a-textarea
v-model="promptForm.content"
:placeholder="model ? ($t('CurrentModel') + ': ' + modelName) : $t('NoModelChoosed')"
:placeholder="model ? ($t('CurrentModel') + ': ' + modelName + '\n' + (modelDesc ? modelDesc : '')) : $t('NoModelChoosed')"
:auto-size="{minRows: 6, maxRows: 6}"
:disabled="chatLoading"
@keydown="onKeydown"
Expand Down

0 comments on commit aa68002

Please sign in to comment.