feat: Supports pronunciation while outputting text #2088 (#2227)

### What problem does this PR solve?

feat: Supports pronunciation while outputting text #2088

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-09-03 19:47:50 +08:00
committed by GitHub
parent 87a998e9e5
commit 07de36ec86
7 changed files with 68 additions and 8 deletions

View File

@ -22,12 +22,14 @@ interface IProps {
content: string;
prompt?: string;
showLikeButton: boolean;
audioBinary?: string;
}
export const AssistantGroupButton = ({
messageId,
content,
prompt,
audioBinary,
showLikeButton,
}: IProps) => {
const { visible, hideModal, showModal, onFeedbackOk, loading } =
@ -38,7 +40,7 @@ export const AssistantGroupButton = ({
showModal: showPromptModal,
} = useSetModalState();
const { t } = useTranslation();
const { handleRead, ref, isPlaying } = useSpeech(content);
const { handleRead, ref, isPlaying } = useSpeech(content, audioBinary);
const handleLike = useCallback(() => {
onFeedbackOk({ thumbup: true });