diff --git a/api/services/ops_trace/langfuse_trace.py b/api/services/ops_trace/langfuse_trace.py index 3fbda83973f72d..9a565ec96406ff 100644 --- a/api/services/ops_trace/langfuse_trace.py +++ b/api/services/ops_trace/langfuse_trace.py @@ -362,7 +362,10 @@ def workflow_trace(self, workflow_run: WorkflowRun, **kwargs): node_name = node_execution.title node_type = node_execution.node_type status = node_execution.status - inputs = json.loads(node_execution.inputs) if node_execution.inputs else {} + if node_type == "llm": + inputs = json.loads(node_execution.process_data).get("prompts", {}) + else: + inputs = json.loads(node_execution.inputs) if node_execution.inputs else {} outputs = ( json.loads(node_execution.outputs) if node_execution.outputs else {} ) diff --git a/api/services/ops_trace/langsmith_trace.py b/api/services/ops_trace/langsmith_trace.py index 1e4a9710c98a73..fa7d36aa85d498 100644 --- a/api/services/ops_trace/langsmith_trace.py +++ b/api/services/ops_trace/langsmith_trace.py @@ -264,7 +264,10 @@ def workflow_trace(self, workflow_run: WorkflowRun, **kwargs): node_name = node_execution.title node_type = node_execution.node_type status = node_execution.status - inputs = json.loads(node_execution.inputs) if node_execution.inputs else {} + if node_type == "llm": + inputs = json.loads(node_execution.process_data).get("prompts", {}) + else: + inputs = json.loads(node_execution.inputs) if node_execution.inputs else {} outputs = ( json.loads(node_execution.outputs) if node_execution.outputs else {} )