Commit graph

3,449 commits

Author SHA1 Message Date
Lucas Oliveira
5f375d4c2a fix merge 2023-07-20 10:16:28 -03:00
Lucas Oliveira
6a0de25b80 Merge branch 'modalRefactor' into python_custom_node_component 2023-07-20 10:14:49 -03:00
Lucas Oliveira
8f6e8f9e91 Fixed bug that has been fixed at CustomComponents 2023-07-20 10:12:29 -03:00
Lucas Oliveira
2022f4b31b Merge branch 'python_custom_node_component' of github.com:logspace-ai/langflow into python_custom_node_component 2023-07-20 10:05:06 -03:00
Lucas Oliveira
af63dd02da Removed unused console.log 2023-07-20 10:04:45 -03:00
Lucas Oliveira
efd58383b9 Fixed unnecessary calls 2023-07-20 10:04:05 -03:00
Lucas Oliveira
19aca4a031 Fixed bug where edges are not maintained after refreshing custom component; Fixed bug where handles are not refreshed on custom component; 2023-07-20 10:03:11 -03:00
Gabriel Luiz Freitas Almeida
583eca137a feat(logger.py): configure default logger with optional log level and log file parameters for better customization
🔧 chore(logger.py): remove unnecessary blank lines and comments for cleaner code
2023-07-20 09:09:17 -03:00
anovazzi1
1a5f33ddd4 chore(codeAreaModal): import cleanEdges function from reactflowUtils to improve code readability and maintainability
feat(codeAreaModal): add typesContext to access reactFlowInstance for cleaning edges before processing code
2023-07-19 18:14:22 -03:00
Gabriel Luiz Freitas Almeida
0b283f8703 🐛 fix(types.py): convert avg_length to an integer to improve readability in DocumentLoaderVertex and TextSplitterVertex 2023-07-19 17:59:04 -03:00
gustavoschaedler
9adff855fb 🔧 chore(constants.py): update class attribute names to follow Langflow naming convention for better consistency and clarity
 feat(load_custom_component_from_file.py): add functionality to compress and decompress code, validate code syntax, validate build function presence, read file content, get list of .py files in a directory, find menu by name in response, process file by validating content and returning result and content/error message, and build component menu list from .py files in a directory
2023-07-19 21:16:36 +01:00
Lucas Oliveira
62bcfdeaa9 Fixed bug where prompt modal not saving, but there is no Clean Edges now 2023-07-19 11:03:44 -03:00
Lucas Oliveira
b46a967452 Merge branch 'python_custom_node_component' of github.com:logspace-ai/langflow into python_custom_node_component 2023-07-19 11:01:53 -03:00
Lucas Oliveira
be712a45af Fixed bug where PromptComponent does not save, but there is no Clean Edges now 2023-07-19 11:01:23 -03:00
Gabriel Luiz Freitas Almeida
58d7491d83 🔨 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
2023-07-19 10:00:47 -03:00
Gabriel Luiz Freitas Almeida
4827c99368 🐛 fix(code_parser.py): handle case when code parameter is a class by getting its source code using inspect module
 feat(code_parser.py): add support for parsing class source code in addition to string source code to improve flexibility and usability
2023-07-19 07:03:54 -03:00
Lucas Oliveira
d668640791 Fixed code not saving 2023-07-18 18:40:53 -03:00
Lucas Oliveira
0560c966f6 Merge branch 'modalRefactor' into python_custom_node_component 2023-07-18 18:23:05 -03:00
Lucas Oliveira
dbb9b8ab81 Fixed disableCopyPaste on modals 2023-07-18 18:22:22 -03:00
Lucas Oliveira
02cff362f0 Merge branch 'modalRefactor' into python_custom_node_component 2023-07-18 18:13:26 -03:00
Gabriel Luiz Freitas Almeida
5d4aae9ba3 🐛 fix(codeAreaModal/index.tsx): update condition in useEffect to check if nodeClass.template has more than 2 fields instead of 1
 feat(codeAreaModal/index.tsx): refactor handleClick function to call processCode function instead of directly calling postValidateCode function
 feat(codeAreaModal/index.tsx): add support for processing non-dynamic fields by calling postValidateCode function and updating success and error data accordingly
 feat(codeAreaModal/index.tsx): add support for processing dynamic fields by calling postCustomComponent function and updating nodeClass and error data accordingly
2023-07-18 15:39:43 -03:00
Gabriel Luiz Freitas Almeida
e0d086e85a 🔥 refactor(codeAreaModal/index.tsx): simplify useEffect logic and add conditional check to prevent unnecessary handleClick execution 2023-07-18 15:29:29 -03:00
Gabriel Luiz Freitas Almeida
1f9e84d8c2 🔥 refactor(codeAreaModal/index.tsx): comment out unused useEffect hook and handleClick function
🔥 refactor(codeAreaModal/index.tsx): remove unused useEffect hook and handleClick function
2023-07-18 15:17:49 -03:00
gustavoschaedler
598a833b75 🐛 fix(util.py): fix import order to follow PEP8 guidelines for better readability and maintainability
 feat(util.py): add sync_to_async decorator to convert sync functions to async functions for better performance and compatibility
