-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
New Component, Multiple outputs and type refactor #2246
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
…nstead of a single ContractEdge instance 🐛 (types.py): Fix _get_result method to handle multiple edges with the same target_id 📝 (types.py): Add comments to clarify the purpose of setting the result in the vertex of origin
The code changes in `chat.py` update the `build_vertex_stream` function to set the cache using `chat_service.set_cache` before closing the stream. This ensures that the cache is updated with the latest data before the stream is closed. The commit message follows the established convention of using a prefix to indicate the type of change.
The code changes in `base.py` add a `user_agent` attribute to the `Settings` class and a corresponding class method `set_user_agent` to set the user agent for API calls. If the `user_agent` is not provided, it defaults to "langflow". The method also updates the `USER_AGENT` environment variable and logs the new value. This refactor improves the flexibility and maintainability of the code. The commit message follows the established convention of using a prefix to indicate the type of change.
…re not properly assigned 🐛 (base.py): Fix issue where outputs were not initialized causing potential errors
…and adapt validation
…d langflow.inputs.TextInput The code changes in `Webhook.py` update the `WebhookComponent` class to inherit from `langflow.custom.Component` instead of `langflow.custom.CustomComponent`. It also replaces the `langflow.schema.dotdict` import with `langflow.template.Output` and updates the `build_data` method to use the `self.data` attribute instead of the `data` parameter. Additionally, it adds a new input `TextInput` for providing a JSON payload. This refactor improves the consistency and readability of the code. The commit message follows the established convention of using a prefix to indicate the type of change.
…dNode The code changes in `frontend_node/base.py` add a new method `validate_name_overlap` to the `FrontendNode` class. This method checks if any of the output names overlap with any of the input names and raises a `ValueError` if there is a duplication. This refactor improves the consistency and correctness of the code. The commit message follows the established convention of using a prefix to indicate the type of change.
…sses The code changes update the langflow custom components to use specific input classes, such as IntInput and TextInput, instead of the generic field types. This refactor improves the clarity and type safety of the code.
…on_entrypoint_args to reflect correct number of arguments in build method 📝 (test_custom_component.py): reorganize import statements for better readability and consistency ♻️ (test_custom_component.py): refactor build method in YourComponent class to simplify and improve code readability
…omponents.py The code changes in test_helper_components.py update the class name from DocumentToDataComponent to DocumentsToDataComponent. This refactor improves the clarity and consistency of the code.
…y path The code changes in test_data_components.py update the `docs_path` variable to fix the directory path for loading components. The previous path was incorrect, and this update ensures that the correct path is used. This refactor improves the accuracy and reliability of the code.
The code changes in inputs.py add a new attribute `load_from_db` to the `SecretStrInput` class. This attribute controls whether the input should be loaded from the database or not. By default, it is set to `True`. This refactor improves the flexibility and configurability of the code.
…enAI exceptions The code changes in exceptions.py add a new function `get_message_from_openai_exception` to handle exceptions raised by the OpenAI library. This function retrieves the error message from the exception and returns it. This refactor improves the error handling and enhances the code's robustness.
The code changes in loading.py add a filter to ignore Pydantic deprecation warnings when building custom components or components. This refactor improves the code's maintainability and ensures compatibility with the latest Pydantic version.
This commit refactors the TextOutputView component to handle a specific case where the `value` prop is an object with a `text` property. It updates the component to check if the `value` is an object and if it contains the `text` property. If so, it assigns the value of `value.text` to `value`. This change improves the flexibility and usability of the component.
This commit improves the handling of the inputValue in the GenericModal component. It checks if the inputValue is a string before assigning it to coloredContent. Additionally, it updates the classNames in the JSX elements to ensure consistent ordering. These changes enhance the reliability and maintainability of the code.
This refactor adds a new method `validate` to the `FrontendNode` class in the `frontend_node/base.py` file. The `validate` method now calls two separate validation methods: `validate_name_overlap` and `validate_attributes`. The `validate_name_overlap` method checks for any overlap between input and output names, while the `validate_attributes` method checks for reserved attributes in the input and output names. These changes improve the reliability and maintainability of the code.
…act messages from artifacts
… in convert_chat_history method
…and improve readability
…ge function to fix potential bug
…y formatted and displayed in the HumanMessage object 📝 (message.py): improve the logic for handling message content and formatting to ensure correct display in the HumanMessage object
…of result.text in test_directory_without_mocks
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
size:L
This PR changes 100-499 lines, ignoring generated files.
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.
This PR adds a new way of building Langflow Components, adds the possibility of defining more than one output and adds the
io
module that exposes many types of inputs.The components that inherit from
CustomComponent
should still work.Components now mostly output
Data
(formerRecord
) andMessage
.MessageInput
passes aMessage
object to the component whileTextInput
gets the.text
from theMessage
and passes it as a string.