Commit graph

1,394 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
b8141dca7d 🚀 feat(loading.py): move loading into initialize module
📝 docs(initialize): add empty __init__.py file to initialize directory
The initialize directory was added to the project, but it was missing an __init__.py file. This file is necessary to make the directory a package and allow importing modules from it. An empty __init__.py file was added to the directory to fix this issue.
2023-06-22 13:45:04 -03:00
Gabriel Luiz Freitas Almeida
2854633814 🔥 refactor(API): remove unused postValidateNode function
The postValidateNode function is not used in the codebase and has been removed to improve code readability and maintainability.
2023-06-22 11:45:55 -03:00
Gabriel Luiz Freitas Almeida
e5c6c92ecc feat(frontend): add Pinecone icon to nodeIcons
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.
2023-06-22 11:45:44 -03:00
Gabriel Luiz Freitas Almeida
a534fa9337 Merge remote-tracking branch 'origin/main' into multipart_endpoint 2023-06-21 18:21:35 -03:00
Gabriel Luiz Freitas Almeida
96bce3da81 🐛 fix(utils.py): remove file extension from saved file name
🐛 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.
2023-06-21 17:45:12 -03:00
Gabriel Luiz Freitas Almeida
3781f1ddda 🔨 refactor(loading.py): extract persist parameter from params for Chroma vector store instantiation
 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.