🐛 fix(util.py): fix formatting of dictionary by removing certain keys and modifying the values of other keys to improve consistency and clarity
🐛 fix(util.py): fix update_verbose function to recursively update the value of the 'verbose' key in a dictionary
🐛 fix(util.py): fix update_verbose function to correctly handle nested dictionaries
🐛 fix(util.py): fix update_verbose function to correctly handle non-dictionary values
🐛 fix(util.py): fix format_dict function to correctly handle the 'type' value when it is a type object
🐛 fix(util.py): fix format_dict function to correctly handle the 'type' value when it is a list type
🐛 fix(util.py): fix format_dict function to correctly handle the 'type' value when it is a Mapping type
🐛 fix(util.py): fix format_dict function to correctly handle the 'type' value when it is a dict type
🐛 fix(util.py): fix format_dict function to correctly handle the 'type' value when it is a Tool type
🐛 fix(util.py): fix format_dict function to correctly handle the 'type' value when it is an int type
🐛 fix(util.py): fix format_dict function to correctly handle the 'show' value based on field requirements and naming conventions
🐛 fix(util.py): fix format_dict function to correctly handle the 'password' value based on field naming conventions
🐛 fix(util.py): fix format_dict function to correctly handle the 'multiline' value based on field naming conventions
🐛 fix(util.py): fix format_dict function to correctly handle the 'type' value when it is a dict type for the 'dict_' key
🐛 fix(util.py): fix format_dict function to correctly handle the 'value' field when it is a default value
🐛 fix(util.py): fix format_dict function to correctly handle the 'value' field for the 'headers' key
🐛 fix(util.py): fix format_dict function to correctly handle the 'options' field for specific class and key combinations
2023-07-18 18:47:04 +01:00
gustavoschaedler
cee4740b0f 🔧 fix(custom_component.py): add line break to improve readability of TODO comment
🔧 fix(index.tsx): remove unused imports to clean up code

🔧 fix(utils.ts): add space before opening parenthesis to improve code style

🔧 fix(test_custom_component.py): add line breaks to improve readability of test cases
2023-07-18 02:05:37 +01:00
gustavoschaedler
11f7846e0a 🔥 refactor(conftest.py): remove unused fixtures and custom chain classes
The following changes were made:
- Removed the `custom_chain` fixture and the `MyCustomChain` and `CustomChain` classes as they were not being used.
- Removed the `data_processing`, `filter_docs`, `get_request`, and `post_request` fixtures as they were not being used.

🔧 fix(test_agents_template.py): set "dynamic" property to False for all template variables to ensure consistency and improve clarity

🐛 fix(test_chains_template.py): add missing "dynamic" field to template dictionaries to ensure consistency and avoid potential bugs

🔧 fix(test_custom_component.py): fix import statements and remove unused imports to improve code readability and maintainability
 feat(test_custom_component.py): add tests for the initialization of the CodeParser, Component, and CustomComponent classes
🔧 fix(test_custom_component.py): fix test names and add missing test cases for the Component and CustomComponent classes

🔨 refactor: refactor server.ts to use uppercase PORT variable for improved semantics
 feat: add support for process.env.PORT environment variable to run app on configurable port

🔨 refactor: refactor CustomComponent tests for improved readability and maintainability

🔨 refactor: refactor CodeParser tests for improved readability and maintainability

🔨 refactor: refactor Component tests for improved readability and maintainability

🐛 fix: fix CustomComponent class template validation to raise HTTPException when code is None

🔧 fix(tests): fix syntax error in custom_component._class_template_validation
 feat(tests): add test_custom_component_get_code_tree_syntax_error to test CustomComponent.get_code_tree method for raising CodeSyntaxError when given incorrect syntax
 feat(tests): add test_custom_component_get_function_entrypoint_args_no_args to test CustomComponent.get_function_entrypoint_args property with a build method with no arguments
 feat(tests): add test_custom_component_get_function_entrypoint_return_type_no_return_type to test CustomComponent.get_function_entrypoint_return_type property with a build method with no return type
 feat(tests): add test_custom_component_get_main_class_name_no_main_class to test CustomComponent.get_main_class_name property when there is no main class
 feat(tests): add test_custom_component_build_not_implemented to test CustomComponent.build method for raising NotImplementedError
 feat(tests): add fixtures for custom_chain, data_processing, filter_docs, and get_request

🔧 fix(tests): remove commented out code and unused imports to improve code readability and maintainability

🐛 fix(test_llms_template.py): set "dynamic" property to False for all template properties to ensure static values are used

