diff --git a/src/views/setting/AccountSettingSystem.vue b/src/views/setting/AccountSettingSystem.vue index 8f59195a..debc4a2f 100644 --- a/src/views/setting/AccountSettingSystem.vue +++ b/src/views/setting/AccountSettingSystem.vue @@ -119,6 +119,10 @@ const progressDialog = ref(false) // 高级设置对话框 const advancedDialog = ref(false) +// LLM 模型列表 +const llmModels = ref([]) +const loadingModels = ref(false) + const activeTab = ref('system') // 元数据语言 @@ -154,6 +158,32 @@ const logLevelItems = [ // 安全域名添加变量 const newSecurityDomain = ref('') +// 加载LLM模型列表 +async function loadLlmModels() { + loadingModels.value = true + try { + const result: { [key: string]: any } = await api.get('system/llm-models', { + params: { + provider: SystemSettings.value.Basic.LLM_PROVIDER, + api_key: SystemSettings.value.Basic.LLM_API_KEY, + base_url: SystemSettings.value.Basic.LLM_BASE_URL, + }, + }) + + if (result.success) { + llmModels.value = result.data + if (llmModels.value.length > 0) + SystemSettings.value.Basic.LLM_MODEL = llmModels.value[0] + } + else { + $toast.error(result.message) + } + } catch (error) { + console.log(error) + } + loadingModels.value = false +} + // 添加安全域名 function addSecurityDomain() { if ( @@ -637,14 +667,26 @@ onDeactivated(() => { /> - + > + +