Commit graph

1,121 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
5d75d46aef 🐛 fix(loading.py): handle invalid JSON strings in kwargs by removing the key from params 2023-08-02 15:54:57 -03:00
Gabriel Luiz Freitas Almeida
9f97ecba25 🐛 fix(__main__.py): fix default value of components_path option to point to the correct directory
 feat(__main__.py): add support for LANGFLOW_COMPONENTS_PATH environment variable to specify the directory containing custom components
2023-08-01 18:12:02 -03:00
Gabriel Luiz Freitas Almeida
f4271ba4d9 🔧 chore(settings.py): add debug logs to track the behavior of components_path configuration
 feat(settings.py): add support for LANGFLOW_COMPONENTS_PATH environment variable to add custom components path to components_path
2023-08-01 18:09:01 -03:00
Gabriel Luiz Freitas Almeida
11854ccdb3 🔧 chore(constants.py): update default custom component code to improve readability and remove unnecessary imports
 feat(constants.py): update display name and description of the custom component to improve clarity and user experience
🔧 chore(custom_components.py): update display name of the custom component to improve clarity and user experience
2023-08-01 17:44:02 -03:00
Lucas Oliveira
6450ec0e7b Changed Display Name from custom_components 2023-08-01 16:41:16 -03:00
Gabriel Luiz Freitas Almeida
6c872bf4ac 🐛 fix(custom_component.py): remove unnecessary return type annotation from _class_template_validation method
🐛 fix(custom_component.py): handle case when code is empty in is_check_valid method to avoid potential error
🐛 fix(types.py): change field_value parameter type from str to Any in add_new_custom_field function to allow any value type
2023-08-01 15:44:23 -03:00
Gabriel Luiz Freitas Almeida
d7a13755b3
Merge branch 'dev' into python_custom_node_component 2023-08-01 15:31:44 -03:00
Gabriel Luiz Freitas Almeida
70f8199287 🐛 fix(types.py): set default value of boolean custom field to False if value is None to prevent potential errors 2023-08-01 11:09:04 -03:00
Gabriel Luiz Freitas Almeida
99ed85c03c 🐛 fix(directory_reader.py): handle SyntaxError when checking if type hint is used but not imported
🔍 refactor(directory_reader.py): improve error handling when checking if type hint is used but not imported
2023-07-31 21:11:41 -03:00
gustavoschaedler
267d543420 🐛 fix(custom_component.py): update error message to include the specific type hint that is used but not imported in the code
🐛 fix(directory_reader.py): update error message to include the specific type hint that is used but not imported in the code
2023-07-31 23:22:12 +01:00
gustavoschaedler
082a61eadd 🐛 fix(custom_component.py): fix error message typo in CustomComponent class
🐛 fix(directory_reader.py): fix error message typo in DirectoryReader class
2023-07-31 23:07:02 +01:00
Gabriel Luiz Freitas Almeida
868ecd86ab 📝 docs(README.md): remove unnecessary empty line
📝 docs(README.md): update Table of Contents formatting
📝 docs(README.md): update Installation section formatting
📝 docs(README.md): update Command Line Interface (CLI) section formatting
📝 docs(README.md): update Deployment section formatting
📝 docs(README.md): update API Usage section formatting

🔧 chore(README.md): remove unnecessary whitespace and fix indentation in code block
📝 docs(README.md): update contributing section and add links to Discord server and contributing guidelines

🐛 fix(__main__.py): change envvar name from LANGFLOW_COMPONENT_PATH to LANGFLOW_COMPONENTS_PATH for consistency and clarity
2023-07-31 17:47:24 -03:00
Gabriel Luiz Freitas Almeida
a2ce598e08 🐛 fix(__main__.py): rename component_path to components_path for consistency and clarity
 feat(__main__.py): add support for components_path command line option to specify the directory containing custom components
