From 2affde4dbf53fc4a8afe31297fcc5c8ac1e85cc6 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 21 Jun 2024 20:21:24 -0300 Subject: [PATCH] refactor: Update build_component_and_get_results function to handle custom components and base components separately --- src/backend/base/langflow/interface/initialize/loading.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/base/langflow/interface/initialize/loading.py b/src/backend/base/langflow/interface/initialize/loading.py index cf445f909..2a70fa9de 100644 --- a/src/backend/base/langflow/interface/initialize/loading.py +++ b/src/backend/base/langflow/interface/initialize/loading.py @@ -66,9 +66,9 @@ async def build_component_and_get_results( ) with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=PydanticDeprecatedSince20) - if base_type == "custom_components": + if base_type == "custom_components" and isinstance(custom_component, CustomComponent): return await build_custom_component(params=params_copy, custom_component=custom_component) - elif base_type == "component": + elif base_type == "component" and isinstance(custom_component, Component): return await build_component(params=params_copy, custom_component=custom_component) else: raise ValueError(f"Base type {base_type} not found.")