Feat: Display file references for agent dialogues #3221 (#8854)

### What problem does this PR solve?

Feat: Display file references for agent dialogues #3221
### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-07-15 17:30:45 +08:00
committed by GitHub
parent e9b14142a5
commit faebb519f7
10 changed files with 477 additions and 69 deletions

View File

@ -18,7 +18,6 @@ import { useParams } from 'umi';
import DebugContent from '../debug-content';
import { BeginQuery } from '../interface';
import { buildBeginQueryWithObject } from '../utils';
import { buildAgentMessageItemReference } from '../utils/chat';
const AgentChatBox = () => {
const {
@ -29,9 +28,9 @@ const AgentChatBox = () => {
loading,
ref,
derivedMessages,
reference,
stopOutputMessage,
sendFormMessage,
findReferenceByMessageId,
} = useSendNextMessage();
const { visible, hideModal, documentId, selectedChunk, clickDocumentButton } =
@ -71,7 +70,7 @@ const AgentChatBox = () => {
return (
<>
<section className="flex flex-1 flex-col pl-5 h-[90vh]">
<section className="flex flex-1 flex-col px-5 h-[90vh]">
<div className="flex-1 overflow-auto">
<div>
<Spin spinning={loading}>
@ -88,10 +87,7 @@ const AgentChatBox = () => {
avatar={userInfo.avatar}
avatarDialog={canvasInfo.avatar}
item={message}
reference={buildAgentMessageItemReference(
{ message: derivedMessages, reference },
message,
)}
reference={findReferenceByMessageId(message.id)}
clickDocumentButton={clickDocumentButton}
index={i}
showLikeButton={false}