Skip to content

Commit 3b3cf3a

Browse files
committed
fix: whisper checker
1 parent e2e4b5c commit 3b3cf3a

File tree

7 files changed

+12
-46
lines changed

7 files changed

+12
-46
lines changed

docSite/content/zh-cn/docs/development/upgrading/4822.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ weight: 802
1313
1. 新增 - AI 对话节点解析 <think></think> 标签内容,便于各类模型进行思考链输出。
1414
2. 修复 - 思考链流输出时,有时与正文顺序偏差。
1515
3. 修复 - API 调用工作流,如果传递的图片不支持 Head 检测时,图片会被过滤。已增加该类错误检测,避免被错误过滤。
16-
4. 修复 - 模板市场部分模板错误。
16+
4. 修复 - 模板市场部分模板错误。
17+
5. 修复 - 免登录窗口无法正常判断语言识别是否开启。

packages/service/core/workflow/dispatch/tools/http468.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -398,41 +398,6 @@ async function fetchData({
398398
};
399399
}
400400

401-
// function replaceVariable(text: string, obj: Record<string, any>) {
402-
// for (const [key, value] of Object.entries(obj)) {
403-
// if (value === undefined) {
404-
// text = text.replace(new RegExp(`{{(${key})}}`, 'g'), UNDEFINED_SIGN);
405-
// } else {
406-
// const replacement = JSON.stringify(value);
407-
// const unquotedReplacement =
408-
// replacement.startsWith('"') && replacement.endsWith('"')
409-
// ? replacement.slice(1, -1)
410-
// : replacement;
411-
// text = text.replace(new RegExp(`{{(${key})}}`, 'g'), () => unquotedReplacement);
412-
// }
413-
// }
414-
// return text || '';
415-
// }
416-
// function removeUndefinedSign(obj: Record<string, any>) {
417-
// for (const key in obj) {
418-
// if (obj[key] === UNDEFINED_SIGN) {
419-
// obj[key] = undefined;
420-
// } else if (Array.isArray(obj[key])) {
421-
// obj[key] = obj[key].map((item: any) => {
422-
// if (item === UNDEFINED_SIGN) {
423-
// return undefined;
424-
// } else if (typeof item === 'object') {
425-
// removeUndefinedSign(item);
426-
// }
427-
// return item;
428-
// });
429-
// } else if (typeof obj[key] === 'object') {
430-
// removeUndefinedSign(obj[key]);
431-
// }
432-
// }
433-
// return obj;
434-
// }
435-
436401
// Replace some special response from system plugin
437402
async function replaceSystemPluginResponse({
438403
response,

packages/web/i18n/en/common.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
"core.app.tip.Add a intro to app": "Give the app an introduction",
370370
"core.app.tip.chatNodeSystemPromptTip": "Enter a prompt here",
371371
"core.app.tip.systemPromptTip": "Fixed guide words for the model. By adjusting this content, you can guide the model's chat direction. This content will be fixed at the beginning of the context. You can use / to insert variables.\nIf a Dataset is associated, you can also guide the model when to call the Dataset search by appropriate description. For example:\nYou are an assistant for the movie 'Interstellar'. When users ask about content related to 'Interstellar', please search the Dataset and answer based on the search results.",
372-
"core.app.tip.variableTip": "Before the conversation starts, you can ask the user to fill in some content as specific variables for this round of conversation. This module is located after the opening guide.\nVariables can be injected into other modules' string type inputs in the form of {{variable key}}, such as prompts, delimiters, etc.",
372+
"core.app.tip.variableTip": "Before the conversation begins, users can be asked to fill in some content as specific variables for this round of conversation. \nThis module is located after the opening boot.\n\nIn the input box, you can select variables through / activation, such as: prompt words, qualifiers, etc.",
373373
"core.app.tip.welcomeTextTip": "Before each conversation starts, send an initial content. Supports standard Markdown syntax. Additional tags that can be used:\n[Quick Key]: Users can directly send the question by clicking",
374374
"core.app.tool_label.doc": "Documentation",
375375
"core.app.tool_label.github": "GitHub Address",
@@ -941,9 +941,9 @@
941941
"model_moka": "Moka-AI",
942942
"model_moonshot": "Moonshot",
943943
"model_other": "Other",
944+
"model_ppio": "PPIO",
944945
"model_qwen": "Qwen",
945946
"model_siliconflow": "Siliconflow",
946-
"model_ppio": "PPIO",
947947
"model_sparkdesk": "SprkDesk",
948948
"model_stepfun": "StepFun",
949949
"model_yi": "Yi",

packages/web/i18n/zh-CN/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@
372372
"core.app.tip.Add a intro to app": "快来给应用一个介绍~",
373373
"core.app.tip.chatNodeSystemPromptTip": "在此输入提示词",
374374
"core.app.tip.systemPromptTip": "模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可通过输入 / 插入选择变量\n如果关联了知识库,你还可以通过适当的描述,来引导模型何时去调用知识库搜索。例如:\n你是电影《星际穿越》的助手,当用户询问与《星际穿越》相关的内容时,请搜索知识库并结合搜索结果进行回答。",
375-
"core.app.tip.variableTip": "可以在对话开始前,要求用户填写一些内容作为本轮对话的特定变量。该模块位于开场引导之后。\n变量可以通过 {{变量key}} 的形式注入到其他模块 string 类型的输入中,例如:提示词、限定词等",
375+
"core.app.tip.variableTip": "可以在对话开始前,要求用户填写一些内容作为本轮对话的特定变量。该模块位于开场引导之后。\n输入框中,可通过 / 激活变量选择,例如:提示词、限定词等",
376376
"core.app.tip.welcomeTextTip": "每次对话开始前,发送一个初始内容。支持标准 Markdown 语法,可使用的额外标记:\n[快捷按键]:用户点击后可以直接发送该问题",
377377
"core.app.tool_label.doc": "使用文档",
378378
"core.app.tool_label.github": "GitHub地址",

packages/web/i18n/zh-Hant/common.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@
368368
"core.app.tip.Add a intro to app": "快來為應用程式寫一個介紹",
369369
"core.app.tip.chatNodeSystemPromptTip": "在此輸入提示詞",
370370
"core.app.tip.systemPromptTip": "模型固定的引導詞,透過調整此內容,可以引導模型對話方向。此內容會固定在上下文的開頭。可透過輸入 / 插入變數。\n如果關聯了知識庫,您還可以透過適當的描述,引導模型何時去呼叫知識庫搜尋。例如:\n您是電影《星際效應》的助手,當使用者詢問與《星際效應》相關的內容時,請搜尋知識庫並根據搜尋結果回答。",
371-
"core.app.tip.variableTip": "可以在對話開始前,要求使用者填寫一些內容作為本輪對話的特定變數。此模組位於開場引導之後。\n變數可以透過 {{變數 key}} 的形式注入到其他模組的字串類型輸入中,例如:提示詞、分隔符等",
371+
"core.app.tip.variableTip": "可以在對話開始前,要求用戶填寫一些內容作為本輪對話的特定變量。\n該模塊位於開場引導之後。\n\n輸入框中,可通過 / 激活變量選擇,例如:提示詞、限定詞等",
372372
"core.app.tip.welcomeTextTip": "每次對話開始前,傳送一段初始內容。支援標準 Markdown 語法。可使用的額外標記:\n[快速按鍵]:使用者點選後可以直接傳送該問題",
373373
"core.app.tool_label.doc": "使用文件",
374374
"core.app.tool_label.github": "GitHub 網址",
@@ -940,9 +940,9 @@
940940
"model_moka": "Moka-AI",
941941
"model_moonshot": "月之暗面",
942942
"model_other": "其他",
943+
"model_ppio": "PPIO 派歐雲",
943944
"model_qwen": "阿里千問",
944945
"model_siliconflow": "矽基流動",
945-
"model_ppio": "PPIO 派歐雲",
946946
"model_sparkdesk": "訊飛星火",
947947
"model_stepfun": "階躍星辰",
948948
"model_yi": "零一萬物",

projects/app/src/components/core/chat/ChatContainer/ChatBox/Input/ChatInput.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ const ChatInput = ({
107107
);
108108

109109
/* whisper init */
110-
const { sttModelList } = useSystemStore();
111110
const canvasRef = useRef<HTMLCanvasElement>(null);
112111
const {
113112
isSpeaking,
@@ -293,7 +292,7 @@ const ChatInput = ({
293292
/>
294293
<Flex alignItems={'center'} position={'absolute'} right={[2, 4]} bottom={['10px', '12px']}>
295294
{/* voice-input */}
296-
{whisperConfig.open && !inputValue && !isChatting && sttModelList.length > 0 && (
295+
{whisperConfig?.open && !inputValue && !isChatting && (
297296
<>
298297
<canvas
299298
ref={canvasRef}
@@ -430,8 +429,7 @@ const ChatInput = ({
430429
speakingTimeString,
431430
stopSpeak,
432431
t,
433-
whisperConfig.open,
434-
sttModelList
432+
whisperConfig?.open
435433
]
436434
);
437435

projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderOutput/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const RenderOutput = ({
5858
}
5959
});
6060
});
61+
// eslint-disable-next-line react-hooks/exhaustive-deps
6162
}, [copyOutputs, nodeId, inputs, llmModelList]);
6263

6364
const [editField, setEditField] = useState<FlowNodeOutputItemType>();
@@ -154,6 +155,7 @@ const RenderOutput = ({
154155
(item) =>
155156
item.type !== FlowNodeOutputTypeEnum.dynamic && item.type !== FlowNodeOutputTypeEnum.hidden
156157
);
158+
157159
return (
158160
<>
159161
{renderOutputs.map((output, i) => {
@@ -163,7 +165,7 @@ const RenderOutput = ({
163165
required={output.required}
164166
position={'relative'}
165167
_notLast={{
166-
mb: 4
168+
mb: i !== renderOutputs.length - 1 ? 4 : 0
167169
}}
168170
>
169171
<OutputLabel nodeId={nodeId} output={output} />

0 commit comments

Comments
 (0)