ollama接口设置增加<think>块忽略参数
This commit is contained in:
@@ -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(/<think>[\s\S]*<\/think>/i, '');
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user