Commit graph

3,710 commits

Author SHA1 Message Date
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
anovazzi1
3baa3a1ca5 Merge branch 'python_custom_node_component' of personal:logspace-ai/langflow into python_custom_node_component 2023-07-27 09:47:20 -03:00
anovazzi1
3d103398e3 fix(codeAreaModal): clear error state when setting value to code and closing modal to prevent displaying previous errors 2023-07-27 09:46:29 -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
e43f52dd7a 📝 docs(custom-component.mdx): update guidelines for creating custom components
 feat(custom-component.mdx): add example code for creating a custom component
🔧 chore(custom-component.mdx): update code comments and fix typo in build_config method
2023-07-27 08:04:18 -03:00
Gabriel Luiz Freitas Almeida
529322e56a 🎨 style(custom.css): adjust max-width and min-width of .ch-scrollycoding-content and .ch-scrollycoding-sticker to improve layout proportions 2023-07-27 08:00:22 -03:00
Gabriel Luiz Freitas Almeida
d8980d34f2 🔧 chore(docusaurus.config.js): enable sidebar to be hideable in the docs section for better user experience 2023-07-27 07:59:58 -03:00
Gabriel Luiz Freitas Almeida
34008bf3d0 🔄 refactor(index.tsx): reorder import statements for better readability and consistency 2023-07-27 07:02:48 -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
Gabriel Luiz Freitas Almeida
6b7ab2aded 📝 docs(custom-component.mdx): add documentation for custom components
🎨 style(custom.css): update styling for code blocks and sidebar in documentation
2023-07-27 06:58:39 -03:00
Gabriel Luiz Freitas Almeida
9a1c20d750 📝 docs(custom.mdx): add documentation for custom component 2023-07-27 06:58:38 -03:00
Gabriel Luiz Freitas Almeida
ea8865dc18 🔧 chore(docs): update docusaurus.config.js to use monokai theme for code highlighting, show copy button, and display line numbers
📝 docs(sidebars.js): add "guidelines/custom-component" and "components/custom" to the sidebar for better navigation and discoverability
2023-07-27 06:58:38 -03:00
Gabriel Luiz Freitas Almeida
bb247af614 🔧 chore(package.json): update dependencies
📦 Add new dependency:
- "@code-hike/mdx": "^0.9.0"

🔄 Update existing dependencies:
- "@mdx-js/react": "^2.3.0"
- "docusaurus-theme-mdx-v2": "^0.1.2"
2023-07-27 06:58:37 -03:00
Gabriel Luiz Freitas Almeida
e78ce40cbf 🔧 fix(docusaurus.config.js): fix import statement for remarkCodeHike to resolve linting error
 feat(docusaurus.config.js): add support for code highlighting with remarkCodeHike plugin
2023-07-27 06:58:36 -03:00
Gabriel Luiz Freitas Almeida
8ac890c553 🔧 chore(chains.mdx): add import statement for Admonition component to improve code organization and readability
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧 chore(chains.mdx): update verbose parameter description to improve clarity
🔧 chore(chains.mdx): fix formatting and indentation for better code readability
🔧

📝 chore(docs): update import statements for Admonition component in examples

📝 chore(docs): update link in Prompts component to use Admonition component

📝 chore(docs): update import statements for Admonition component in examples

📝 chore(docs): update link in Conversation Chain component to use Admonition component

📝 chore(docs): update import statements for Admonition component in examples

📝 chore(docs): update link in CSV Loader component to use Admonition component

📝 chore(docs): update import statements for Admonition component in examples

📝 chore(docs): update link in MidJourney Prompt Chain component to use Admonition component

📝 chore(docs): update import statements for Admonition component in examples

📝 chore(docs): update link in Multiple Vector Stores component to use Admonition component

