diff --git a/.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch b/.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch index cf4219719c..d79275839c 100644 --- a/.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch +++ b/.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch @@ -37,3 +37,49 @@ index 7d19f5578040afa004bc887aab1725e8703d2bac..59ec725b6142299a62798ac4bdedb63b if (status === 400) { return new BadRequestError(status, error, message, headers); } +diff --git a/resources/embeddings.js b/resources/embeddings.js +index aae578404cb2d09a39ac33fc416f1c215c45eecd..25c54b05bdae64d5c3b36fbb30dc7c8221b14034 100644 +--- a/resources/embeddings.js ++++ b/resources/embeddings.js +@@ -36,6 +36,9 @@ class Embeddings extends resource_1.APIResource { + // No encoding_format specified, defaulting to base64 for performance reasons + // See https://github.com/openai/openai-node/pull/1312 + let encoding_format = hasUserProvidedEncodingFormat ? body.encoding_format : 'base64'; ++ if (body.model.includes('jina')) { ++ encoding_format = undefined; ++ } + if (hasUserProvidedEncodingFormat) { + Core.debug('Request', 'User defined encoding_format:', body.encoding_format); + } +@@ -47,7 +50,7 @@ class Embeddings extends resource_1.APIResource { + ...options, + }); + // if the user specified an encoding_format, return the response as-is +- if (hasUserProvidedEncodingFormat) { ++ if (hasUserProvidedEncodingFormat || body.model.includes('jina')) { + return response; + } + // in this stage, we are sure the user did not specify an encoding_format +diff --git a/resources/embeddings.mjs b/resources/embeddings.mjs +index 0df3c6cc79a520e54acb4c2b5f77c43b774035ff..aa488b8a11b2c413c0a663d9a6059d286d7b5faf 100644 +--- a/resources/embeddings.mjs ++++ b/resources/embeddings.mjs +@@ -10,6 +10,9 @@ export class Embeddings extends APIResource { + // No encoding_format specified, defaulting to base64 for performance reasons + // See https://github.com/openai/openai-node/pull/1312 + let encoding_format = hasUserProvidedEncodingFormat ? body.encoding_format : 'base64'; ++ if (body.model.includes('jina')) { ++ encoding_format = undefined; ++ } + if (hasUserProvidedEncodingFormat) { + Core.debug('Request', 'User defined encoding_format:', body.encoding_format); + } +@@ -21,7 +24,7 @@ export class Embeddings extends APIResource { + ...options, + }); + // if the user specified an encoding_format, return the response as-is +- if (hasUserProvidedEncodingFormat) { ++ if (hasUserProvidedEncodingFormat || body.model.includes('jina')) { + return response; + } + // in this stage, we are sure the user did not specify an encoding_format diff --git a/scripts/update-i18n.ts b/scripts/update-i18n.ts index 2140f4ceff..3af6084384 100644 --- a/scripts/update-i18n.ts +++ b/scripts/update-i18n.ts @@ -1,16 +1,16 @@ /** - * OCOOL_API_KEY=sk-abcxxxxxxxxxxxxxxxxxxxxxxx123 ts-node scripts/update-i18n.ts + * Paratera_API_KEY=sk-abcxxxxxxxxxxxxxxxxxxxxxxx123 ts-node scripts/update-i18n.ts */ // OCOOL API KEY -const OCOOL_API_KEY = process.env.OCOOL_API_KEY +const Paratera_API_KEY = process.env.Paratera_API_KEY const INDEX = [ // 语言的名称 代码 用来翻译的模型 - { name: 'France', code: 'fr-fr', model: 'qwen2.5-32b-instruct' }, - { name: 'Spanish', code: 'es-es', model: 'qwen2.5-32b-instruct' }, - { name: 'Portuguese', code: 'pt-pt', model: 'qwen2.5-72b-instruct' }, - { name: 'Greek', code: 'el-gr', model: 'qwen-turbo' } + { name: 'France', code: 'fr-fr', model: 'Qwen3-235B-A22B' }, + { name: 'Spanish', code: 'es-es', model: 'Qwen3-235B-A22B' }, + { name: 'Portuguese', code: 'pt-pt', model: 'Qwen3-235B-A22B' }, + { name: 'Greek', code: 'el-gr', model: 'Qwen3-235B-A22B' } ] const fs = require('fs') @@ -19,8 +19,8 @@ import OpenAI from 'openai' const zh = JSON.parse(fs.readFileSync('src/renderer/src/i18n/locales/zh-cn.json', 'utf8')) as object const openai = new OpenAI({ - apiKey: OCOOL_API_KEY, - baseURL: 'https://one.ocoolai.com/v1' + apiKey: Paratera_API_KEY, + baseURL: 'https://llmapi.paratera.com/v1' }) // 递归遍历翻译 diff --git a/src/renderer/src/components/Popups/SelectModelPopup/popup.tsx b/src/renderer/src/components/Popups/SelectModelPopup/popup.tsx index ffaac877ea..fbf8529122 100644 --- a/src/renderer/src/components/Popups/SelectModelPopup/popup.tsx +++ b/src/renderer/src/components/Popups/SelectModelPopup/popup.tsx @@ -267,11 +267,7 @@ const PopupContainer: React.FC = ({ model, resolve }) => { // 处理键盘导航 const handleKeyDown = useCallback( (e: KeyboardEvent) => { - if (!open) return - - if (modelItems.length === 0) { - return - } + if (!open || modelItems.length === 0 || e.isComposing) return // 键盘操作时禁用鼠标 hover if (['ArrowUp', 'ArrowDown', 'PageUp', 'PageDown', 'Enter', 'Escape'].includes(e.key)) { diff --git a/src/renderer/src/components/WebdavBackupManager.tsx b/src/renderer/src/components/WebdavBackupManager.tsx index fd42449fee..7d9753a59b 100644 --- a/src/renderer/src/components/WebdavBackupManager.tsx +++ b/src/renderer/src/components/WebdavBackupManager.tsx @@ -254,6 +254,7 @@ export function WebdavBackupManager({ visible, onClose, webdavConfig, restoreMet open={visible} onCancel={onClose} width={800} + centered footer={[