diff --git a/src/apis/index.js b/src/apis/index.js index a35e726..cb7416b 100644 --- a/src/apis/index.js +++ b/src/apis/index.js @@ -39,6 +39,7 @@ import { import { sha256 } from "../libs/utils"; import interpreter from "../libs/interpreter"; import { msAuth } from "../libs/auth"; +import {getSettingWithDefault } from "../libs/storage"; /** * 同步数据 @@ -323,7 +324,8 @@ export const apiTranslate = async ({ case OPT_TRANS_OLLAMA: case OPT_TRANS_OLLAMA_2: case OPT_TRANS_OLLAMA_3: - const deepModels = ['deepseek-r1', 'qwen3']; + let deepModels = (await getSettingWithDefault()).transApis[translator]?.thinkIgnore || ''; + deepModels = deepModels.split(',').filter(model => model.trim() !== ''); if (deepModels.some(model => res?.model?.startsWith(model))) { trText = res?.response.replace(/[\s\S]*<\/think>/i, ''); }else{ diff --git a/src/config/i18n.js b/src/config/i18n.js index 908e9e0..f69ae44 100644 --- a/src/config/i18n.js +++ b/src/config/i18n.js @@ -186,6 +186,10 @@ export const I18N = { zh: `最大并发请求数量 (1-100)`, en: `Maximum Number Of Concurrent Requests (1-100)`, }, + think_ignore: { + zh: `忽略以下模型的输出,逗号(,)分割`, + en: `Ignore the block for the following models, comma (,) separated`, + }, fetch_interval: { zh: `每次请求间隔时间 (0-5000ms)`, en: `Time Between Requests (0-5000ms)`, diff --git a/src/config/index.js b/src/config/index.js index 2d65bef..94e0c01 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -541,6 +541,7 @@ const defaultOllamaApi = { model: "llama3.1", systemPrompt: `You are a professional, authentic machine translation engine.`, userPrompt: `Translate the following source text from ${INPUT_PLACE_FROM} to ${INPUT_PLACE_TO}. Output translation directly without any additional text.\n\nSource Text: ${INPUT_PLACE_TEXT}\n\nTranslated Text:`, + thinkIgnore:`qwen3,deepseek-r1`, fetchLimit: 1, fetchInterval: 500, }; diff --git a/src/views/Options/Apis.js b/src/views/Options/Apis.js index 55f17fc..af66062 100644 --- a/src/views/Options/Apis.js +++ b/src/views/Options/Apis.js @@ -117,6 +117,7 @@ function ApiFields({ translator }) { model = "", systemPrompt = "", userPrompt = "", + thinkIgnore = "", fetchLimit = DEFAULT_FETCH_LIMIT, fetchInterval = DEFAULT_FETCH_INTERVAL, dictNo = "", @@ -246,6 +247,18 @@ function ApiFields({ translator }) { )} + {(translator.startsWith(OPT_TRANS_OLLAMA)) && ( + <> + + + )} + {(translator.startsWith(OPT_TRANS_OPENAI) || translator === OPT_TRANS_CLAUDE) && ( <>