= ({
const isRetryNode = hasRetryNode(nodeInfo?.node_type) && !!nodeInfo?.retryDetail?.length
const isAgentNode = nodeInfo?.node_type === BlockEnum.Agent && !!nodeInfo?.agentLog?.length
const isToolNode = nodeInfo?.node_type === BlockEnum.Tool && !!nodeInfo?.agentLog?.length
- const isLLMNode = nodeInfo?.node_type === BlockEnum.LLM && !!nodeInfo?.generation_detail
+ const isLLMNode = nodeInfo?.node_type === BlockEnum.LLM && !!nodeInfo?.execution_metadata?.llm_trace?.length
return (
diff --git a/web/app/components/workflow/run/special-result-panel.tsx b/web/app/components/workflow/run/special-result-panel.tsx
index f12d51ef20..4ccc832417 100644
--- a/web/app/components/workflow/run/special-result-panel.tsx
+++ b/web/app/components/workflow/run/special-result-panel.tsx
@@ -1,6 +1,7 @@
import type {
AgentLogItemWithChildren,
IterationDurationMap,
+ LLMTraceItem,
LoopDurationMap,
LoopVariableMap,
NodeTracing,
@@ -33,7 +34,7 @@ export type SpecialResultPanelProps = {
showLLMDetail?: boolean
setShowLLMDetailFalse?: () => void
- llmResultList?: NodeTracing[]
+ llmResultList?: LLMTraceItem[]
}
const SpecialResultPanel = ({
showRetryDetail,
diff --git a/web/app/components/workflow/run/tracing-panel.tsx b/web/app/components/workflow/run/tracing-panel.tsx
index 8931c8f7fe..51686bd839 100644
--- a/web/app/components/workflow/run/tracing-panel.tsx
+++ b/web/app/components/workflow/run/tracing-panel.tsx
@@ -91,6 +91,11 @@ const TracingPanel: FC = ({
agentOrToolLogItemStack,
agentOrToolLogListMap,
handleShowAgentOrToolLog,
+
+ showLLMDetail,
+ setShowLLMDetailFalse,
+ llmResultList,
+ handleShowLLMDetail,
} = useLogs()
const renderNode = (node: NodeTracing) => {
@@ -153,6 +158,7 @@ const TracingPanel: FC = ({
onShowLoopDetail={handleShowLoopResultList}
onShowRetryDetail={handleShowRetryResultList}
onShowAgentOrToolLog={handleShowAgentOrToolLog}
+ onShowLLMDetail={handleShowLLMDetail}
hideInfo={hideNodeInfo}
hideProcessDetail={hideNodeProcessDetail}
/>
@@ -182,6 +188,10 @@ const TracingPanel: FC = ({
agentOrToolLogItemStack={agentOrToolLogItemStack}
agentOrToolLogListMap={agentOrToolLogListMap}
handleShowAgentOrToolLog={handleShowAgentOrToolLog}
+
+ showLLMDetail={showLLMDetail}
+ setShowLLMDetailFalse={setShowLLMDetailFalse}
+ llmResultList={llmResultList}
/>
)
}
diff --git a/web/i18n/en-US/workflow.json b/web/i18n/en-US/workflow.json
index 9dc21e79e6..371487856d 100644
--- a/web/i18n/en-US/workflow.json
+++ b/web/i18n/en-US/workflow.json
@@ -126,6 +126,7 @@
"common.currentDraftUnpublished": "Current Draft Unpublished",
"common.currentView": "Current View",
"common.currentWorkflow": "Current Workflow",
+ "common.data": "Data",
"common.debugAndPreview": "Preview",
"common.disconnect": "Disconnect",
"common.duplicate": "Duplicate",
diff --git a/web/i18n/zh-Hans/workflow.json b/web/i18n/zh-Hans/workflow.json
index 7787c9db4b..50a0801706 100644
--- a/web/i18n/zh-Hans/workflow.json
+++ b/web/i18n/zh-Hans/workflow.json
@@ -126,6 +126,7 @@
"common.currentDraftUnpublished": "当前草稿未发布",
"common.currentView": "当前视图",
"common.currentWorkflow": "整个工作流",
+ "common.data": "数据",
"common.debugAndPreview": "预览",
"common.disconnect": "断开连接",
"common.duplicate": "复制",
diff --git a/web/service/base.ts b/web/service/base.ts
index bbb05cf357..cc421b0f75 100644
--- a/web/service/base.ts
+++ b/web/service/base.ts
@@ -34,16 +34,24 @@ import { getWebAppPassport } from './webapp-auth'
const TIME_OUT = 100000
+export type IconObject = {
+ background: string
+ content: string
+}
+
export type IOnDataMoreInfo = {
conversationId?: string
taskId?: string
messageId: string
errorMessage?: string
errorCode?: string
- chunk_type?: 'text' | 'tool_call' | 'tool_result' | 'thought' | 'thought_start'
+ chunk_type?: 'text' | 'tool_call' | 'tool_result' | 'thought' | 'thought_start' | 'thought_end'
tool_call_id?: string
tool_name?: string
tool_arguments?: string
+ tool_icon?: string | IconObject
+ tool_icon_dark?: string | IconObject
+
tool_files?: string[]
tool_error?: string
tool_elapsed_time?: number
@@ -245,6 +253,8 @@ export const handleStream = (
tool_call_id: bufferObj.tool_call_id,
tool_name: bufferObj.tool_name,
tool_arguments: bufferObj.tool_arguments,
+ tool_icon: bufferObj.tool_icon,
+ tool_icon_dark: bufferObj.tool_icon_dark,
tool_files: bufferObj.tool_files,
tool_error: bufferObj.tool_error,
tool_elapsed_time: bufferObj.tool_elapsed_time,
diff --git a/web/types/workflow.ts b/web/types/workflow.ts
index 3f7ea304b3..3241ff0732 100644
--- a/web/types/workflow.ts
+++ b/web/types/workflow.ts
@@ -28,11 +28,33 @@ export type AgentLogItemWithChildren = AgentLogItem & {
children: AgentLogItemWithChildren[]
}
+export type IconObject = {
+ background: string
+ content: string
+}
+
+export type ToolCallItem = {
+ type: 'model' | 'tool' | 'thought'
+ tool_call_id?: string
+ tool_name?: string
+ tool_arguments?: string
+ tool_icon?: string | IconObject
+ tool_icon_dark?: string | IconObject
+ tool_files?: string[]
+ tool_error?: string
+ tool_output?: Record | string
+ tool_elapsed_time?: number
+}
+
export type ToolCallDetail = {
id: string
name: string
arguments: string
- result: string
+ output: string
+ files: string[]
+ error: string
+ elapsed_time?: number
+ status: string
}
export type SequenceSegment
= | { type: 'context', start: number, end: number }
@@ -45,6 +67,18 @@ export type LLMLogItem = {
sequence: SequenceSegment[]
}
+export type LLMTraceItem = {
+ type: 'model' | 'tool'
+ duration: number
+ output: Record
+ provider?: string
+ name: string
+ icon?: string | IconObject
+ icon_dark?: string | IconObject
+ error?: string
+ status?: 'success' | 'error'
+}
+
export type NodeTracing = {
id: string
index: number
@@ -89,6 +123,7 @@ export type NodeTracing = {
icon?: string
}
loop_variable_map?: Record
+ llm_trace?: LLMTraceItem[]
}
metadata: {
iterator_length: number