Merge pull request #235 from unclemcz/dev

feat:基本设置增加请求超时参数&ollama接口配置增加<think>块忽略参数
This commit is contained in:
Gabe
2025-05-09 14:09:18 +08:00
committed by GitHub
6 changed files with 53 additions and 5 deletions

View File

@@ -186,6 +186,10 @@ export const I18N = {
zh: `最大并发请求数量 (1-100)`,
en: `Maximum Number Of Concurrent Requests (1-100)`,
},
think_ignore: {
zh: `忽略以下模型的<think>输出,逗号(,)分割`,
en: `Ignore the <think> block for the following models, comma (,) separated`,
},
fetch_interval: {
zh: `每次请求间隔时间 (0-5000ms)`,
en: `Time Between Requests (0-5000ms)`,
@@ -194,6 +198,10 @@ export const I18N = {
zh: `重新翻译间隔时间 (100-5000ms)`,
en: `Retranslation Interval (100-5000ms)`,
},
http_timeout: {
zh: `请求超时时间 (5000-30000ms)`,
en: `Request Timeout Time (5000-30000ms)`,
},
min_translate_length: {
zh: `最小翻译字符数 (1-100)`,
en: `Minimum number Of Translated Characters (1-100)`,

View File

@@ -543,6 +543,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,
};
@@ -643,6 +644,7 @@ export const DEFAULT_SHORTCUTS = {
export const TRANS_MIN_LENGTH = 5; // 最短翻译长度
export const TRANS_MAX_LENGTH = 5000; // 最长翻译长度
export const TRANS_NEWLINE_LENGTH = 20; // 换行字符数
export const HTTP_TIMEOUT = 5000; // 调用超时时间
export const DEFAULT_BLACKLIST = [
"https://fishjar.github.io/kiss-translator/options.html",
"https://translate.google.com",
@@ -660,6 +662,7 @@ export const DEFAULT_SETTING = {
minLength: TRANS_MIN_LENGTH,
maxLength: TRANS_MAX_LENGTH,
newlineLength: TRANS_NEWLINE_LENGTH,
httpTimeout: HTTP_TIMEOUT,
clearCache: false, // 是否在浏览器下次启动时清除缓存
injectRules: true, // 是否注入订阅规则
// injectWebfix: true, // 是否注入修复补丁(作废)