import type { AgentLogItemWithChildren, NodeTracing, } from '@/types/workflow' import { RiArrowRightLine } from '@remixicon/react' import { useTranslation } from 'react-i18next' type AgentLogTriggerProps = { nodeInfo: NodeTracing onShowAgentOrToolLog: (detail?: AgentLogItemWithChildren) => void } const AgentLogTrigger = ({ nodeInfo, onShowAgentOrToolLog, }: AgentLogTriggerProps) => { const { t } = useTranslation() const { agentLog, execution_metadata } = nodeInfo const agentStrategy = execution_metadata?.tool_info?.agent_strategy return (
{ onShowAgentOrToolLog({ message_id: nodeInfo.id, children: agentLog || [] } as AgentLogItemWithChildren) }} >
{t('nodes.agent.strategy.label', { ns: 'workflow' })}
{ agentStrategy && (
{agentStrategy}
) }
{t('detail', { ns: 'runLog' })}
) } export default AgentLogTrigger