🔨 refactor(endpoints.py): rename langchain_types_dict import to build_langchain_types_dict for clarity and consistency

🔨 refactor(types.py): remove unused langchain_types_dict variable to improve code cleanliness
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-19 10:00:47 -03:00
commit 58d7491d83
2 changed files with 2 additions and 5 deletions

View file

@ -19,7 +19,7 @@ from langflow.interface.types import (
build_langchain_template_custom_component,
)
from langflow.interface.types import langchain_types_dict
from langflow.interface.types import build_langchain_types_dict
from langflow.database.base import get_session
from sqlmodel import Session
@ -29,7 +29,7 @@ router = APIRouter(tags=["Base"])
@router.get("/all")
def get_all():
return langchain_types_dict
return build_langchain_types_dict()
# For backwards compatibility we will keep the old endpoint

View file

@ -233,6 +233,3 @@ def build_langchain_template_custom_component(custom_component: CustomComponent)
frontend_node.get("base_classes").append(base_class)
return frontend_node
langchain_types_dict = build_langchain_types_dict()