Skip to content

Commit

Permalink
IOS safari whisper support (labring#2870)
Browse files Browse the repository at this point in the history
* fix: variables check

* remove log

* perf: safari whisper

* feat: comment

* perf: connetion check

* doc
  • Loading branch information
c121914yu authored Oct 10, 2024
1 parent 8273c96 commit 1340129
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
13 changes: 7 additions & 6 deletions docSite/content/zh-cn/docs/development/upgrading/4811.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ curl --location --request POST 'https://{{host}}/api/admin/init/4811' \
--header 'Content-Type: application/json'
```

会初始化成员组
会初始化团队成员组

## V4.8.11 更新说明

Expand All @@ -120,8 +120,9 @@ curl --location --request POST 'https://{{host}}/api/admin/init/4811' \
20. 修复 - 工作流工具调用中修改全局变量后,无法传递到后续流程。
21. 优化 - 流输出,切换浏览器 Tab 后仍可以继续输出。
22. 优化 - 完善外部文件知识库相关 API
23. 修复 - 知识库选择权限问题。
24. 修复 - 空 chatId 发起对话,首轮携带用户选择时会异常。
25. 修复 - createDataset 接口,intro 为赋值。
26. 修复 - 对话框渲染性能问题。
27. 修复 - 工具调用历史记录存储不正确。
23. 优化 - IOS Safari 浏览器,语音输入不准确。
24. 修复 - 知识库选择权限问题。
25. 修复 - 空 chatId 发起对话,首轮携带用户选择时会异常。
26. 修复 - createDataset 接口,intro 为赋值。
27. 修复 - 对话框渲染性能问题。
28. 修复 - 工具调用历史记录存储不正确。
1 change: 1 addition & 0 deletions packages/service/core/workflow/dispatch/tools/http468.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
}
})();

// Just show
const formattedRequestBody: Record<string, any> = (() => {
if (requestBody instanceof FormData || requestBody instanceof URLSearchParams) {
return Object.fromEntries(requestBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ const ChatInput = ({
/>
<Flex alignItems={'center'} position={'absolute'} right={[2, 4]} bottom={['10px', '12px']}>
{/* voice-input */}
{whisperConfig.open && !havInput && !isChatting && !!whisperModel && (
{whisperConfig.open && !inputValue && !isChatting && !!whisperModel && (
<>
<canvas
ref={canvasRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export const ToolTargetHandle = ({ show, nodeId }: ToolHandleProps) => {
const connected = edges.some((edge) => edge.target === nodeId && edge.targetHandle === handleId);

// if top handle is connected, return null
const showHandle =
connected || (show && connectingEdge?.handleId === NodeOutputKeyEnum.selectedTools);
const showHandle = connectingEdge
? show && connectingEdge.handleId === NodeOutputKeyEnum.selectedTools
: connected;

const Render = useMemo(() => {
return (
Expand Down
11 changes: 7 additions & 4 deletions projects/app/src/web/common/hooks/useSpeech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ export const useSpeech = (props?: OutLinkChatAuthProps & { appId?: string }) =>
if (!cancelWhisperSignal.current) {
const formData = new FormData();
let options = {};
if (MediaRecorder.isTypeSupported('audio/webm')) {
options = { type: 'audio/webm' };
} else if (MediaRecorder.isTypeSupported('video/mp3')) {
options = { type: 'video/mp3' };

if (MediaRecorder.isTypeSupported('video/webm; codecs=vp9')) {
options = { mimeType: 'video/webm; codecs=vp9' };
} else if (MediaRecorder.isTypeSupported('video/webm')) {
options = { type: 'video/webm' };
} else if (MediaRecorder.isTypeSupported('video/mp4')) {
options = { mimeType: 'video/mp4', videoBitsPerSecond: 100000 };
} else {
console.error('no suitable mimetype found for this device');
}
Expand Down

0 comments on commit 1340129

Please sign in to comment.