From ae7b30c6324911c08379eb33cc38d900ab64f9a5 Mon Sep 17 00:00:00 2001 From: xuyingjie Date: Wed, 22 Jan 2025 03:42:53 +0800 Subject: [PATCH] fix: artifact repr assignment (#5829) Co-authored-by: xuyingjie Co-authored-by: anovazzi1 --- .../base/langflow/custom/custom_component/component.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/base/langflow/custom/custom_component/component.py b/src/backend/base/langflow/custom/custom_component/component.py index 9dd8db95f..639dbc240 100644 --- a/src/backend/base/langflow/custom/custom_component/component.py +++ b/src/backend/base/langflow/custom/custom_component/component.py @@ -950,7 +950,11 @@ class Component(CustomComponent): return result def _build_artifact(self, result): - custom_repr = self.custom_repr() or (result if isinstance(result, dict | Data | str) else str(result)) + custom_repr = self.custom_repr() + if custom_repr is None and isinstance(result, dict | Data | str): + custom_repr = result + if not isinstance(custom_repr, str): + custom_repr = str(custom_repr) raw = self._process_raw_result(result) artifact_type = get_artifact_type(self.status or raw, result)