From d4dff2e027d4de084294d6d8129f43fb2a322253 Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Tue, 11 Jun 2024 22:56:36 -0300 Subject: [PATCH] refactor: Update custom component instantiation in endpoints.py Refactor the instantiation of the custom component in the endpoints.py file. Replace the usage of the deprecated CustomComponent class with the Component class. This change ensures compatibility with the latest version of the langflow library and improves code readability. --- src/backend/base/langflow/api/v1/endpoints.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/backend/base/langflow/api/v1/endpoints.py b/src/backend/base/langflow/api/v1/endpoints.py index e1da15e92..dedd30478 100644 --- a/src/backend/base/langflow/api/v1/endpoints.py +++ b/src/backend/base/langflow/api/v1/endpoints.py @@ -20,7 +20,6 @@ from langflow.api.v1.schemas import ( UpdateCustomComponentRequest, UploadFileResponse, ) -from langflow.custom import CustomComponent from langflow.custom.custom_component.component import Component from langflow.custom.utils import build_custom_component_template from langflow.graph.graph.base import Graph @@ -513,7 +512,7 @@ async def custom_component_update( """ try: - component = CustomComponent(code=code_request.code) + component = Component(code=code_request.code) component_node, cc_instance = build_custom_component_template( component,