🐛 fix(endpoints.py): rename settings.component_path to settings.components_path to match the updated attribute name in Settings class
🐛 fix(settings.py): rename component_path attribute to components_path for consistency and clarity
2023-07-31 17:47:23 -03:00
Gabriel Luiz Freitas Almeida
2e7b35ddd5 🔧 fix(custom_component.py): change list_flows and get_flow methods to accept an optional get_session parameter for better flexibility and testability 2023-07-31 17:28:29 -03:00
Gabriel Luiz Freitas Almeida
b2979bce17 🐛 fix(flow-runner.mdx): remove unnecessary load_flow calls and update get_flow method signature to include tweaks parameter
🚚 chore(flow-runner.mdx): update load_flow references to get_flow
🚚 chore(flow-runner.mdx): remove commented out code
🚚 chore(flow-runner.mdx): update load_flow references to get_flow
2023-07-31 16:03:51 -03:00
Gabriel Luiz Freitas Almeida
95bf9ba233 🔧 refactor(custom_component.py): refactor get_flow method signature to use Optional type hint for flow_name and flow_id parameters for better clarity and maintainability 2023-07-31 15:02:13 -03:00
Gabriel Luiz Freitas Almeida
566c48166e 🔀 refactor(custom_component.py): modify get_flow method to accept keyword arguments for flow_name and flow_id to improve flexibility and readability 2023-07-31 10:35:48 -03:00
Gabriel Luiz Freitas Almeida
9acb6fef36 🚀 feat(custom_component.py): add methods to retrieve flow by name and flow by id for CustomComponent
🐛 fix(custom_component.py): fix indentation issue in CustomComponent class
2023-07-31 10:26:27 -03:00
gustavoschaedler
7f23334f97 🐛 fix(directory_reader.py): add check for usage of 'Optional' type hint without importing it
 feat(directory_reader.py): add methods to check if a specific type hint is imported and used in function arguments
 feat(directory_reader.py): add method to check if a type hint is used but not imported in the code
 feat(directory_reader.py): add check for usage of 'Optional' type hint without importing it in the process_file method
2023-07-28 23:24:17 +01:00
Lucas Oliveira
115a784b66 Merge branch 'python_custom_node_component' of github.com:logspace-ai/langflow into python_custom_node_component 2023-07-28 15:21:14 -03:00
Lucas Oliveira
5e78f6be79 Changed gitignore 2023-07-28 15:19:31 -03:00
Gabriel Luiz Freitas Almeida
bdc62ba725 🐛 fix(__main__.py): change default value of workers option from -1 to 2 to limit the number of worker processes 2023-07-28 15:17:03 -03:00
Lucas Oliveira
eaceee9480 GitIgnore changed 2023-07-28 15:07:03 -03:00
Lucas Oliveira
1ea05b3584 Merge branch 'python_custom_node_component' of github.com:logspace-ai/langflow into python_custom_node_component 2023-07-28 14:49:11 -03:00
Lucas Oliveira
641bcb4a58 Fixed unique keys bug 2023-07-28 14:48:40 -03:00
gustavoschaedler
2f0ce5fc1b 🐛 fix(types.py): change default value of "error" field in component_template to None for better consistency and readability
🐛 fix(base.py): change default value of "error" field in FrontendNode class to None for better consistency and readability
2023-07-28 18:32:03 +01:00
gustavoschaedler
36772dac99 🐛 fix(types.py): add missing error field to component template in build_invalid_menu function
🐛 fix(base.py): add missing error field to FrontendNode class to match the template structure
2023-07-28 16:58:04 +01:00
Gabriel Luiz Freitas Almeida
98eca09270 🔧 fix(custom_component.py): add type hints to improve code readability and maintainability
🔧 fix(custom_component.py): add return type hint to 'load_flow' method for better code documentation
🔧 fix(custom_component.py): add return type hint to 'list_flows' method for better code documentation
2023-07-28 11:22:40 -03:00
Gabriel Luiz Freitas Almeida
25a59d745d 🔧 chore(types.py): refactor add_new_custom_field function to improve readability and maintainability
🔧 chore(types.py): refactor build_field_config function to improve readability and maintainability
2023-07-28 11:22:10 -03:00
gustavoschaedler
d579257f0d 🐛 fix(types.py): handle exceptions when getting custom function and building field config to prevent crashes and log errors
 feat(types.py): add validation check for custom component before building field config to ensure only valid components are processed
🐛 fix(types.py): handle empty function_args case to prevent errors when adding extra fields to the frontend node
🐛 fix(types.py): handle exceptions when creating custom component to prevent crashes and log errors
2023-07-28 01:21:05 +01:00
Gabriel Luiz Freitas Almeida
b2e784dcb7 🐛 fix(types.py): fix issue with incorrect assignment of field_advanced variable in add_new_custom_field function
 feat(types.py): add support for advanced field configuration in add_new_custom_field function
🐛 fix(types.py): fix issue with incorrect assignment of field_advanced variable in add_code_field function
 feat(types.py): add support for advanced field configuration in add_code_field function