📝 docs(examples/python-function.mdx): add import statement for Admonition component
📝 docs(examples/python-function.mdx): improve readability of tip admonition by breaking lines
📝 docs(examples/python-function.mdx): improve readability of info admonition by breaking lines
📝 docs(examples/serp-api-tool.mdx): add import statement for Admonition component
📝 docs(examples/serp-api-tool.mdx): improve readability of info admonition by breaking lines
📝 docs(guidelines/features.mdx): add import statement for Admonition component
📝 docs(guidelines/features.mdx): improve readability of caution admonition by breaking lines
2023-07-27 06:58:35 -03:00
anovazzi1
011dd98050 fixed bug on check and save 2023-07-26 16:44:15 -03:00
gustavoschaedler
ba02e99ec5 🔄 refactor(index.tsx): reorder import statements for better organization and readability 2023-07-26 18:02:12 +01:00
gustavoschaedler
d5ee293590 🔧 fix(test_custom_component.py): fix import statements and formatting issues in test_custom_component.py
 feat(test_custom_component.py): add tests for list_flows, build_config methods in CustomComponent class
🔧 fix(test_custom_component.py): fix formatting issues in test_list_flows_multiple_queries test
 feat(test_custom_component.py): add tests for list_flows, build_config methods in CustomComponent class
 feat(test_custom_component.py): add test for return type of list_flows method in CustomComponent class
 feat(test_custom_component.py): add test for return type of build_config method in CustomComponent class
 feat(test_custom_component.py): add test for presence of 'fields' key in build_config method in CustomComponent class
 feat(test_custom_component.py): add test for type of 'fields' value in build_config method in CustomComponent class
 feat(test_custom_component.py): add test for type of keys in 'fields' value in build_config method in CustomComponent class
 feat(test_custom_component.py): add test for type of values in 'fields' value in build_config method in CustomComponent class
2023-07-26 17:40:53 +01: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
28149ddb6c 🔧 fix(index.css): remove unnecessary whitespace and comments for better code readability
 feat(index.css): add support for beta background and foreground colors to improve visual design and user experience

