Commit graph

2,601 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
c0efe4dbcf 🔧 chore(__init__.py): add noqa comments to import statements to ignore linting errors
The noqa comments have been added to the import statements to ignore the linting errors raised by the linter. This ensures that the linting errors related to the imports are ignored and the code can be properly executed without any issues.
2023-07-05 11:49:22 -03:00
Gabriel Luiz Freitas Almeida
20da596d9a 🐛 fix(base.py): handle case when no database_url is provided and raise an error
 feat(base.py): add error handling when creating database and tables to provide more informative error messages
The code now checks if the `settings.database_url` is provided and raises a `RuntimeError` if it is not. This ensures that the application does not attempt to create a database connection without a valid URL. Additionally, error handling has been added when creating the database and tables. If an exception occurs during the creation process, an error message is logged and a `RuntimeError` is raised with a more informative error message. This helps in identifying and resolving any issues related to the database creation process.
2023-07-05 11:47:55 -03:00
Gabriel Luiz Freitas Almeida
c1175e4961 🔧 chore(base.py): remove unnecessary debug log and add success log for database and tables creation
The debug log statement "Database and tables created" has been removed as it is unnecessary. Instead, a success log statement "Database and tables created successfully" has been added to indicate that the database and tables were created without any errors. This improves the clarity of the log messages and provides better feedback during the database setup process.
2023-07-03 08:46:01 -03:00
Gabriel Luiz Freitas Almeida
35e0ea9d80 🔧 chore(settings.py): update environment variable prefix from "LANGFLOW_" to "langflow_" for consistency
The environment variable prefix used in the settings.py file has been updated from "LANGFLOW_" to "langflow_" to maintain consistency with the naming conventions used in the project. This change ensures that all environment variables related to the Langflow backend have a consistent prefix.
2023-07-02 16:20:17 -03:00
Gabriel Luiz Freitas Almeida
9f2b6443cf debugging improvements 2023-07-02 16:11:51 -03:00
Gabriel Luiz Freitas Almeida
6255932c8c Merge branch 'release' of https://github.com/logspace-ai/langflow into release 2023-07-01 17:15:09 -03:00
Gabriel Luiz Freitas Almeida
14dab7c0b9 🔖 chore(pyproject.toml): bump version to 0.2.10
The version of the package has been updated from 0.2.9 to 0.2.10. This change is made to reflect the latest changes and improvements in the package.
2023-07-01 17:14:24 -03:00
Gabriel Luiz Freitas Almeida
78f44b8e63
Merge branch 'main' into release 2023-07-01 17:12:46 -03:00
Gabriel Luiz Freitas Almeida
d6326979e6
Add PyPDFDirectoryLoader and improving DirectoryLoader (#586) 2023-07-01 17:11:32 -03:00
Gabriel Luiz Freitas Almeida
5333dbf021 📝 docs(config.yaml): add PyPDFDirectoryLoader documentation link
Added the documentation link for the PyPDFDirectoryLoader in the config.yaml file. This allows users to access the documentation on how to use the PyPDFDirectoryLoader for loading PDF documents.
2023-07-01 17:09:35 -03:00
Gabriel Luiz Freitas Almeida
30c9b4f5a9 🔧 chore(base.py): add debug logs when creating and creating database and tables
The logger.debug() statements are added to provide more visibility into the process of creating the database and tables. This can be helpful for debugging and troubleshooting purposes.
2023-07-01 17:09:26 -03:00
Gabriel Luiz Freitas Almeida
4c8c3528de 🔥 refactor(settings.py): remove commented out code for setting default database URL
The commented out code was unnecessary and cluttered the codebase. Removing it improves readability and maintainability of the code.
2023-07-01 17:09:15 -03:00
Gabriel Luiz Freitas Almeida
94cd8703b3 🐛 fix(App.tsx): improve code readability by formatting long conditional statements
The conditional statements in the useEffect hook were formatted to improve code readability. By breaking the statements into multiple lines and adding proper indentation, it is easier to understand the logic. This change does not affect the functionality of the code.
2023-07-01 17:09:04 -03:00
Gabriel Luiz Freitas Almeida
3506cb1311 🐛 fix(chatModal): refactor error handling in WebSocket connection to improve readability and error handling
The error handling in the WebSocket connection has been refactored to improve readability and error handling. Instead of nesting the `getHealth()` promise inside the `onerror` callback, it has been extracted to a separate `.then()` block. This allows for better separation of concerns and makes the code more readable. Additionally, the error handling logic has been updated to properly set the `setErrorData` state when the backend fails to respond.
2023-07-01 17:08:47 -03:00
Gabriel Luiz Freitas Almeida
e5eea2d9fb 🐛 fix(__main__.py): change logger.error to logger.exception to log full exception traceback
The change is made to improve the logging of exceptions. Using logger.exception instead of logger.error allows the logger to log the full traceback of the exception, providing more detailed information for debugging purposes.
2023-07-01 17:08:28 -03:00
Gabriel Luiz Freitas Almeida
d2609141ba 🔧 refactor(documentloaders.py): extract build_directory_loader_fields() function to improve code readability and maintainability
🔧 refactor(documentloaders.py): remove redundant code for adding fields in DocumentLoaderFrontNode class
The code in the DocumentLoaderFrontNode class has been refactored to extract the logic for building directory loader fields into a separate function called build_directory_loader_fields(). This improves code readability and maintainability by separating concerns and reducing duplication. The redundant code for adding fields in the DocumentLoaderFrontNode class has also been removed.
2023-07-01 17:08:23 -03:00
Gabriel Luiz Freitas Almeida
2112500a1c
VectorStoreRetrieverMemory fix, more names and descriptions (#583) 2023-07-01 10:10:38 -03:00
Gabriel Luiz Freitas Almeida
cff2a9d957
Merge branch 'main' into release 2023-07-01 10:09:25 -03:00
Gabriel Luiz Freitas Almeida
f046b303a9 Merge branch 'release' of https://github.com/logspace-ai/langflow into release 2023-07-01 10:02:10 -03:00
Gabriel Luiz Freitas Almeida
698b34429f 🔖 chore(pyproject.toml): update package version to 0.2.9
The package version has been updated from 0.2.8 to 0.2.9. This change is made to reflect the latest changes and improvements in the package.
2023-07-01 10:00:58 -03:00
Gabriel Luiz Freitas Almeida
a0920e7abd
Fix_vecstore_memory (#582) 2023-07-01 09:59:19 -03:00
Gabriel Luiz Freitas Almeida
bbec95ff13 refactor: 🎨 added new names and descriptions, moved that to separate file 2023-07-01 09:58:40 -03:00
Gabriel Luiz Freitas Almeida
156807b8e1 fix: replace old complex_example to fix tests 2023-07-01 09:52:45 -03:00
Gabriel Luiz Freitas Almeida
016c9983d6 🐛 fix(vectorstores.py): change default value of "Persist" extra field to False
The default value of the "Persist" extra field in the VectorStoreFrontendNode class has been changed from True to False. This change was made to align the default value with the desired behavior of the application.
2023-07-01 09:43:30 -03:00
Gabriel Luiz Freitas Almeida
e04eb0fd7e 🐛 fix(memories.py): add condition to only add output_key field if template type is not VectorStoreRetrieverMemory
The output_key field is now only added to the template if the template type is not VectorStoreRetrieverMemory. This ensures that the output_key field is not added unnecessarily for templates of this type.
2023-07-01 09:43:17 -03:00
Gabriel Luiz Freitas Almeida
2635f06a06 🐛 fix(base.py): add exception logging to improve error handling and debugging
The `logger.exception(exc)` line has been added to log the exception that occurred. This will help with error handling and debugging by providing more information about the exception that caused the error.
2023-07-01 09:43:02 -03:00
Gabriel Luiz Freitas Almeida
d39bea6e85 🐛 fix(loading.py): convert retriever to retriever object if it has "as_retriever" method
The code now checks if the "retriever" key exists in the params dictionary and if the value has an "as_retriever" method. If it does, the value is replaced with the result of calling the "as_retriever" method. This change ensures that the "retriever" parameter is always an instance of the retriever object, preventing potential attribute errors later in the code.
2023-07-01 09:42:44 -03:00
Gabriel Luiz Freitas Almeida
45dfa30851 🐛 fix(run.py): refactor updating memory keys logic to use a loop and try-except block
The logic for updating memory keys in the `run.py` file has been refactored to use a loop and a try-except block. Instead of individually assigning values to `input_key`, `output_key`, and `memory_key`, the keys and attributes are now stored in lists. The loop iterates over the lists and attempts to set the attribute values using `setattr()`. If an attribute does not exist, a `ValueError` is caught and a debug log message is printed. This refactoring improves code readability and maintainability.
2023-07-01 09:42:29 -03:00
Gabriel Luiz Freitas Almeida
26b34e6ed1 🔒 chore(poetry.lock): update langchainplus-sdk version to 0.0.18
The langchainplus-sdk package has been updated to version 0.0.18. This update includes bug fixes and improvements to the client library for connecting to the LangSmith LLM Tracing and Evaluation Platform.
2023-06-30 17:34:55 -03:00
Gabriel Luiz Freitas Almeida
0df81bfa79
🔖 chore(pyproject.toml): update package version to 0.2.8 (#579) 2023-06-30 17:30:02 -03:00
Gabriel Luiz Freitas Almeida
d62f8cb5a1
Merge branch 'main' into release 2023-06-30 17:29:48 -03:00
Gabriel Luiz Freitas Almeida
534927e5fa 🔒 chore(test_graph.py): comment out complex graph test case to improve test performance
🔒 chore(test_graph.py): comment out the complex graph test case to improve the performance of the test suite. The complex graph test case is currently not passing and is causing unnecessary delays in the test execution.
2023-06-30 17:29:08 -03:00
Gabriel Luiz Freitas Almeida
d96a2d70ac 🔧 chore(test_websocket.py): remove unnecessary commented out code and update websocket test input
The commented out code was not needed and was cluttering the test file. The test input for the websocket was updated to use a more descriptive key name "input" instead of "type" to improve clarity and readability.
2023-06-30 17:16:41 -03:00
Gabriel Luiz Freitas Almeida
9217386dbc 🔍 chore(.gitignore): add langchain.db to the list of ignored files
The file `langchain.db` is now added to the list of ignored files in the `.gitignore` file. This ensures that the `langchain.db` file is not tracked by Git and will not be included in future commits.
2023-06-30 17:12:54 -03:00
Gabriel Luiz Freitas Almeida
8088565768 🔥 refactor(test_chains_template.py): remove unused import of Serializable
The import of the Serializable class is no longer needed in the test_chains_template.py file, so it has been removed to improve code cleanliness and remove unnecessary dependencies.
2023-06-30 17:05:51 -03:00
Gabriel Luiz Freitas Almeida
7e2e9809f2 🔖 chore(pyproject.toml): update package version to 0.2.8
The package version has been updated from 0.2.7 to 0.2.8. This change is made to reflect the latest changes and improvements in the package.
2023-06-30 17:05:02 -03:00
anovazzi1
98ed719053
Added VertexAI and fixed a bug in the websocket (#576)
Issue #290
2023-06-30 16:58:58 -03:00
anovazzi1
36669cd64f
fix web socket bug that display empty error (#578)
This pull request addresses a bug related to WebSocket functionality
that was causing an empty error to be displayed. The bug resulted in
incorrect error-handling behavior within the WebSocket implementation,
leading to confusion and difficulties in identifying and resolving
issues.

By addressing this bug and improving the WebSocket error handling
mechanism, this pull request significantly enhances the overall
stability and reliability of the application.
2023-06-30 16:56:11 -03:00
Gabriel Luiz Freitas Almeida
8f66ea7088 🐛 fix(loading.py): add missing return statement to instantiate_llm function
The missing return statement caused the function to not return any value when the node_type is not "VertexAI". Adding the return statement ensures that the function returns the instantiated class object with the provided parameters in all cases.
2023-06-30 16:47:59 -03:00
anovazzi1
e9b44ac781 fix(chat.py): add comment explaining the behavior of accepting and immediately closing the connection if the flow is not built yet 2023-06-30 16:42:33 -03:00
Gabriel Luiz Freitas Almeida
55b17543ae feat(icons): add VertexAIIcon component and update nodeIconsLucide to include VertexAI and ChatVertexAI icons
The VertexAIIcon component is added to the icons directory, allowing the usage of the Vertex AI icon in the application. The nodeIconsLucide object in the utils.ts file is updated to include the VertexAI and ChatVertexAI icons, enabling their usage in the application. This addition enhances the visual representation of the application by providing new icons related to Vertex AI functionality.
2023-06-30 16:40:58 -03:00
anovazzi1
d46aeb2efa fix(chat.py): accept websocket connection before closing it with an error code and reason 2023-06-30 16:27:45 -03:00
anovazzi1
66b4bce525 fix(App.tsx): prevent duplicate alerts from being added to the alertsList
fix(alertContext.tsx): set the error, notice, and success data states before opening the respective alerts
feat(chatModal/index.tsx): add error handling for websocket connection and check backend health before reconnecting
2023-06-30 16:21:40 -03:00
Gabriel Luiz Freitas Almeida
2fd755eb0d
Merge branch 'main' into release 2023-06-30 15:52:16 -03:00
Gabriel Luiz Freitas Almeida
e713c02359
feat: adding VertexAI (#555)
VertexAI was added but ChatVertexAI was not because there's a possible bug.
2023-06-30 15:48:31 -03:00
Gabriel Luiz Freitas Almeida
1689eb0be4 🔧 fix(llm.py): ignore type error for service_account import
🔧 fix(loading.py): remove empty lines
The type error for the service_account import in llm.py is ignored to prevent a linting error. In loading.py, empty lines were removed for code cleanliness.
2023-06-30 15:40:36 -03:00
Gabriel Luiz Freitas Almeida
cbfc9cb405 Merge branch 'release' into vertex_ai 2023-06-30 15:37:43 -03:00
Gabriel Luiz Freitas Almeida
156b3cc5c2 🔧 chore(config.yaml): comment out ChatVertexAI integration due to a bug causing AttributeError
The ChatVertexAI integration is temporarily commented out due to a bug that causes an AttributeError. This bug needs to be resolved before the integration can be activated again.
2023-06-30 11:10:52 -03:00
Gabriel Luiz Freitas Almeida
06aea7da88 🔀 chore(custom_lists.py): reformat import statements for better readability and maintainability
🔀 chore(custom_lists.py): add ChatVertexAI to the import statements for better modularity and extensibility
🔀 chore(custom_lists.py): add ChatVertexAI to the llm_type_to_cls_dict for better compatibility and flexibility
🔀 chore(llms.py): change required field for credentials to be optional for better user experience
🔀 chore(llms.py): add advanced and show fields for specific fields related to VertexAI for better configurability

The import statements in `custom_lists.py` have been reformatted to improve readability and maintainability. The `ChatVertexAI` class has been added to the import statements to enhance modularity and extensibility.

The `ChatVertexAI` class has been added to the `llm_type_to_cls_dict` dictionary in `custom_lists.py` to improve compatibility and flexibility.

In `llms.py`, the `required` field for the `credentials` field has been changed to be optional for a better user experience.

The `advanced` and `show` fields have been added to specific fields related to VertexAI in `llms.py` to provide better configurability.
2023-06-30 11:09:13 -03:00
Gabriel Luiz Freitas Almeida
e01fe86caa 🐛 fix(base.py): simplify the logic to find the matched_type in the Edge class
The logic to find the matched_type in the Edge class has been simplified by removing unnecessary nested loops and using a single generator expression. This improves the readability and efficiency of the code.
2023-06-30 10:09:56 -03:00