🐛 fix(types.py): fix issue with incorrect sorting of function_args in add_extra_fields function
 feat(types.py): add sorting of function_args in add_extra_fields function
🐛 fix(types.py): fix issue with incorrect usage of field_config in add_code_field function
 feat(types.py): add support for field_config in add_code_field function
🐛 fix(types.py): fix issue with incorrect usage of field_config in build_langchain_template_custom_component function
 feat(types.py): add support for field_config in build_langchain_template_custom_component function
2023-07-27 17:19:24 -03:00
Gabriel Luiz Freitas Almeida
35724e1473 🐛 fix(code_parser.py): handle "None" values in default arguments correctly 2023-07-27 17:17:57 -03:00
Gabriel Luiz Freitas Almeida
3b93c5814b 🐛 fix(utils.py): simplify format_content function to improve readability and maintainability 2023-07-27 14:33:31 -03:00
Gabriel Luiz Freitas Almeida
707e55c880 🐛 fix(loading.py): refactor instantiate_prompt function to improve readability and maintainability
 feat(utils.py): add utility functions to handle node type and format kwargs in instantiate_prompt function
2023-07-27 14:32:10 -03:00
gustavoschaedler
2144e0d92d 🐛 fix(code_parser.py): strip single quotes from default values in CodeParser class to improve consistency and readability 2023-07-27 15:12:18 +01:00
Gabriel Luiz Freitas Almeida
28bf88cf79 🐛 fix(custom_component.py): fix custom_repr method to return a string representation of repr_value 2023-07-27 09:55:48 -03:00
Gabriel Luiz Freitas Almeida
4a0fe95093 🔧 chore(types.py): add support for custom field value in add_new_custom_field function
🔧 chore(types.py): add support for custom field value in add_new_custom_field function to allow specifying a default value for the field
2023-07-27 09:44:01 -03:00
Gabriel Luiz Freitas Almeida
2b55b0c3b3 🔀 refactor(custom_component.py): rename load_flow method parameter flow_id to graph_id for clarity
🔀 refactor(custom_component.py): add optional `tweaks` parameter to `load_flow` method to allow for processing tweaks on the graph data
🔀 refactor(custom_component.py): rename `data_graph` variable to `graph_data` for consistency and clarity
🔀 refactor(custom_component.py): add logic to process tweaks on the `graph_data` if `tweaks` parameter is provided
2023-07-27 09:39:27 -03:00
Gabriel Luiz Freitas Almeida
8d8fae78c8 🔧 fix(__init__.py): update import statement for CustomComponent to reflect new location
🔧 fix(constants.py): update import statement for CustomComponent to reflect new location
🔧 fix(constants.py): update field_config to build_config to match changes in CustomComponent class
🔧 fix(constants.py): update build method signature to match changes in CustomComponent class
2023-07-27 07:02:14 -03:00
gustavoschaedler
a89a9a3267 🔥 refactor(custom.py): remove unused code and class 'CustomComponent_old' to improve code cleanliness and maintainability
🔧 fix(test_custom_component.py): fix formatting issues in test_custom_component.py for better readability
 feat(test_custom_component.py): add import statements for 'patch' and 'MagicMock' to enable mocking in tests
🔬 test(test_custom_component.py): add test for the 'get_function' method of the Component class with valid code and function_entrypoint_name
🔬 test(test_custom_component.py): add test for the 'parse_assign' method of the CodeParser class
🔬 test(test_custom_component.py): add test for the 'get_code_tree' method of the Component class when given incorrect syntax
🔬 test(test_custom_component.py): add test for the '_class_template_validation' method of the CustomComponent class when the code is None
🔬 test(test_custom_component.py): add test for the 'get_function_entrypoint_args' method of the CustomComponent class
🔬 test(test_custom_component.py): add test for the 'get_function_entrypoint_return_type' method of the CustomComponent class
🔬 test(test_custom_component.py): add test for the 'get_main_class_name' method of the CustomComponent class when there is no main class

🔥 refactor(test_custom_component.py): remove commented out code and unused fixtures to improve code readability and maintainability

🔧 refactor(tests): remove commented out test cases and unused imports
 feat(tests): add new test case for list_flows method when there are no flows in the database
 feat(tests): add new test case for build_config method when code is not provided
 feat(tests): add new test case for list_flows method when there are multiple queries to the database
