fix: include full conversation details in agent log CSV export (#17291)

This commit is contained in:
euvre
2026-07-24 10:57:34 +08:00
committed by GitHub
parent 80d61ac8e2
commit 297890b437
3 changed files with 22 additions and 0 deletions

View File

@@ -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: {

View File

@@ -2083,6 +2083,9 @@ NER使用 spaCy NER 和基于规则的关键词提取来抽取实体和关系
agents: '智能体',
id: 'ID',
logTitle: '标题',
conversationDetail: '对话详情',
user: '用户',
assistant: '助手',
state: '状态',
number: '轮数',
latestDate: '最新日期',

View File

@@ -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,