🐛 fix(test_prompts_template.py): set "dynamic" property to False for all template properties to ensure consistency and improve readability
2023-07-18 01:59:19 +01:00
Lucas Oliveira
d1f744e4d4 Formatting 2023-07-17 17:07:45 -03:00
Lucas Oliveira
8c49bcfaa5 Styling fixes on both applications of codeTabsComponent 2023-07-17 17:06:59 -03:00
Lucas Oliveira
eebad04f52 Merge branch 'modalRefactor' of github.com:logspace-ai/langflow into modalRefactor 2023-07-17 13:31:20 -03:00
Lucas Oliveira
14a0669c99 Normailzed code modals 2023-07-17 13:27:04 -03:00
Cristhian Zanforlin Lousa
1ff4ef514f 🔧 fix(AccordionComponent): add className "AccordionContent" to AccordionContent component for styling purposes
🔧 fix(formModal): add className "AccordionContent" to AccordionContent component for styling purposes
🔧 fix(index.css): add styles for AccordionContent component to handle animation for opening and closing
🔧 fix(tailwind.config.js): remove unused keyframes and animations related to accordion
2023-07-17 10:48:45 -03:00
Lucas Oliveira
9788ca6c2e FIxed gap in modal and errors not displaying at CodeAreaModal 2023-07-17 10:19:13 -03:00
Lucas Oliveira
e4f5df9bad Removed unused file 2023-07-16 17:10:09 -03:00
Lucas Oliveira
8e6e2e9708 Merge branch 'modalRefactor' into python_custom_node_component 2023-07-16 17:09:56 -03:00
Lucas Oliveira
207e76a09d Fixed dropdown component on editNode 2023-07-16 16:22:01 -03:00
Lucas Oliveira
72baa7c2be Merge branch 'dev' into modalRefactor 2023-07-16 16:19:36 -03:00
Lucas Oliveira
43b23e4ef6 Added check to execute code when first rendering modal. To work, it must merge with ModalRefactor 2023-07-16 16:18:40 -03:00
Lucas Oliveira
dc07b3c690 Removed output handle if baseclasses not present 2023-07-16 16:03:08 -03:00
Lucas Oliveira
034a8f0641 Fixed tooltip not working on CustomComponent 2023-07-16 15:55:22 -03:00
Lucas Oliveira
99f59d4dbf Fixed node not being saved 2023-07-16 13:06:05 -03:00
Lucas Oliveira
d5ba08f776 Refactored data state management on parameter components and editnode modal, bug on saving(not storing changes on ReactFlowInstance) 2023-07-16 00:55:22 -03:00
Lucas Oliveira
31588c4e42 Optimized nodeToolbar and EditNodeModal 2023-07-15 23:49:12 -03:00
Lucas Oliveira
f3b4e6e76f Removed closePopup from API modal 2023-07-15 23:17:38 -03:00
Cristhian Zanforlin Lousa
eaa4f1343a 🐛 fix(tailwind.config.js): change height value from 100 to '100vh' to ensure full viewport height for slideDown animation 2023-07-14 22:14:17 -03:00
Cristhian Zanforlin Lousa
de519d81a4 🐛 fix(AccordionComponent): remove console.log statement for open variable
🐛 fix(ApiModal): set open accordion to empty array if there are no accordions to open
2023-07-14 22:09:02 -03:00
Cristhian Zanforlin Lousa
f8de3a5265 🔧 fix(index.css): adjust width of .api-modal-tabs to be 75vw on small screens to improve responsiveness
🔧 fix(ApiModal/index.tsx): remove unnecessary whitespace
2023-07-14 21:58:13 -03:00
Cristhian Zanforlin Lousa
de2a24fa5d 🐛 fix(ApiModal/index.tsx): fix startState function to properly reset tweak and tweaksList variables
 feat(ApiModal/index.tsx): add logic to reset tweak and tweaksList variables when flow data nodes length is 0
2023-07-14 21:52:26 -03:00
gustavoschaedler
d7a3c10d3a 🔧 refactor(test_custom_component.py): improve readability by breaking long lines of code
🔨 refactor(test_custom_component.py): update import statement to reflect new file structure
2023-07-15 01:02:52 +01:00
gustavoschaedler
0aab360629 🔨 refactor(langflow): improve code parsing and custom component handling
- Refactor code parsing in `code_parser.py` to handle imports, function definitions, and class attributes more robustly and cleanly.
- Add new methods in `component.py` to parse Assign and AnnAssign statements, and FunctionDef statements.
- Refactor `custom_component.py` to improve the handling of custom components, including better extraction of main class name and template configuration.
- Update `types.py` to better handle the building of custom component templates, including handling of field configurations and error handling.
- Minor formatting fix in `conftest.py` test fixture.

These changes improve the robustness and readability of the code, and provide better handling and validation of custom components.
2023-07-15 00:41:31 +01:00
anovazzi1
cd94c47b0e fix bug of scroll on ace Editor 2023-07-14 18:14:04 -03:00