From 0f195b59e11357585af55312824fb7cc6a00f42e Mon Sep 17 00:00:00 2001 From: italojohnny Date: Tue, 28 May 2024 11:49:24 -0300 Subject: [PATCH] retrieve and store artifact type --- src/backend/base/langflow/interface/initialize/loading.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/base/langflow/interface/initialize/loading.py b/src/backend/base/langflow/interface/initialize/loading.py index 03de827b3..e5f05c595 100644 --- a/src/backend/base/langflow/interface/initialize/loading.py +++ b/src/backend/base/langflow/interface/initialize/loading.py @@ -8,6 +8,8 @@ from loguru import logger from langflow.custom.eval import eval_custom_component_code from langflow.schema.schema import Record +from langflow.graph.utils import get_artifact_type + if TYPE_CHECKING: from langflow.custom import CustomComponent @@ -124,4 +126,5 @@ async def instantiate_custom_component(params, user_id, vertex, fallback_to_env_ custom_repr = build_result if not isinstance(custom_repr, str): custom_repr = str(custom_repr) - return custom_component, build_result, {"repr": custom_repr} + artifact = {"repr": custom_repr, "type": get_artifact_type(build_result)} + return custom_component, build_result, artifact