fix: remove tink from ollama
This commit is contained in:
@@ -497,7 +497,7 @@ const genOpenRouter = ({
|
||||
};
|
||||
|
||||
const genOllama = ({
|
||||
think,
|
||||
// think,
|
||||
url,
|
||||
key,
|
||||
systemPrompt,
|
||||
@@ -523,7 +523,7 @@ const genOllama = ({
|
||||
],
|
||||
temperature,
|
||||
max_tokens: maxTokens,
|
||||
think,
|
||||
// think,
|
||||
stream: false,
|
||||
};
|
||||
|
||||
@@ -717,7 +717,7 @@ export const parseTransRes = async (
|
||||
toLang,
|
||||
langMap,
|
||||
resHook,
|
||||
thinkIgnore,
|
||||
// thinkIgnore,
|
||||
history,
|
||||
userMsg,
|
||||
apiType,
|
||||
@@ -811,7 +811,7 @@ export const parseTransRes = async (
|
||||
content: modelMsg.content,
|
||||
});
|
||||
}
|
||||
return parseAIRes(res?.choices?.[0]?.message?.content ?? "");
|
||||
return parseAIRes(modelMsg?.content);
|
||||
case OPT_TRANS_GEMINI:
|
||||
modelMsg = res?.candidates?.[0]?.content;
|
||||
if (history && userMsg && modelMsg) {
|
||||
@@ -832,12 +832,12 @@ export const parseTransRes = async (
|
||||
case OPT_TRANS_OLLAMA:
|
||||
modelMsg = res?.choices?.[0]?.message;
|
||||
|
||||
const deepModels = thinkIgnore
|
||||
.split(",")
|
||||
.filter((model) => model?.trim());
|
||||
if (deepModels.some((model) => res?.model?.startsWith(model))) {
|
||||
modelMsg?.content.replace(/<think>[\s\S]*<\/think>/i, "");
|
||||
}
|
||||
// const deepModels = thinkIgnore
|
||||
// .split(",")
|
||||
// .filter((model) => model?.trim());
|
||||
// if (deepModels.some((model) => res?.model?.startsWith(model))) {
|
||||
// modelMsg?.content.replace(/<think>[\s\S]*<\/think>/i, "");
|
||||
// }
|
||||
|
||||
if (history && userMsg && modelMsg) {
|
||||
history.add(userMsg, {
|
||||
|
||||
@@ -450,8 +450,8 @@ const defaultApi = {
|
||||
contextSize: DEFAULT_CONTEXT_SIZE, // 智能上下文保留会话数
|
||||
temperature: 0.0,
|
||||
maxTokens: 20480,
|
||||
think: false,
|
||||
thinkIgnore: "qwen3,deepseek-r1",
|
||||
// think: false, // (OpenAI 兼容接口未支持,暂时移除)
|
||||
// thinkIgnore: "qwen3,deepseek-r1", // (OpenAI 兼容接口未支持,暂时移除)
|
||||
isDisabled: false, // 是否不显示,
|
||||
region: "", // Azure 专用
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ import ReusableAutocomplete from "./ReusableAutocomplete";
|
||||
import ShowMoreButton from "./ShowMoreButton";
|
||||
import {
|
||||
OPT_TRANS_DEEPLX,
|
||||
OPT_TRANS_OLLAMA,
|
||||
// OPT_TRANS_OLLAMA,
|
||||
OPT_TRANS_CUSTOMIZE,
|
||||
OPT_TRANS_NIUTRANS,
|
||||
OPT_TRANS_BUILTINAI,
|
||||
@@ -168,8 +168,8 @@ function ApiFields({ apiSlug, isUserApi, deleteApi }) {
|
||||
// userPrompt = "",
|
||||
customHeader = "",
|
||||
customBody = "",
|
||||
think = false,
|
||||
thinkIgnore = "",
|
||||
// think = false,
|
||||
// thinkIgnore = "",
|
||||
fetchLimit = DEFAULT_FETCH_LIMIT,
|
||||
fetchInterval = DEFAULT_FETCH_INTERVAL,
|
||||
httpTimeout = DEFAULT_HTTP_TIMEOUT,
|
||||
@@ -337,7 +337,7 @@ function ApiFields({ apiSlug, isUserApi, deleteApi }) {
|
||||
</>
|
||||
)}
|
||||
|
||||
{apiType === OPT_TRANS_OLLAMA && (
|
||||
{/* {apiType === OPT_TRANS_OLLAMA && (
|
||||
<>
|
||||
<TextField
|
||||
select
|
||||
@@ -358,7 +358,7 @@ function ApiFields({ apiSlug, isUserApi, deleteApi }) {
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
)} */}
|
||||
|
||||
{apiType === OPT_TRANS_NIUTRANS && (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user