2023-07-26 16:56:21 +01:00
Gabriel Luiz Freitas Almeida
63ead274c4 🔧 fix(constants.py): add support for additional Python base types in CUSTOM_COMPONENT_SUPPORTED_TYPES dictionary
🔧 fix(custom_component.py): update return_type_valid_list to use CUSTOM_COMPONENT_SUPPORTED_TYPES dictionary
🔧 fix(types.py): update add_base_classes function to use CUSTOM_COMPONENT_SUPPORTED_TYPES dictionary instead of LANGCHAIN_BASE_TYPES
2023-07-26 10:15:22 -03:00
Gabriel Luiz Freitas Almeida
02ca9739a0 Merge branch 'dev' into python_custom_node_component 2023-07-26 07:55:25 -03:00
Gabriel Luiz Freitas Almeida
67b2aeae67 🐛 fix(custom_component.py): remove unused import of UUID from langflow.interface.custom.custom_component.py
🐛 fix(custom_component.py): handle case when code is None in is_check_valid method of CustomComponent class
🐛 fix(custom_component.py): handle case when code is None in get_function_entrypoint_args property of CustomComponent class
🐛 fix(custom_component.py): handle case when code is None in get_function_entrypoint_return_type property of CustomComponent class
🐛 fix(custom_component.py): change flow_id parameter type from UUID to str in load_flow method of CustomComponent class
🐛 fix(util.py): ignore type error for multiprocess import in langflow.utils.util module
🐛 fix(util.py): handle case when _type is a type object in remove_optional_wrapper function of langflow.utils.util module
2023-07-26 07:47:34 -03:00
Gabriel Luiz Freitas Almeida
c4a2c1c80a feat(schema.py): add ClassCodeDetails and CallableCodeDetails data classes to store details about classes and callables respectively 2023-07-26 07:46:31 -03:00
Gabriel Luiz Freitas Almeida
bf422f7f37 🔨 refactor(code_parser.py): remove unused imports and classes to improve code cleanliness and maintainability
🔨 refactor(code_parser.py): remove commented out code for function details to improve code readability
🔨 refactor(code_parser.py): refactor parse_node method to remove type ignore comments and improve code readability
🔨 refactor(code_parser.py): refactor parse_function_args method to improve code readability and maintainability
🔨 refactor(code_parser.py): refactor parse_positional_args method to improve code readability and maintainability
🔨 refactor(code_parser.py): refactor parse_varargs method to improve code readability and maintainability
🔨 refactor(code_parser.py): refactor parse_keyword_args method to improve code readability and maintainability
🔨 refactor(code_parser.py): refactor parse_kwargs method to improve code readability and maintainability
🔨 refactor(code_parser.py): refactor parse_function_body method to improve code readability and maintainability
🔨 refactor(code_parser.py): refactor parse_assign method to improve code readability and maintainability
🔨 refactor(code_parser.py): refactor parse_class method to improve code readability and maintainability
🔨 refactor(code_parser.py): refactor parse_global_vars method to improve code readability and maintainability
2023-07-26 07:46:00 -03:00
Gabriel Luiz Freitas Almeida
029f01aa35 🐛 fix(base.py): change variable name from fileTypes to file_types for consistency and readability
🐛 fix(agents.py): change variable name from fileTypes to file_types for consistency and readability
🐛 fix(documentloaders.py): change variable name from fileTypes to file_types for consistency and readability
🐛 fix(llms.py): change variable name from fileTypes to file_types for consistency and readability
2023-07-26 07:45:31 -03:00
Gabriel Luiz Freitas Almeida
57dd75b3f5 🔧 chore(component.py): add Optional type hint to the 'code' field in the Component model to indicate that it is an optional field
🔧 chore(component.py): update the error message in the validate_entrypoint_name function to provide more clarity on the required field
2023-07-26 07:43:49 -03:00
Gabriel Luiz Freitas Almeida
39755fb217 🐛 fix(code_parser.py): refactor CodeParser.parse_function_node to use CallableCodeDetails dataclass for storing function details 2023-07-26 07:12:24 -03:00
gustavoschaedler
1e54c17574 🔥 refactor(tools.py): remove unused import and typing import statement 2023-07-26 01:00:56 +01:00
Gabriel Luiz Freitas Almeida
683d0ffcc8 🐛 fix(types.py): prevent adding base classes that are in CLASSES_TO_REMOVE list to frontend_node 2023-07-25 20:54:57 -03:00