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:
parent
ac85517361
commit
d4dff2e027
1 changed files with 1 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue