From d3fab9ac445cc2ccf0f39fe7a0e43b205a7fc879 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 4 Aug 2023 09:52:07 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(endpoints.py):=20add=20loggi?= =?UTF-8?q?ng=20statements=20to=20improve=20debugging=20and=20monitoring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 fix(endpoints.py): add logging statements to improve debugging and monitoring in the get_all() function --- src/backend/langflow/api/v1/endpoints.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/langflow/api/v1/endpoints.py b/src/backend/langflow/api/v1/endpoints.py index 296a549c8..f4817d12a 100644 --- a/src/backend/langflow/api/v1/endpoints.py +++ b/src/backend/langflow/api/v1/endpoints.py @@ -35,19 +35,24 @@ router = APIRouter(tags=["Base"]) @router.get("/all") def get_all(): + logger.debug("Building langchain types dict") native_components = build_langchain_types_dict() # custom_components is a list of dicts # need to merge all the keys into one dict custom_components_from_file = {} if settings.COMPONENTS_PATH: + logger.info(f"Building custom components from {settings.COMPONENTS_PATH}") custom_component_dicts = [ build_langchain_custom_component_list_from_path(str(path)) for path in settings.COMPONENTS_PATH ] + logger.info(f"Loading {len(custom_component_dicts)} custom components") + for custom_component_dict in custom_component_dicts: custom_components_from_file = merge_nested_dicts( custom_components_from_file, custom_component_dict ) + logger.info(f"Loaded {custom_component_dict}") return merge_nested_dicts(native_components, custom_components_from_file)