Skip to content

Commit 1340129

Browse files
authored
IOS safari whisper support (#2870)
* fix: variables check * remove log * perf: safari whisper * feat: comment * perf: connetion check * doc
1 parent 8273c96 commit 1340129

File tree

5 files changed

+19
-13
lines changed
  • docSite/content/zh-cn/docs/development/upgrading
  • packages/service/core/workflow/dispatch/tools
  • projects/app/src

5 files changed

+19
-13
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ curl --location --request POST 'https://{{host}}/api/admin/init/4811' \
9494
--header 'Content-Type: application/json'
9595
```
9696

97-
会初始化成员组
97+
会初始化团队成员组
9898

9999
## V4.8.11 更新说明
100100

@@ -120,8 +120,9 @@ curl --location --request POST 'https://{{host}}/api/admin/init/4811' \
120120
20. 修复 - 工作流工具调用中修改全局变量后,无法传递到后续流程。
121121
21. 优化 - 流输出,切换浏览器 Tab 后仍可以继续输出。
122122
22. 优化 - 完善外部文件知识库相关 API
123-
23. 修复 - 知识库选择权限问题。
124-
24. 修复 - 空 chatId 发起对话,首轮携带用户选择时会异常。
125-
25. 修复 - createDataset 接口,intro 为赋值。
126-
26. 修复 - 对话框渲染性能问题。
127-
27. 修复 - 工具调用历史记录存储不正确。
123+
23. 优化 - IOS Safari 浏览器,语音输入不准确。
124+
24. 修复 - 知识库选择权限问题。
125+
25. 修复 - 空 chatId 发起对话,首轮携带用户选择时会异常。
126+
26. 修复 - createDataset 接口,intro 为赋值。
127+
27. 修复 - 对话框渲染性能问题。
128+
28. 修复 - 工具调用历史记录存储不正确。

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
184184
}
185185
})();
186186

187+
// Just show
187188
const formattedRequestBody: Record<string, any> = (() => {
188189
if (requestBody instanceof FormData || requestBody instanceof URLSearchParams) {
189190
return Object.fromEntries(requestBody);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ const ChatInput = ({
286286
/>
287287
<Flex alignItems={'center'} position={'absolute'} right={[2, 4]} bottom={['10px', '12px']}>
288288
{/* voice-input */}
289-
{whisperConfig.open && !havInput && !isChatting && !!whisperModel && (
289+
{whisperConfig.open && !inputValue && !isChatting && !!whisperModel && (
290290
<>
291291
<canvas
292292
ref={canvasRef}

projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/Handle/ToolHandle.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ export const ToolTargetHandle = ({ show, nodeId }: ToolHandleProps) => {
2323
const connected = edges.some((edge) => edge.target === nodeId && edge.targetHandle === handleId);
2424

2525
// if top handle is connected, return null
26-
const showHandle =
27-
connected || (show && connectingEdge?.handleId === NodeOutputKeyEnum.selectedTools);
26+
const showHandle = connectingEdge
27+
? show && connectingEdge.handleId === NodeOutputKeyEnum.selectedTools
28+
: connected;
2829

2930
const Render = useMemo(() => {
3031
return (

projects/app/src/web/common/hooks/useSpeech.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,13 @@ export const useSpeech = (props?: OutLinkChatAuthProps & { appId?: string }) =>
8585
if (!cancelWhisperSignal.current) {
8686
const formData = new FormData();
8787
let options = {};
88-
if (MediaRecorder.isTypeSupported('audio/webm')) {
89-
options = { type: 'audio/webm' };
90-
} else if (MediaRecorder.isTypeSupported('video/mp3')) {
91-
options = { type: 'video/mp3' };
88+
89+
if (MediaRecorder.isTypeSupported('video/webm; codecs=vp9')) {
90+
options = { mimeType: 'video/webm; codecs=vp9' };
91+
} else if (MediaRecorder.isTypeSupported('video/webm')) {
92+
options = { type: 'video/webm' };
93+
} else if (MediaRecorder.isTypeSupported('video/mp4')) {
94+
options = { mimeType: 'video/mp4', videoBitsPerSecond: 100000 };
9295
} else {
9396
console.error('no suitable mimetype found for this device');
9497
}

0 commit comments

Comments
 (0)