2023-06-21 17:27:57 -03:00
Gabriel Luiz Freitas Almeida
b7eab50672 🚀 feat(vectorstores.py): add support for Chroma vector store type
🐛 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.
2023-06-21 17:27:40 -03:00
Gabriel Luiz Freitas Almeida
dbbba573e3 style: formatting 2023-06-21 16:18:31 -03:00
Gabriel Luiz Freitas Almeida
860c36146e 🎨 style(documentloaders.py): fix indentation and formatting issues
The changes in this commit are purely cosmetic. The indentation and formatting issues in the code have been fixed to improve readability and maintainability.
2023-06-21 16:18:11 -03:00
Gabriel Luiz Freitas Almeida
10db240a6b 🐛 fix(custom.py): rename QueryCheckerTool to QuerySQLCheckerTool to match the correct class name
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.
2023-06-21 16:08:37 -03:00
Gabriel Luiz Freitas Almeida
19a5eb0467
Merge branch 'main' into release 2023-06-21 19:02:26 +00:00
Gabriel Luiz Freitas Almeida
bdd2076deb 🔒 chore(loading.py): remove code that deletes files after loading in instantiate_documentloader function
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
2023-06-21 15:43:27 -03:00
Gabriel Luiz Freitas Almeida
59deed4009 🔨 refactor(inputFileComponent): remove unused flows and tabIndex variables, use tabId instead
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.
2023-06-21 13:42:52 -03:00
Gabriel Luiz Freitas Almeida
66ee979c0b
feat: add support for DirectoryLoader (#520) 2023-06-21 13:57:30 +00:00
Gabriel Luiz Freitas Almeida
57f322a0e6 🔥 refactor(endpoints.py): rename client_id to flow_id in create_upload_file endpoint
 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.
2023-06-21 10:33:33 -03:00
Gabriel Luiz Freitas Almeida
c26ecd3bda 🔥 refactor(base.py): remove unused import statement
The import statement for cache_utils in base.py was not being used and has been removed.
2023-06-21 10:29:36 -03:00
Gabriel Luiz Freitas Almeida
5ad0bc6b65 🐛 fix(endpoints.py): add try-except block to handle exceptions when saving uploaded files
 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.
2023-06-21 10:27:56 -03:00
Gabriel Luiz Freitas Almeida
a81a99f1c4 🎨 style(inputFileComponent): refactor file upload to use a separate function
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.
2023-06-21 10:21:20 -03:00
Gabriel Luiz Freitas Almeida
5216b519e0 🚀 feat(API): add uploadFile function to upload files to the server
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.
2023-06-21 10:21:05 -03:00
Gabriel Luiz Freitas Almeida
0d7df8a330 🚀 feat(api): add UploadFileTypeAPI type definition
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.
2023-06-21 10:20:48 -03:00
Gabriel Luiz Freitas Almeida
0dd16ee794 Merge remote-tracking branch 'origin/dev' into multipart_endpoint 2023-06-21 10:07:14 -03:00
anovazzi1
ce66d753e2 feat(chatInput): add useEffect hook to focus on chat input when lockChat is false and inputRef is available
fix(chatInput): remove unnecessary comment in useEffect hook
2023-06-20 20:49:32 -03:00
Valerio Capozio
372463912c feat: add support for DirectoryLoader 2023-06-20 23:51:41 +02:00
Gabriel Luiz Freitas Almeida
2029b08d2e Merge remote-tracking branch 'origin/main' into dev 2023-06-20 16:18:37 -03:00
Gabriel Luiz Freitas Almeida
5f5bf06ab2 🐛 fix(flows.py): fix conditional statement in update_flow function
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.
2023-06-20 16:11:33 -03:00
anovazzi1
46a30cf92e zoom out 10x bigger 2023-06-20 15:45:48 -03:00
Lucas Oliveira
c969bcca78 Fixed spearator 2023-06-19 19:33:07 -03:00
Gabriel Luiz Freitas Almeida
f511ddc20f Merge remote-tracking branch 'origin/main' into dev 2023-06-19 17:17:07 -03:00
Lucas Oliveira
b616e0dd42 fixed twitter link 2023-06-19 16:16:58 -03:00
Lucas Oliveira
9be559397b removed api key 2023-06-19 16:14:25 -03:00
Gabriel Luiz Freitas Almeida
825f2798c3 🐛 fix(chat.py): fix node to vertex variable name in stream_build function
 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.
2023-06-19 16:03:25 -03:00
Lucas Oliveira
0dcd93ef92 added discord and twitter icons, added github stars 2023-06-19 15:45:26 -03:00
Gabriel Luiz Freitas Almeida
f180fa6f26 🐛 fix(process.py): change input parameter type hint to include Path type
The input parameter now accepts a Path object in addition to a string or dictionary. This improves the flexibility of the function and allows for easier file handling.
2023-06-19 14:25:10 -03:00
Gabriel Luiz Freitas Almeida
8a5525f465 🚀 feat(constants.tsx): add tweaks parameter to getPythonCode function to allow for customization of flow behavior
The `getPythonCode` function now accepts a `tweaks` parameter which is used to customize the behavior of the flow. The `buildTweaks` function is called to generate the `tweaks` object which is then passed to the `load_flow_from_json` function. This allows for more flexibility in the usage of the flow.
2023-06-19 14:24:48 -03:00
Gabriel Luiz Freitas Almeida
11185affdd 🐛 fix(process.py): refactor fix_memory_inputs function to improve readability and reduce nesting
The fix_memory_inputs function was refactored to reduce nesting and improve readability. 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.
2023-06-19 12:02:15 -03:00
Gabriel Luiz Freitas Almeida
83c28dcabe 🔨 refactor(process.py): refactor process_tweaks function to improve readability and maintainability
 feat(process.py): add input validation to process_tweaks function
The process_tweaks function has been refactored to improve readability and maintainability. The apply_tweaks function has been added to apply the tweaks to the node. The validate_input function has been added to validate the input parameters. The process_tweaks function now raises a ValueError if the input is not in the expected format.
2023-06-19 11:59:34 -03:00
Gabriel Luiz Freitas Almeida
6886828ddd 🔀 refactor(process.py): change load_flow_from_json function signature to accept either a JSON file path or a JSON object
🔀 refactor(base.py): import Chain from langchain.chains.base instead of importing it from langflow.graph.vertex.types
🔀 refactor(process.py): remove print statement from process_tweaks function
🔀 refactor(process.py): change load_flow_from_json function signature to accept optional tweaks parameter
🔀 refactor(process.py): change return type of build method in Graph class from List[Vertex] to Chain
🧪 test(loading.py): add test case for loading a flow from a JSON file and applying tweaks
🧪 test(loading.py): remove unused import statement
The import statement for Chain in base.py is now more explicit and imports it from langchain.chains.base instead of importing it from langflow.graph.vertex.types. The load_flow_from_json function in process.py now accepts either a JSON file path or a JSON object. The print statement in process_tweaks function has been removed. The load_flow_from_json function in process.py now accepts an optional tweaks parameter. The return type of the build method in the Graph class has been changed from List[Vertex] to Chain. A new test case has been added to loading.py to test loading a flow from a JSON file and applying tweaks. An unused import statement has been removed from loading.py.
2023-06-19 11:36:43 -03:00
Gabriel Luiz Freitas Almeida
5ea20aa2f0 🔨 refactor(constants.tsx): remove unnecessary indentation in getPythonCode function
The indentation of the commented line in the getPythonCode function was unnecessary and has been removed to improve code readability.
2023-06-19 10:55:18 -03:00
Gabriel Luiz Freitas Almeida
e01993b7f1 🐛 fix(__main__.py): add support for running Langflow on Windows
 feat(__main__.py): add support for running Langflow on MacOS and Linux using gunicorn
The changes add support for running Langflow on Windows by using uvicorn instead of gunicorn. This is because Windows doesn't support gunicorn. The changes also add support for running Langflow on MacOS and Linux using gunicorn. This is because MacOS requires an env variable to be set to use gunicorn.
2023-06-19 09:55:29 -03:00
dependabot[bot]
7111bee8db
build(deps-dev): bump vite from 4.3.5 to 4.3.9 in /src/frontend
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.3.5 to 4.3.9.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.3.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-18 12:05:35 +00:00
Gabriel Luiz Freitas Almeida
b93d5020b3 🐛 fix(process.py): caching objects does not depend on is_first_message anymore 2023-06-17 13:34:35 -03:00
Gabriel Luiz Freitas Almeida
7d7986c5bd 🔥 chore(frontend): remove prepare-commit-msg git hook
The prepare-commit-msg git hook was removed from the frontend directory. This hook was not being used and was not necessary for the project's development workflow.
2023-06-16 19:57:33 -03:00
Gabriel Luiz Freitas Almeida
3a324ed45a Merge remote-tracking branch 'origin/main' into dev 2023-06-16 19:28:47 -03:00
Gabriel Luiz Freitas Almeida
fee54b817b 🐛 fix(process.py): fix conditional statement to check if "nodes" is in graph_data
The conditional statement was checking if "nodes" is in "graph_data['data']" instead of checking if "nodes" is in "graph_data". This fix ensures that the correct data is processed and avoids potential errors.
2023-06-16 19:06:46 -03:00
Gabriel Luiz Freitas Almeida
9ff68eef82 🔥 chore(main.py): remove unnecessary newline at the beginning of the file
The only change in this commit is the removal of an unnecessary newline at the beginning of the file. This improves the code's readability and consistency.
2023-06-16 19:01:41 -03:00
Gabriel Luiz Freitas Almeida
c7cbb40c36 format: run make format 2023-06-16 18:54:18 -03:00
Gabriel Luiz Freitas Almeida
b06e7a058a 🐛 fix(chat.py): add type hint to flow_data_store variable
🔥 chore(main.py): remove unused imports and variables
The `flow_data_store` variable in `chat.py` was missing a type hint, which was added to improve code readability and maintainability. In `main.py`, unused imports and variables were removed to improve code cleanliness.
2023-06-16 18:52:55 -03:00
Gabriel Luiz Freitas Almeida
28a902ec15 🚀 chore(MainPage): use constant for header text in user projects section
The changes in headerComponent remove unused imports and update the header text to use a constant instead of a hardcoded string. The constant is added in constants.tsx. The MainPage component is updated to use the constant for the header text in the user projects section. This improves code readability and maintainability.
🎨 style(headerComponent): remove unused imports and update header text to use constant
 feat(constants.tsx): add constant for header text in user projects section
2023-06-16 18:39:06 -03:00
Gabriel Luiz Freitas Almeida
bf621c78b4 🐛 fix(__main__.py): fix issue where app was not serving the index.html file when a 404 error occurred
 feat(main.py): remove static_path argument from create_app function
The fix to the issue where the app was not serving the index.html file when a 404 error occurred was done by adding an exception handler to the app that returns the index.html file when a 404 error occurs. The create_app function was modified to remove the static_path argument as it was not being used in the function.
2023-06-16 18:36:06 -03:00
anovazzi1
e1e5fb14c9 refactor(typesContext.tsx): reverse the order of keys in the types object to avoid overlap with tool world
The keys in the types object were reversed to avoid overlap with the tool world. This was done by modifying the reduce function in the TypesProvider component.
2023-06-16 18:20:06 -03:00