From 438bc973a2af28ebd8a124b12ff6e2d42cd522fd Mon Sep 17 00:00:00 2001 From: geekgeekrun Date: Sun, 13 Apr 2025 13:47:01 +0800 Subject: [PATCH] adjust ui text; add more intro; add 3rd list about apply a secret --- .../flow/OPEN_SETTING_WINDOW/ipc/index.ts | 6 -- packages/ui/src/main/utils/initPublicIpc.ts | 7 +- .../src/renderer/src/page/LlmConfig/index.vue | 100 +++++++++++++++++- .../page/MainLayout/ReadNoReplyReminder.vue | 30 ++---- 4 files changed, 109 insertions(+), 34 deletions(-) diff --git a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts index 3804e49..008b34e 100644 --- a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts +++ b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts @@ -40,12 +40,6 @@ import { } from '../../READ_NO_REPLY_AUTO_REMINDER/boss-operation' export default function initIpc() { - ipcMain.on('open-external-link', (_, link) => { - shell.openExternal(link, { - activate: true - }) - }) - ipcMain.handle('fetch-config-file-content', async () => { const configFileContentList = configFileNameList.map((fileName) => { return readConfigFile(fileName) diff --git a/packages/ui/src/main/utils/initPublicIpc.ts b/packages/ui/src/main/utils/initPublicIpc.ts index be8f2ef..4d8ea11 100644 --- a/packages/ui/src/main/utils/initPublicIpc.ts +++ b/packages/ui/src/main/utils/initPublicIpc.ts @@ -1,4 +1,4 @@ -import { BrowserWindow, ipcMain } from 'electron' +import { BrowserWindow, ipcMain, shell } from 'electron' export default function initPublicIpc() { ipcMain.on( @@ -18,4 +18,9 @@ export default function initPublicIpc() { win.setSize(size.width, size.height, size.animate) } ) + ipcMain.on('open-external-link', (_, link) => { + shell.openExternal(link, { + activate: true + }) + }) } diff --git a/packages/ui/src/renderer/src/page/LlmConfig/index.vue b/packages/ui/src/renderer/src/page/LlmConfig/index.vue index 7b1594f..fa6a02e 100644 --- a/packages/ui/src/renderer/src/page/LlmConfig/index.vue +++ b/packages/ui/src/renderer/src/page/LlmConfig/index.vue @@ -3,8 +3,52 @@
- 大语言模型设置 +
+
大语言模型设置
+ + 申请 API Secret + + +
+ +
    +
  • + 请确保当前服务商提供的模型支持对话补全且兼容 + OpenAI SDK +
  • +
  • 暂不支持推理模型(例如 DeepSeek-R1)
  • +
  • + 请自行确保您所接入的服务商能够保护您的隐私。此处所列举“服务商-模型”由第三方提供,仅供配置参考,不能保证它们能够合法使用您的数据,不表示本程序认可相关模型 +
  • +
+
- + 添加其它服务 + 添加其它模型,以生成更随机的内容
取消 @@ -236,6 +282,26 @@ const llmPresetList: { enabled: true } }, + { + name: '由 火山引擎 提供的 DeepSeek-V3 模型', + config: { + model: 'deepseek-v3-250324', + providerApiSecret: '', + providerCompleteApiUrl: 'https://ark.cn-beijing.volces.com/api/v3', + serveWeight: 100, + enabled: true + } + }, + { + name: '由 阿里云百炼 提供的 DeepSeek-V3 模型', + config: { + model: 'deepseek-v3', + providerApiSecret: '', + providerCompleteApiUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1', + serveWeight: 100, + enabled: true + } + }, // TODO: // { // name: '通过 Ollama 部署的 DeepSeek-R1(14B)模型', @@ -269,6 +335,29 @@ const llmPresetList: { } ] +const providerList: Array<{ name: string; url: string }> = [ + { + name: 'DeepSeek', + url: 'https://platform.deepseek.com/' + }, + { + name: '火山引擎 - 火山方舟', + url: 'https://console.volcengine.com/ark' + }, + { + name: '阿里云百炼', + url: 'https://bailian.console.aliyun.com/?tab=model#/api-key' + }, + { + name: 'OpenAI (国内可能不可用)', + url: 'https://platform.openai.com/api-keys' + }, + { + name: 'FREE-CHATGPT-API (免费)', + url: 'https://github.com/popjane/free_chatgpt_api' + } +] + function handlePresetClick(selected: (typeof llmPresetList)[number], index) { for (const k of Object.keys(formContent.value[index])) { formContent.value[index][k] = selected.config[k] @@ -306,7 +395,7 @@ watch( if (nVal <= 1) { electron.ipcRenderer.send('update-window-size', { width: window.innerWidth, - height: 360 + height: 500 }) } else { electron.ipcRenderer.send('update-window-size', { @@ -319,6 +408,9 @@ watch( immediate: true } ) +const openExternalLink = (url) => { + electron.ipcRenderer.send('open-external-link', url) +} // function handleTestAvailability() {} diff --git a/packages/ui/src/renderer/src/page/MainLayout/ReadNoReplyReminder.vue b/packages/ui/src/renderer/src/page/MainLayout/ReadNoReplyReminder.vue index 6c27904..a17583a 100644 --- a/packages/ui/src/renderer/src/page/MainLayout/ReadNoReplyReminder.vue +++ b/packages/ui/src/renderer/src/page/MainLayout/ReadNoReplyReminder.vue @@ -53,16 +53,7 @@ style="background-color: #462ac4" >Qwen2.5 - 模型,通过对话补全接口实现消息生成;支持多个“服务商-模型”组合按权重搭配使用 + 模型;支持多个“服务商-模型”组合按权重搭配使用
@@ -80,14 +71,14 @@
- 使用外部编辑器编辑 Prompt 模板 + 使用外部编辑器编辑提示词模板 - 还原默认 Prompt 模板 + 还原默认提示词模板
- 对生成效果不够满意?可在此查看、编辑 Prompt 模板。请在模板中需要插入简历的位置插入 + 对生成效果不够满意?可在此查看、编辑提示词模板。请在模板中需要插入简历的位置插入 __REPLACE_REAL_RESUME_HERE__
@@ -228,9 +219,9 @@ const handleSubmit = async () => { await electron.ipcRenderer.invoke('check-if-auto-remind-prompt-valid') } catch (err) { if (err?.message?.includes(`RESUME_PLACEHOLDER_NOT_EXIST`)) { - console.log(`Prompt 模板无效`, err) + console.log(`提示词模板无效`, err) ElMessageBox.confirm( - 'Prompt 模板缺少简历内容占位符:
__REPLACE_REAL_RESUME_HERE__

您是否希望还原默认的 Prompt 模板?', + '提示词模板缺少简历内容占位符:
__REPLACE_REAL_RESUME_HERE__

您是否希望还原默认的提示词模板?', '', { confirmButtonText: '是', @@ -247,7 +238,7 @@ const handleSubmit = async () => { } else { ElMessage({ type: 'error', - message: '用于生成自动提醒消息的 Prompt 检查未通过,请重试' + message: '用于生成自动提醒消息的提示词检查未通过,请重试' }) } return @@ -314,13 +305,6 @@ const handleClickEditResume = async () => { const handleClickEditPrompt = async () => { await electron.ipcRenderer.send('no-reply-reminder-prompt-edit') } - -const openIntroOfCompletion = () => { - electron.ipcRenderer.send( - 'open-external-link', - 'https://api-docs.deepseek.com/zh-cn/api/create-chat-completion' - ) -}