Fix bugs and make improvements (#1794)

* add ? to prevent bug when template has no value

* Refactor determine_component_name function in utils.py to use file name

* Bump version to 0.6.18 in pyproject.toml

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-04-29 15:41:26 -03:00 committed by GitHub
commit 83dfa4d160
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 500 additions and 510 deletions

995
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "langflow"
version = "0.6.17"
version = "0.6.18"
description = "A Python package with a built-in web application"
authors = ["Logspace <contact@logspace.ai>"]
maintainers = [

View file

@ -1,6 +1,7 @@
from loguru import logger
from langflow.interface.custom.directory_reader import DirectoryReader
from langflow.template.frontend_node.custom_components import CustomComponentFrontendNode
from loguru import logger
def merge_nested_dicts_with_renaming(dict1, dict2):
@ -124,12 +125,8 @@ def get_new_key(dictionary, original_key):
def determine_component_name(component):
"""Determine the name of the component."""
component_output_types = component["output_types"]
if len(component_output_types) == 1:
return component_output_types[0]
else:
file_name = component.get("file").split(".")[0]
return "".join(word.capitalize() for word in file_name.split("_")) if "_" in file_name else file_name
file_name = component.get("file").split(".")[0]
return "".join(word.capitalize() for word in file_name.split("_")) if "_" in file_name else file_name
def build_menu_items(menu_item):

View file

@ -733,7 +733,7 @@ export default function CodeTabsComponent({
value={
node.data.node!.template[
templateField
].value.toString() === "{}"
].value?.toString() === "{}"
? {
yourkey: "value",
}