fix: remove tink from ollama

This commit is contained in:
Gabe
2025-10-30 20:07:01 +08:00
parent e83c1eb017
commit 97676f114e
3 changed files with 17 additions and 17 deletions

View File

@@ -497,7 +497,7 @@ const genOpenRouter = ({
}; };
const genOllama = ({ const genOllama = ({
think, // think,
url, url,
key, key,
systemPrompt, systemPrompt,
@@ -523,7 +523,7 @@ const genOllama = ({
], ],
temperature, temperature,
max_tokens: maxTokens, max_tokens: maxTokens,
think, // think,
stream: false, stream: false,
}; };
@@ -717,7 +717,7 @@ export const parseTransRes = async (
toLang, toLang,
langMap, langMap,
resHook, resHook,
thinkIgnore, // thinkIgnore,
history, history,
userMsg, userMsg,
apiType, apiType,
@@ -811,7 +811,7 @@ export const parseTransRes = async (
content: modelMsg.content, content: modelMsg.content,
}); });
} }
return parseAIRes(res?.choices?.[0]?.message?.content ?? ""); return parseAIRes(modelMsg?.content);
case OPT_TRANS_GEMINI: case OPT_TRANS_GEMINI:
modelMsg = res?.candidates?.[0]?.content; modelMsg = res?.candidates?.[0]?.content;
if (history && userMsg && modelMsg) { if (history && userMsg && modelMsg) {
@@ -832,12 +832,12 @@ export const parseTransRes = async (
case OPT_TRANS_OLLAMA: case OPT_TRANS_OLLAMA:
modelMsg = res?.choices?.[0]?.message; modelMsg = res?.choices?.[0]?.message;
const deepModels = thinkIgnore // const deepModels = thinkIgnore
.split(",") // .split(",")
.filter((model) => model?.trim()); // .filter((model) => model?.trim());
if (deepModels.some((model) => res?.model?.startsWith(model))) { // if (deepModels.some((model) => res?.model?.startsWith(model))) {
modelMsg?.content.replace(/<think>[\s\S]*<\/think>/i, ""); // modelMsg?.content.replace(/<think>[\s\S]*<\/think>/i, "");
} // }
if (history && userMsg && modelMsg) { if (history && userMsg && modelMsg) {
history.add(userMsg, { history.add(userMsg, {

View File

@@ -450,8 +450,8 @@ const defaultApi = {
contextSize: DEFAULT_CONTEXT_SIZE, // 智能上下文保留会话数 contextSize: DEFAULT_CONTEXT_SIZE, // 智能上下文保留会话数
temperature: 0.0, temperature: 0.0,
maxTokens: 20480, maxTokens: 20480,
think: false, // think: false, // (OpenAI 兼容接口未支持,暂时移除)
thinkIgnore: "qwen3,deepseek-r1", // thinkIgnore: "qwen3,deepseek-r1", // (OpenAI 兼容接口未支持,暂时移除)
isDisabled: false, // 是否不显示, isDisabled: false, // 是否不显示,
region: "", // Azure 专用 region: "", // Azure 专用
}; };

View File

@@ -27,7 +27,7 @@ import ReusableAutocomplete from "./ReusableAutocomplete";
import ShowMoreButton from "./ShowMoreButton"; import ShowMoreButton from "./ShowMoreButton";
import { import {
OPT_TRANS_DEEPLX, OPT_TRANS_DEEPLX,
OPT_TRANS_OLLAMA, // OPT_TRANS_OLLAMA,
OPT_TRANS_CUSTOMIZE, OPT_TRANS_CUSTOMIZE,
OPT_TRANS_NIUTRANS, OPT_TRANS_NIUTRANS,
OPT_TRANS_BUILTINAI, OPT_TRANS_BUILTINAI,
@@ -168,8 +168,8 @@ function ApiFields({ apiSlug, isUserApi, deleteApi }) {
// userPrompt = "", // userPrompt = "",
customHeader = "", customHeader = "",
customBody = "", customBody = "",
think = false, // think = false,
thinkIgnore = "", // thinkIgnore = "",
fetchLimit = DEFAULT_FETCH_LIMIT, fetchLimit = DEFAULT_FETCH_LIMIT,
fetchInterval = DEFAULT_FETCH_INTERVAL, fetchInterval = DEFAULT_FETCH_INTERVAL,
httpTimeout = DEFAULT_HTTP_TIMEOUT, httpTimeout = DEFAULT_HTTP_TIMEOUT,
@@ -337,7 +337,7 @@ function ApiFields({ apiSlug, isUserApi, deleteApi }) {
</> </>
)} )}
{apiType === OPT_TRANS_OLLAMA && ( {/* {apiType === OPT_TRANS_OLLAMA && (
<> <>
<TextField <TextField
select select
@@ -358,7 +358,7 @@ function ApiFields({ apiSlug, isUserApi, deleteApi }) {
onChange={handleChange} onChange={handleChange}
/> />
</> </>
)} )} */}
{apiType === OPT_TRANS_NIUTRANS && ( {apiType === OPT_TRANS_NIUTRANS && (
<> <>