mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
IOS safari whisper support (#2870)
* fix: variables check * remove log * perf: safari whisper * feat: comment * perf: connetion check * doc
This commit is contained in:
@@ -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}
|
||||
|
@@ -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 (
|
||||
|
@@ -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');
|
||||
}
|
||||
|
Reference in New Issue
Block a user