From ffb07eb24b58f8272558f4de4c5f2c3f6072ef49 Mon Sep 17 00:00:00 2001 From: Joe <79627742+ZhouhaoJiang@users.noreply.github.com> Date: Sat, 29 Jun 2024 23:32:52 +0800 Subject: [PATCH] fix: workflow trace none type error (#5758) --- api/core/ops/langfuse_trace/langfuse_trace.py | 4 +++- api/core/ops/langsmith_trace/langsmith_trace.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/api/core/ops/langfuse_trace/langfuse_trace.py b/api/core/ops/langfuse_trace/langfuse_trace.py index 46795c8c3c..06eb3e2f43 100644 --- a/api/core/ops/langfuse_trace/langfuse_trace.py +++ b/api/core/ops/langfuse_trace/langfuse_trace.py @@ -121,7 +121,9 @@ class LangFuseDataTrace(BaseTraceInstance): node_type = node_execution.node_type status = node_execution.status if node_type == "llm": - inputs = json.loads(node_execution.process_data).get("prompts", {}) + inputs = json.loads(node_execution.process_data).get( + "prompts", {} + ) if node_execution.process_data else {} else: inputs = json.loads(node_execution.inputs) if node_execution.inputs else {} outputs = ( diff --git a/api/core/ops/langsmith_trace/langsmith_trace.py b/api/core/ops/langsmith_trace/langsmith_trace.py index 422830fb1e..1dbda601ed 100644 --- a/api/core/ops/langsmith_trace/langsmith_trace.py +++ b/api/core/ops/langsmith_trace/langsmith_trace.py @@ -114,7 +114,9 @@ class LangSmithDataTrace(BaseTraceInstance): node_type = node_execution.node_type status = node_execution.status if node_type == "llm": - inputs = json.loads(node_execution.process_data).get("prompts", {}) + inputs = json.loads(node_execution.process_data).get( + "prompts", {} + ) if node_execution.process_data else {} else: inputs = json.loads(node_execution.inputs) if node_execution.inputs else {} outputs = (