diff --git a/web/src/components/Chat/types.ts b/web/src/components/Chat/types.ts index 96e8e284..0cf1b130 100644 --- a/web/src/components/Chat/types.ts +++ b/web/src/components/Chat/types.ts @@ -23,6 +23,7 @@ export interface ChatItem { status?: string; subContent?: Record[]; files?: any[]; + error?: string; } /** diff --git a/web/src/views/Workflow/components/Chat/Chat.tsx b/web/src/views/Workflow/components/Chat/Chat.tsx index 8ca6efac..65989b30 100644 --- a/web/src/views/Workflow/components/Chat/Chat.tsx +++ b/web/src/views/Workflow/components/Chat/Chat.tsx @@ -320,7 +320,8 @@ const Chat = forwardRef(({ appId newList[lastIndex] = { ...newList[lastIndex], status, - content: newList[lastIndex].content === '' ? null : newList[lastIndex].content + error, + content: newList[lastIndex].content === '' ? null : newList[lastIndex].content, } } return newList diff --git a/web/src/views/Workflow/components/Chat/Runtime.tsx b/web/src/views/Workflow/components/Chat/Runtime.tsx index e3608e10..e41531b0 100644 --- a/web/src/views/Workflow/components/Chat/Runtime.tsx +++ b/web/src/views/Workflow/components/Chat/Runtime.tsx @@ -217,14 +217,20 @@ const Runtime: FC<{ item: ChatItem; index: number;}> = ({ children: ( detail ? ( -
- - {renderDetailChild(detail.subContent)} -
- ) - : renderChild(item.subContent) +
+ + {renderDetailChild(detail.subContent)} +
+ ) + : <> + {item.error + ?
+ +
+ : renderChild(item.subContent) + } ) }]} />