From e6212432884652812877efcbc3d690fb5773103a Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 27 Oct 2023 14:04:15 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20refactor(store.py):=20modify=20c?= =?UTF-8?q?reate=5Fcomponent=20function=20to=20include=20total=20count=20o?= =?UTF-8?q?f=20each=20type=20in=20the=20metadata=20dictionary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `create_component` function in `store.py` has been modified to include the total count of each type in the metadata dictionary. This change improves the structure of the metadata and provides more comprehensive information about the types and their counts in the nodes. --- src/backend/langflow/api/v1/store.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/api/v1/store.py b/src/backend/langflow/api/v1/store.py index 0c99f83f6..6949ef717 100644 --- a/src/backend/langflow/api/v1/store.py +++ b/src/backend/langflow/api/v1/store.py @@ -72,7 +72,10 @@ def create_component( # and the value is the count this type appears in the nodes # e.g. # { - # "SomeType": 1 + # "SomeType": { + # "count": 2 + # }, + # "total": 2 # } names = [node["id"].split("-")[0] for node in component.data["nodes"]] metadata = {name: {"count": names.count(name)} for name in names}