From 180443bfbf35980023df4e3df1eb37e5d2e54cd0 Mon Sep 17 00:00:00 2001
From: zstar <65890619+zstar1003@users.noreply.github.com>
Date: Sat, 7 Jun 2025 15:16:46 +0800
Subject: [PATCH] =?UTF-8?q?chores:=20=E7=A7=BB=E9=99=A4=E5=AF=B9=E8=AF=9D?=
=?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=97=A0=E7=94=A8=E7=9A=84tts=E3=80=81?=
=?UTF-8?q?=E7=82=B9=E8=B5=9E=E5=92=8C=E5=8F=8D=E9=A6=88=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 删除了消息项中的点赞和反馈功能
- 移除了聊天配置中的 TTS 设置
---
.../components/message-item/group-button.tsx | 40 ++-----------------
.../assistant-setting.tsx | 34 +---------------
.../setting-model/fish-audio-modal/index.tsx | 2 +-
.../setting-model/spark-modal/index.tsx | 2 +-
4 files changed, 8 insertions(+), 70 deletions(-)
diff --git a/web/src/components/message-item/group-button.tsx b/web/src/components/message-item/group-button.tsx
index 3c15ecf..31c642b 100644
--- a/web/src/components/message-item/group-button.tsx
+++ b/web/src/components/message-item/group-button.tsx
@@ -2,16 +2,8 @@ import { PromptIcon } from '@/assets/icon/Icon';
import CopyToClipboard from '@/components/copy-to-clipboard';
import { useSetModalState } from '@/hooks/common-hooks';
import { IRemoveMessageById } from '@/hooks/logic-hooks';
-import {
- DeleteOutlined,
- DislikeOutlined,
- LikeOutlined,
- PauseCircleOutlined,
- SoundOutlined,
- SyncOutlined,
-} from '@ant-design/icons';
+import { DeleteOutlined, SyncOutlined } from '@ant-design/icons';
import { Radio, Tooltip } from 'antd';
-import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import FeedbackModal from './feedback-modal';
import { useRemoveMessage, useSendFeedback, useSpeech } from './hooks';
@@ -31,22 +23,16 @@ export const AssistantGroupButton = ({
content,
prompt,
audioBinary,
- showLikeButton,
- showLoudspeaker = true,
}: IProps) => {
- const { visible, hideModal, showModal, onFeedbackOk, loading } =
+ const { visible, hideModal, onFeedbackOk, loading } =
useSendFeedback(messageId);
const {
visible: promptVisible,
hideModal: hidePromptModal,
showModal: showPromptModal,
} = useSetModalState();
- const { t } = useTranslation();
- const { handleRead, ref, isPlaying } = useSpeech(content, audioBinary);
-
- const handleLike = useCallback(() => {
- onFeedbackOk({ thumbup: true });
- }, [onFeedbackOk]);
+ useTranslation();
+ useSpeech(content, audioBinary);
return (
<>
@@ -54,24 +40,6 @@ export const AssistantGroupButton = ({
- {showLoudspeaker && (
-
-
- {isPlaying ? : }
-
-
-
- )}
- {showLikeButton && (
- <>
-
-
-
-
-
-
- >
- )}
{prompt && (
diff --git a/web/src/pages/chat/chat-configuration-modal/assistant-setting.tsx b/web/src/pages/chat/chat-configuration-modal/assistant-setting.tsx
index bccedec..f0c74f3 100644
--- a/web/src/pages/chat/chat-configuration-modal/assistant-setting.tsx
+++ b/web/src/pages/chat/chat-configuration-modal/assistant-setting.tsx
@@ -2,7 +2,7 @@ import KnowledgeBaseItem from '@/components/knowledge-base-item';
import { useTranslate } from '@/hooks/common-hooks';
import { useFetchTenantInfo } from '@/hooks/user-setting-hooks';
import { PlusOutlined } from '@ant-design/icons';
-import { Form, Input, message, Select, Switch, Upload } from 'antd';
+import { Form, Input, Select, Switch, Upload } from 'antd';
import classNames from 'classnames';
import { useCallback } from 'react';
import { ISegmentedContentProps } from '../interface';
@@ -17,7 +17,7 @@ const AssistantSetting = ({
setHasError,
}: ISegmentedContentProps) => {
const { t } = useTranslate('chat');
- const { data } = useFetchTenantInfo(true);
+ useFetchTenantInfo(true);
const handleChange = useCallback(() => {
const kbIds = form.getFieldValue('kb_ids');
@@ -42,17 +42,6 @@ const AssistantSetting = ({
return e?.fileList;
};
- const handleTtsChange = useCallback(
- (checked: boolean) => {
- if (checked && !data.tts_id) {
- message.error(`Please set TTS model firstly.
- Setting >> Model providers >> System model settings`);
- form.setFieldValue(['prompt_config', 'tts'], false);
- }
- },
- [data, form],
- );
-
const uploadButton = (