feat: chat error msg (#4826)

* perf: i18n

* feat: chat error msg

* feat: doc
This commit is contained in:
Archer
2025-05-16 12:07:11 +08:00
committed by GitHub
parent 554b2ca8dc
commit e145f63554
18 changed files with 74 additions and 42 deletions

View File

@@ -35,6 +35,7 @@ import {
import { addStatisticalDataToHistoryItem } from '@/global/core/chat/utils';
import dynamic from 'next/dynamic';
import { useMemoizedFn } from 'ahooks';
import ChatBoxDivider from '../../../Divider';
const ResponseTags = dynamic(() => import('./ResponseTags'));
@@ -371,7 +372,20 @@ const ChatItem = (props: Props) => {
</>
)}
{/* Example: Response tags. A set of dialogs only needs to be displayed once*/}
{i === splitAiResponseResults.length - 1 && <>{children}</>}
{i === splitAiResponseResults.length - 1 && (
<>
{/* error message */}
{!!chat.errorMsg && (
<Box mt={2}>
<ChatBoxDivider icon={'common/errorFill'} text={t('chat:error_message')} />
<Box fontSize={'xs'} color={'myGray.500'}>
{chat.errorMsg}
</Box>
</Box>
)}
{children}
</>
)}
{/* 对话框底部的复制按钮 */}
{type == ChatRoleEnum.AI &&
value[0]?.type !== 'interactive' &&