refactor: deepModels -> tinkIgnore
This commit is contained in:
@@ -39,7 +39,6 @@ import {
|
|||||||
import { sha256 } from "../libs/utils";
|
import { sha256 } from "../libs/utils";
|
||||||
import interpreter from "../libs/interpreter";
|
import interpreter from "../libs/interpreter";
|
||||||
import { msAuth } from "../libs/auth";
|
import { msAuth } from "../libs/auth";
|
||||||
import {getSettingWithDefault } from "../libs/storage";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步数据
|
* 同步数据
|
||||||
@@ -324,8 +323,8 @@ export const apiTranslate = async ({
|
|||||||
case OPT_TRANS_OLLAMA:
|
case OPT_TRANS_OLLAMA:
|
||||||
case OPT_TRANS_OLLAMA_2:
|
case OPT_TRANS_OLLAMA_2:
|
||||||
case OPT_TRANS_OLLAMA_3:
|
case OPT_TRANS_OLLAMA_3:
|
||||||
let deepModels = (await getSettingWithDefault()).transApis[translator]?.thinkIgnore || '';
|
const { thinkIgnore = "" } = apiSetting;
|
||||||
deepModels = deepModels.split(',').filter(model => model.trim() !== '');
|
const deepModels = thinkIgnore.split(',').filter(model => model.trim());
|
||||||
if (deepModels.some(model => res?.model?.startsWith(model))) {
|
if (deepModels.some(model => res?.model?.startsWith(model))) {
|
||||||
trText = res?.response.replace(/<think>[\s\S]*<\/think>/i, '');
|
trText = res?.response.replace(/<think>[\s\S]*<\/think>/i, '');
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ function ApiFields({ translator }) {
|
|||||||
model = "",
|
model = "",
|
||||||
systemPrompt = "",
|
systemPrompt = "",
|
||||||
userPrompt = "",
|
userPrompt = "",
|
||||||
think="",
|
think = false,
|
||||||
thinkIgnore = "",
|
thinkIgnore = "",
|
||||||
fetchLimit = DEFAULT_FETCH_LIMIT,
|
fetchLimit = DEFAULT_FETCH_LIMIT,
|
||||||
fetchInterval = DEFAULT_FETCH_INTERVAL,
|
fetchInterval = DEFAULT_FETCH_INTERVAL,
|
||||||
|
|||||||
Reference in New Issue
Block a user