🔧 chore(styles.css): reorganize color variables for better readability and maintainability
2023-07-26 10:00:34 -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
c93febc7a3 🚀 feat(test_agents_template.py): add "fileTypes" field to the "path" agent configuration to specify supported file types 2023-07-26 07:43:16 -03:00
Lucas Oliveira
d79f58cfb5
Notification modal refactor (#683)
This pull request refers to the Notification Center modal refactor,
deleting permanently the PopupContext way of showing the popup, and
utilizing the Popover component from ShadCN to display it.
2023-07-26 07:13:35 -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
gustavoschaedler
f486c27a2f 🔥 refactor(types.py): remove commented out code for building langchain custom component list from path
🔨 refactor(types.py): refactor load_files_from_path function to improve readability and maintainability

🔨 refactor(types.py): refactor build_and_validate_all_files function to improve readability and maintainability

🔨 refactor(types.py): refactor build_invalid_menu function to improve readability and maintainability
2023-07-25 23:45:35 +01:00
gustavoschaedler
0ada6b841f 🐛 fix(types.py): remove unnecessary blank line
 feat(types.py): refactor build_langchain_template_custom_component function to improve readability and error handling
2023-07-25 23:44:36 +01:00
Igor Carvalho
b70ed70788 refactor[index.css]: Refactor index.css 2023-07-25 19:03:04 -03:00
anovazzi1
e232d33c07 feat(EditFlowSettingsComponent): add validation for duplicate flow names
- Added `invalidName` and `setInvalidName` props to `EditFlowSettings` component to handle validation for duplicate flow names.
- Added `nameLists` useRef to store the list of flow names fetched from the database.
- Added `useEffect` to fetch the flow names from the database and populate `nameLists` useRef.
- Modified `handleNameChange` function to check if the entered name already exists in `nameLists` useRef and set `invalidName` accordingly.
- Added a new span element to display an error message if the name is already in use.

fix(flowSettingsModal): disable save button when the flow name is invalid

- Added `invalidName` and `setInvalidName` states to `FlowSettingsModal` component to handle the validation for invalid flow names.
- Passed `invalidName` and `setInvalidName` props to `EditFlowSettings` component.
- Disabled the save button when `invalidName` is true.
2023-07-25 18:49:52 -03:00
gustavoschaedler
e8f6b435f2 🐛 fix(types.py): fix formatting issues in build_langchain_template_custom_component function for better readability
🐛 fix(types.py): fix formatting issues in build_langchain_custom_component_list_from_path function for better readability
2023-07-25 22:20:28 +01:00
gustavoschaedler
60f6c0a8ed Merge branch 'python_custom_node_component' of github.com:logspace-ai/langflow into python_custom_node_component 2023-07-25 22:06:21 +01:00
gustavoschaedler
883f852b73 🐛 fix(utils.py): move merge_nested_dicts function to the top of the file for better organization
 feat(utils.py): add merge_nested_dicts function to merge nested dictionaries recursively
🐛 fix(endpoints.py): import merge_nested_dicts function from the correct module
 feat(endpoints.py): use merge_nested_dicts function to merge dictionaries in build_langchain_custom_component_list_from_path function
🐛 fix(types.py): import merge_nested_dicts function from the correct module
 feat(types.py): use merge_nested_dicts function to merge dictionaries in build_langchain_custom_component_list_from_path function
🐛 fix(types.py): import merge_nested_dicts function from the correct module
 feat(types.py): use merge_nested_dicts function to merge valid and invalid menus in build_langchain_custom_component_list_from_path function
🐛 fix(tools.py): import Optional from typing module
 feat(tools.py): add CustomComponentEmptyNode class to represent an empty custom component template
2023-07-25 21:58:09 +01:00
Lucas Oliveira
f35cbde38a Changed color to specific one 2023-07-25 17:56:02 -03:00
Gabriel Luiz Freitas Almeida
4e5850da3a 🔀 chore(base.py): add "beta" field to the serialized representation of FrontendNode class
📝 docs(base.py): update documentation for FrontendNode class to include information about the "beta" field
2023-07-25 17:49:30 -03:00
Lucas Oliveira
11bad4d07d Added classes to index.css 2023-07-25 17:43:51 -03:00
Lucas Oliveira
ae2707d7c3 Merge branch 'python_custom_node_component' of github.com:logspace-ai/langflow into python_custom_node_component 2023-07-25 17:38:49 -03:00
Lucas Oliveira
c9e13eb359 Changed color 2023-07-25 17:38:24 -03:00
Lucas Oliveira
6749fb4475 Changed disposition of Beta div 2023-07-25 17:30:03 -03:00
Gabriel Luiz Freitas Almeida
74e263811b 🔨 refactor(types.py): import CustomComponentFrontendNode from custom_components module to improve code organization and readability
🔨 refactor(types.py): change usage of CustomComponentNode to CustomComponentFrontendNode to align with updated module structure

🔨 refactor(frontend_node/base.py): add beta flag to FrontendNode class to indicate if a node is in beta stage

🔨 refactor(custom_components.py): add beta flag to CustomComponentFrontendNode class to indicate it is in beta stage

🔨 refactor(tools.py): remove unused import of DEFAULT_CUSTOM_COMPONENT_CODE

🔨 refactor(tools.py): remove CustomComponentNode class as it is no longer used
2023-07-25 17:22:02 -03:00
Lucas Oliveira
19c714a7d5 Added Beta badge 2023-07-25 17:14:12 -03:00
Gabriel Luiz Freitas Almeida
b76141b3df 🔄 refactor(custom_component.py): rename list_flow_names method to list_flows for better clarity and consistency
🐛 fix(custom_component.py): fix return value of list_flows method to return the actual flow objects instead of just their names
🔥 chore(custom_component.py): remove unused build method as it is not implemented
2023-07-25 17:12:48 -03:00
Gabriel Luiz Freitas Almeida
95f69442d6 📝 docs(README.md): add documentation for deploying on Railway and Render platforms
📝 docs(README.md): add documentation for the `component-path` command line option to specify custom components directory path
2023-07-25 15:37:12 -03:00