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.
This commit is contained in:
ogabrielluiz 2024-06-11 22:56:36 -03:00
commit d4dff2e027

View file

@ -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,