mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-25 01:43:27 +08:00
fix: include full conversation details in agent log CSV export (#17291)
This commit is contained in:
@@ -3407,6 +3407,9 @@ Important structured information may include: names, dates, locations, events, k
|
||||
success: 'Success',
|
||||
failed: 'Failed',
|
||||
logTitle: 'Title',
|
||||
conversationDetail: 'Conversation detail',
|
||||
user: 'User',
|
||||
assistant: 'Assistant',
|
||||
},
|
||||
llmTools: {
|
||||
bad_calculator: {
|
||||
|
||||
@@ -2083,6 +2083,9 @@ NER:使用 spaCy NER 和基于规则的关键词提取来抽取实体和关系
|
||||
agents: '智能体',
|
||||
id: 'ID',
|
||||
logTitle: '标题',
|
||||
conversationDetail: '对话详情',
|
||||
user: '用户',
|
||||
assistant: '助手',
|
||||
state: '状态',
|
||||
number: '轮数',
|
||||
latestDate: '最新日期',
|
||||
|
||||
@@ -20,11 +20,26 @@ export const useExportAgentLogToCSV = () => {
|
||||
const { id: canvasId } = useParams();
|
||||
const { exportLogs, loading } = useExportAgentLog();
|
||||
|
||||
const formatConversation = (item: IAgentLogResponse): string => {
|
||||
if (!item.message?.length) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const lines = item.message.map((msg) => {
|
||||
const role =
|
||||
msg.role === 'assistant' ? t('flow.assistant') : t('flow.user');
|
||||
return `${role}: ${msg.content ?? ''}`;
|
||||
});
|
||||
|
||||
return lines.join('\n');
|
||||
};
|
||||
|
||||
const convertToCSV = (data: IAgentLogResponse[]) => {
|
||||
const headers = [
|
||||
t('flow.id'),
|
||||
t('flow.userId'),
|
||||
t('flow.logTitle'),
|
||||
t('flow.conversationDetail'),
|
||||
t('flow.state'),
|
||||
t('flow.number'),
|
||||
t('flow.latestDate'),
|
||||
@@ -36,6 +51,7 @@ export const useExportAgentLogToCSV = () => {
|
||||
item.id,
|
||||
item.user_id,
|
||||
item.message?.length ? item.message[0]?.content : '',
|
||||
formatConversation(item),
|
||||
item.errors ? t('flow.failed') : t('flow.success'),
|
||||
item.round,
|
||||
item.update_date,
|
||||
|
||||
Reference in New Issue
Block a user