mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: Supports text output and sound output #1877 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -36,12 +36,5 @@ export default defineConfig({
|
|||||||
logger: console,
|
logger: console,
|
||||||
// pathRewrite: { '^/v1': '/v1' },
|
// pathRewrite: { '^/v1': '/v1' },
|
||||||
},
|
},
|
||||||
'/HPImageArchive': {
|
|
||||||
target: 'https://cn.bing.com/',
|
|
||||||
changeOrigin: true,
|
|
||||||
ws: true,
|
|
||||||
logger: console,
|
|
||||||
// pathRewrite: { '^/v1': '/v1' },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { useSetModalState } from '@/hooks/common-hooks';
|
|||||||
import { IRemoveMessageById, useSpeechWithSse } from '@/hooks/logic-hooks';
|
import { IRemoveMessageById, useSpeechWithSse } from '@/hooks/logic-hooks';
|
||||||
import { IFeedbackRequestBody } from '@/interfaces/request/chat';
|
import { IFeedbackRequestBody } from '@/interfaces/request/chat';
|
||||||
import { getMessagePureId } from '@/utils/chat';
|
import { getMessagePureId } from '@/utils/chat';
|
||||||
|
import { hexStringToUint8Array } from '@/utils/common-util';
|
||||||
import { SpeechPlayer } from 'openai-speech-stream-player';
|
import { SpeechPlayer } from 'openai-speech-stream-player';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
@ -94,14 +95,14 @@ export const useSpeech = (content: string, audioBinary?: string) => {
|
|||||||
}
|
}
|
||||||
}, [setIsPlaying, speech, isPlaying, pause]);
|
}, [setIsPlaying, speech, isPlaying, pause]);
|
||||||
|
|
||||||
// useEffect(() => {
|
useEffect(() => {
|
||||||
// if (audioBinary) {
|
if (audioBinary) {
|
||||||
// const units = hexStringToUint8Array(audioBinary);
|
const units = hexStringToUint8Array(audioBinary);
|
||||||
// if (units) {
|
if (units) {
|
||||||
// player.current?.feed(units);
|
player.current?.feed(units);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }, [audioBinary]);
|
}, [audioBinary]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initialize();
|
initialize();
|
||||||
|
|||||||
@ -362,9 +362,9 @@ The above is the content you need to summarize.`,
|
|||||||
The 'knowledge' is a very special variable which will be filled-in with the retrieved chunks.
|
The 'knowledge' is a very special variable which will be filled-in with the retrieved chunks.
|
||||||
All the variables in 'System' should be curly bracketed.`,
|
All the variables in 'System' should be curly bracketed.`,
|
||||||
add: 'Add',
|
add: 'Add',
|
||||||
key: 'key',
|
key: 'Key',
|
||||||
optional: 'Optional',
|
optional: 'Optional',
|
||||||
operation: 'operation',
|
operation: 'Operation',
|
||||||
model: 'Model',
|
model: 'Model',
|
||||||
modelTip: 'Large language chat model',
|
modelTip: 'Large language chat model',
|
||||||
modelMessage: 'Please select!',
|
modelMessage: 'Please select!',
|
||||||
@ -642,7 +642,7 @@ The above is the content you need to summarize.`,
|
|||||||
'Loop is the upper limit of the number of loops of the current component, when the number of loops exceeds the value of loop, it means that the component can not complete the current task, please re-optimize agent',
|
'Loop is the upper limit of the number of loops of the current component, when the number of loops exceeds the value of loop, it means that the component can not complete the current task, please re-optimize agent',
|
||||||
yes: 'Yes',
|
yes: 'Yes',
|
||||||
no: 'No',
|
no: 'No',
|
||||||
key: 'key',
|
key: 'Key',
|
||||||
componentId: 'Component ID',
|
componentId: 'Component ID',
|
||||||
add: 'Add',
|
add: 'Add',
|
||||||
operation: 'operation',
|
operation: 'operation',
|
||||||
|
|||||||
@ -99,7 +99,7 @@ const AssistantSetting = ({ show }: ISegmentedContentProps) => {
|
|||||||
>
|
>
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item> */}
|
</Form.Item> */}
|
||||||
{/* <Form.Item
|
<Form.Item
|
||||||
label={t('tts')}
|
label={t('tts')}
|
||||||
valuePropName="checked"
|
valuePropName="checked"
|
||||||
name={['prompt_config', 'tts']}
|
name={['prompt_config', 'tts']}
|
||||||
@ -107,7 +107,7 @@ const AssistantSetting = ({ show }: ISegmentedContentProps) => {
|
|||||||
initialValue={false}
|
initialValue={false}
|
||||||
>
|
>
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item> */}
|
</Form.Item>
|
||||||
<KnowledgeBaseItem></KnowledgeBaseItem>
|
<KnowledgeBaseItem></KnowledgeBaseItem>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user