|
|
|
|
@ -37,10 +37,11 @@
|
|
|
|
|
placeholder="选择AI模型"
|
|
|
|
|
size="small"
|
|
|
|
|
popper-class="topIndex"
|
|
|
|
|
style="width: 120px"
|
|
|
|
|
style="width: 150px"
|
|
|
|
|
:teleported="true"
|
|
|
|
|
append-to="body"
|
|
|
|
|
:disabled="aiThinking"
|
|
|
|
|
@change="onModelChange"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="model in aiModelList"
|
|
|
|
|
@ -163,7 +164,7 @@
|
|
|
|
|
@click="toggleRecording"
|
|
|
|
|
:class="['recording-btn', { 'recording': isRecording }]"
|
|
|
|
|
v-loading="audioAsrLoading"
|
|
|
|
|
:disabled="!canSend || aiThinking"
|
|
|
|
|
:disabled="aiThinking"
|
|
|
|
|
circle
|
|
|
|
|
type="primary"
|
|
|
|
|
>
|
|
|
|
|
@ -214,6 +215,8 @@ import {AiFormSettingVO, AiFormSettingDetailVO} from '@/api/ai/base/aiFormSettin
|
|
|
|
|
import {aiFillForm, recognizeSpeechByUrl, uploadFile} from '@/api/ai/skill/aiAssistant';
|
|
|
|
|
import router from "@/router"
|
|
|
|
|
import {useSharedDataStore} from '@/api/monitorData'
|
|
|
|
|
import {getAiModelJoinList} from "@/api/ai/skill/aiChat";
|
|
|
|
|
import {AIModelVO} from "@/api/ai/skill/aiChat/types";
|
|
|
|
|
|
|
|
|
|
const sharedStore = useSharedDataStore()
|
|
|
|
|
|
|
|
|
|
@ -406,9 +409,41 @@ defineExpose({
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getAiModelList = async () => {
|
|
|
|
|
// loading.value = true;
|
|
|
|
|
const res = await getAiModelJoinList({modelTypeId: 1});
|
|
|
|
|
aiModelList.value = res.data;
|
|
|
|
|
await setDefaultAiModel();
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// platformList.value = res.data;
|
|
|
|
|
// loading.value = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const setDefaultAiModel = async () => {
|
|
|
|
|
aiModelList.value.forEach((item: AIModelVO) => {
|
|
|
|
|
if (item.defaultFlag === "1") {
|
|
|
|
|
// alert(JSON.stringify(item))
|
|
|
|
|
selectedModelId.value = item.modelId;
|
|
|
|
|
selectedPlatformId.value = item.platformId;
|
|
|
|
|
// provider.value = item.platformCode;
|
|
|
|
|
// console.log(item.platformIcon)
|
|
|
|
|
// platformIcon.value = item.platformIcon;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onModelChange() {
|
|
|
|
|
const model = aiModelList.value.find(m => m.modelId === selectedModelId.value)
|
|
|
|
|
if (model) {
|
|
|
|
|
selectedPlatformId.value = model.platformId
|
|
|
|
|
// platformIcon.value = model.platformIcon;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
watch(state, (newVal) => {
|
|
|
|
|
if (newVal.isShowSearch) {
|
|
|
|
|
loadForms()
|
|
|
|
|
getAiModelList();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@ -471,7 +506,7 @@ const handleSend = async (selectedText?: string) => {
|
|
|
|
|
formSettingId: selectedFormSettingId.value,
|
|
|
|
|
formSettingDetailList: aiFormSettingDetailListMap.value[selectedFormSettingId.value],
|
|
|
|
|
modelId: selectedModelId.value,
|
|
|
|
|
platformId: 1
|
|
|
|
|
platformId: selectedPlatformId.value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// chatList.value.push({
|
|
|
|
|
@ -978,7 +1013,8 @@ const aiModelList = ref([
|
|
|
|
|
{ modelId: 3, modelName: 'Claude-3' },
|
|
|
|
|
{ modelId: 4, modelName: 'Gemini-Pro' }
|
|
|
|
|
])
|
|
|
|
|
const selectedModelId = ref(1) // 默认选择第一个模型
|
|
|
|
|
const selectedModelId = ref() // AI模型ID
|
|
|
|
|
const selectedPlatformId = ref() // AI平台ID
|
|
|
|
|
|
|
|
|
|
// 新增:更多弹窗过滤输入
|
|
|
|
|
const moreFilterText = ref('')
|
|
|
|
|
|