A new PineconeIcon component was added to the nodeIcons object in utils.ts. This allows the Pinecone icon to be used in the frontend application. The icon was added to improve the visual representation of the Pinecone node in the application.
🐛 fix(process.py): correctly update template_data with tweak_value
The file extension is no longer included in the saved file name to avoid issues with file extensions that may not be supported. In process.py, the tweak_value is now correctly updated in the template_data dictionary. The key is now set to "value" for all tweaks except for "file_path" where the key is set to the name of the tweak.
✨ feat(loading.py): add persist parameter to Chroma vector store instantiation to enable persistence of vector store
The persist parameter is now extracted from the params dictionary before instantiating the Chroma vector store. This improves readability and reduces the complexity of the code. The persist parameter is now added to the Chroma vector store instantiation to enable persistence of the vector store. This allows the vector store to be reused across multiple sessions, improving performance and reducing the time required to load the vector store.
🐛 fix(vectorstores.py): add persist field to Weaviate vector store type
The `VectorStoreFrontendNode` class now supports the Chroma vector store type. A new boolean field `persist` has been added to the Chroma vector store type. The `add_extra_fields` method has been updated to add the `persist` field to the Chroma vector store type. The `format_field` method has been updated to include the `persist` field in the basic fields. Additionally, the `add_extra_fields` method has been updated to add the `weaviate_url` field to the Weaviate vector store type.
The changes in this commit are purely cosmetic. The indentation and formatting issues in the code have been fixed to improve readability and maintainability.
The version number has been updated from 0.1.6 to 0.1.7 to reflect the changes made in the package. This is a chore commit as it does not add any new features or fix any bugs, but rather updates the version number.
The QueryCheckerTool class was renamed to QuerySQLCheckerTool to match the correct class name. This change ensures that the correct class is being used and avoids any potential errors that may arise from using the wrong class name.
The langchain dependency has been updated to version 0.0.208 to ensure compatibility with the latest version of the package. The package version has been bumped to 0.1.6 to reflect the changes made.
🔼 chore(pyproject.toml): update langchain dependency to version 0.0.208
The save_uploaded_file function now uses the folder_name parameter instead of file_name to improve semantics. The appdirs library is now used to get the user cache directory and a folder for langflow cache is created. The sha256 hash of the file content is now used as the file name to avoid collisions and improve security. A folder is now created for each flow_id in the save_uploaded_file function. The code that deletes files after loading in the instantiate_documentloader function has been removed as it is unnecessary and can cause issues.
🐛 fix(endpoints.py): change file_name parameter to folder_name in save_uploaded_file function
🔒 chore(utils.py): use appdirs to get user cache directory and create a folder for langflow cache
🔒 chore(utils.py): use sha256 hash of file content as file name to avoid collisions and improve security
🔒 chore(utils.py): create folder for each flow_id in save_uploaded_file function
The flows and tabIndex variables were not being used in the component, so they were removed. The tabId variable from the TabsContext is now being used instead to upload the file to the correct tab.
The Swagger API overview and paths have been updated to reflect the latest changes in the API. The changes include adding support for a new environment variable, `process.env.PORT`, to allow the application to run on a configurable port. Additionally, the Swagger API documentation has been updated to reflect the latest API version and routes.
🔍 chore(links): update links to use HTTPS instead of HTTP
The links were updated to use HTTPS instead of HTTP to improve security and prevent potential man-in-the-middle attacks.
🚨 fix(Openapi.json): fix invalid JSON syntax by removing trailing comma
The Openapi.json file had an invalid JSON syntax due to a trailing comma in the "file_path" field. This commit removes the trailing comma to fix the syntax error.
🔥 chore(test_graph.py): remove unnecessary comments and assertions
🚀 feat(test_graph.py): add file creation and deletion to test_file_tool_node_build and test_toolkit_node_build
The comments and assertions that were removed were unnecessary and did not add any value to the code. The test_file_tool_node_build and test_toolkit_node_build tests now create a file and delete it after the test is run. This ensures that the tests are self-contained and do not leave any artifacts behind.
✨ feat(endpoints.py): add UploadFileResponse schema to standardize upload file response
The client_id parameter in the create_upload_file endpoint has been renamed to flow_id to improve semantics. The UploadFileResponse schema has been added to standardize the response of the create_upload_file endpoint. The response now includes the flowId and file_path fields.
✨ feat(utils.py): remove unused functions and add docstring to save_uploaded_file function
The try-except block in the create_upload_file function handles exceptions that may occur when saving uploaded files. The save_uploaded_file function now has a docstring that explains its purpose and returns the path to the saved file. The unused functions save_cache and load_cache have been removed.
The file upload functionality has been refactored to use a separate function called uploadFile, which is imported from the API controller. This improves the separation of concerns and makes the code more modular.
The uploadFile function allows the user to upload a file to the server. It takes in a file and an ID of the flow to upload the file to. The function creates a FormData object and appends the file to it. It then sends a POST request to the server with the FormData object as the body. The server responds with a Promise containing the response data.
This commit adds a new type definition for the UploadFileTypeAPI, which includes a single property file_path of type string. This type will be used to define the response of an API endpoint that handles file uploads.
The version number has been updated from 0.1.4 to 0.1.5 to reflect the changes made in the package. This is a chore commit as it does not add any new features or fix any bugs, but rather updates the version number.
The conditional statement in the update_flow function was incorrect. The if statement was checking for the opposite of what was intended. The fix changes the if statement to check for the correct condition.
# Pull Request Description
## Summary
This Pull Request includes several code improvements, refactoring,
feature additions, and documentation updates mainly focused on enhancing
the functionality and maintainability of the codebase.
## Details
### Refactoring and Improvements:
- **Commit (5ea20aa) by @ogabrielluiz**: Unnecessary indentation in the
`getPythonCode` function within `constants.tsx` has been removed to
improve code readability.
- **Commit (6886828) by @ogabrielluiz**:
- Changed the `load_flow_from_json` function signature in `process.py`
to accept either a JSON file path or a JSON object.
- Updated the import statement for `Chain` in `base.py` to be more
explicit by importing it from `langchain.chains.base` instead of
`langflow.graph.vertex.types`.
- Removed a print statement from the `process_tweaks` function in
`process.py`.
- Added an optional `tweaks` parameter to the `load_flow_from_json`
function.
- Changed the return type of the `build` method in the `Graph` class
from `List[Vertex]` to `Chain`.
- **Commit (83c28dc) by @ogabrielluiz**: The `process_tweaks` function
in `process.py` has been refactored to improve readability and
maintainability. An `apply_tweaks` function was added to apply tweaks to
the node, and a `validate_input` function was added for input
validation. The function now raises a `ValueError` if the input is not
in the expected format.
- **Commit (11185af) by @ogabrielluiz**: Refactored the
`fix_memory_inputs` function in `process.py` to improve readability by
reducing nesting. The function now checks if the `langchain_object` has
a `memory` attribute and if it is not `None` before proceeding. The
try-except block was also refactored to reduce nesting.
- **Commit (f180fa6) by @ogabrielluiz**: The input parameter in
`process.py` has been changed to accept a `Path` object in addition to a
string or dictionary, improving the flexibility of the function and
allowing for easier file handling.
### Features:
- **Commit (8a5525f) by @ogabrielluiz**: The `getPythonCode` function in
`constants.tsx` now accepts a `tweaks` parameter which is used to
customize the behavior of the flow. A `buildTweaks` function generates
the `tweaks` object which is passed to the `load_flow_from_json`
function.
- **Commit (c5d6f48) by @ogabrielluiz**: Added a `build_and_install`
target to the `Makefile` to build the package and install it without
running it. This is useful for building and installing on a remote
server. Additionally, fixed the path to the `langflow.main` module in
the backend target of the `Makefile`.
### Documentation:
- **Commit (76a1265) by @ogabrielluiz**: Updated the Langflow API usage
example in `README.md` to reflect the new API endpoint URL. Added a new
optional `tweaks` parameter to the `run_flow` function for flow
customization and updated the example code accordingly.
### Other:
- **Commit (0dcd93e) by @lucaseduoli**: Added Discord and Twitter icons,
and GitHub stars.
- **Commit (0dcd93e) by @lucaseduoli**: Fixed the Twitter link.
The version number has been updated from 0.1.3 to 0.1.4. This is a chore commit as it does not introduce any new features or bug fixes, but rather updates the version number to reflect changes made in the package.
✨ feat(chat.py): add progress logging to stream_build function
The variable node was renamed to vertex to improve semantics and consistency with the naming conventions. Progress logging was added to the stream_build function to provide feedback to the user on the progress of the build process.
🐛 fix(index.tsx): fix typo in setSuccessData function call
✨ feat(index.tsx): add success logging to handleBuild function
A typo in the setSuccessData function call was fixed. Success logging was added to the handleBuild function to provide feedback to the user on the success of the build process.