-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python custom node component #610
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Preparing review... |
… conditional check to prevent unnecessary handleClick execution
…k 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
…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
…_langchain_types_dict for clarity and consistency 🔨 refactor(types.py): remove unused langchain_types_dict variable to improve code cleanliness
…/langflow into python_custom_node_component
…w 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
…ity in DocumentLoaderVertex and TextSplitterVertex
…to improve code readability and maintainability feat(codeAreaModal): add typesContext to access reactFlowInstance for cleaning edges before processing code
…nd log file parameters for better customization 🔧 chore(logger.py): remove unnecessary blank lines and comments for cleaner code
…onent; Fixed bug where handles are not refreshed on custom component;
…/langflow into python_custom_node_component
🔧 fix(utils.ts): replace Sparkles icon with GradientSparkles icon component in nodeIconsLucide object
…component' into python_custom_node_component
…con for custom_components in nodeIconsLucide object to improve visual consistency
…d maintainability 🚀 feat(custom_component.py): add `load_flow` method to load a flow from the database using session and flow_id
…lass documentation 🔀 docs(custom.mdx): merge changes from the CustomComponent class documentation 📝 docs(custom.mdx): improve readability and formatting in the CustomComponent class documentation 🔀 docs(custom.mdx): merge changes from the CustomComponent class documentation 📝 docs(custom.mdx): update CustomComponent class documentation with additional methods and descriptions 🔀 docs(custom.mdx): merge changes from the CustomComponent class documentation 📝 docs(custom.mdx): update CustomComponent class documentation with corrected method names and descriptions 🔀 docs(custom.mdx): merge changes from the CustomComponent class documentation
…/langflow into python_custom_node_component
…t in FlowRunner class The commit adds an explanation about using a `Document` as input in the `FlowRunner` class. It clarifies that using a `Document` is a straightforward way to pass text data in Langflow. Typically, a flow expects a string or a dictionary as input, and if a dictionary is used, it should be built according to the needs of the specific flow. The commit also mentions that the content of a document can be extracted using the `page_content` property and passed as an argument to the selected flow.
…n FlowRunner class The change clarifies that using a `Document` as input in the `FlowRunner` class is a straightforward way to pass text data in Langflow, specifically because it can be connected to many loaders. It also mentions that generally, a flow expects a string or a dictionary as input. Additionally, it updates the explanation of extracting the content of a document using the `page_content` attribute, which is a string.
…s for running documentation locally using Docusaurus 🐛 fix(how-contribute.md): fix formatting and add missing newline at end of file
…elopment instructions 🚩GitHub Issues: - Update heading level for GitHub Issues section to match the document structure Issue labels: - Update heading level for Issue labels section to match the document structure Local development: - Update heading level for Local development section to match the document structure Run locally: - Update heading level for Run locally section to match the document structure - Add instructions for installing dependencies and starting the development server for the backend - Add instructions for installing dependencies and starting the development server for the frontend Docker compose: - Update heading level for Docker compose section to match the document structure - Add instructions for running the backend and frontend using Docker compose Documentation: - Update heading level for Documentation section to match the document structure - Add instructions for running the documentation locally using Docusaurus - Update the available URL for the documentation Create a Pull Request: - Add a closing statement with instructions to create a Pull Request to the `main` branch
…o use Optional type hint for flow_name and flow_id parameters for better clarity and maintainability
… 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
… accept an optional get_session parameter for better flexibility and testability
✨ feat(conftest.py): add session_getter fixture to create a blank session for testing 🔧 fix(test_custom_component.py): pass session_getter fixture to list_flows function for testing
…istency 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
📝 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
…ponents outside of the standard interface 📝 docs(custom-component.mdx): update folder structure section to include custom agents directory 📝 docs(custom-component.mdx): add instructions for specifying the path to custom components using the Langflow CLI 📝 docs(custom-component.mdx): add instructions for setting the LANGFLOW_COMPONENTS_PATH environment variable 📝 docs(custom-component.mdx): clarify that Langflow will continue loading components even if there are errors in some of them 📝 docs(custom-component.mdx): add section on interacting with custom components in Langflow's sidebar
…ing in 'Other' category if using a subdirectory not listed in config.yaml
…er' for better clarity and consistency
…omponents-path` argument using italics 📝 docs(chatprompttemplate_guide.mdx): update the "Prompt" field text to use italics for better readability
… to 'text' for clarity and consistency
… use the "github-light" theme for better code highlighting aesthetics
… class 🐛 fix(directory_reader.py): fix error message typo in DirectoryReader class
…fic 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
…hint is used but not imported 🔍 refactor(directory_reader.py): improve error handling when checking if type hint is used but not imported
…the CustomComponent class 📝 docs(custom-component.mdx): update example code and description of the 'repr_value' attribute in the DocumentProcessor class
…act the first element to ensure compatibility with the flow 🔨 refactor(flow-runner.mdx): remove unnecessary comment and unused variable to improve code readability and maintainability
…f value is None to prevent potential errors
ogabrielluiz
approved these changes
Aug 1, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.