Commit graph

6,039 commits

Author SHA1 Message Date
Cristhian Zanforlin Lousa
dd80f857a9 Merge branch 'authentication' into login-auth 2023-08-14 18:48:23 -03:00
Cristhian Zanforlin Lousa
b96fcfb06c 🔧 fix(AdminPage/index.tsx): fix incorrect assignment of users and total count in getUsersPage response
🔧 fix(AdminPage/index.tsx): fix incorrect assignment of filtered user list in getUsersPage response
🔧 fix(AdminPage/index.tsx): fix incorrect assignment of total rows count in getUsersPage response
2023-08-14 18:48:01 -03:00
gustavoschaedler
e9a94d7374 🐛 fix(auth.py): remove unnecessary blank line
🐛 fix(auth.py): add validation for inactive users and users waiting for approval in authenticate_user function
 feat(login.py): remove unnecessary blank line
2023-08-14 22:46:55 +01:00
Cristhian Zanforlin Lousa
e124b216d7 🔨 refactor(headerComponent/index.tsx): simplify header component by removing unnecessary conditional rendering and adding sign out button 2023-08-14 18:45:09 -03:00
Cristhian Zanforlin Lousa
2aa33bb08b merge authentication 2023-08-14 18:28:47 -03:00
Cristhian Zanforlin Lousa
6d3d9569bd 📦 feat(authAdminGuard): add ProtectedAdminRoute component to handle authentication and authorization for admin pages
📦 feat(catchAllRoutes): add CatchAllRoute component to redirect to the root ("/") when the catch-all route is matched

🔧 refactor(api.tsx): remove console.log statement

🔧 refactor(AdminPage): remove disabled prop from Checkbox components

🔧 refactor(loginPage): change Link to="/signup" to Link to="/signup" to fix incorrect link

🔧 refactor(routes.tsx): remove import statement for ProtectedRoute component and add import statements for CatchAllRoute and ProtectedAdminRoute components
2023-08-14 18:28:04 -03:00
Gustavo Schaedler
cb47f7cf8e
Fix HumanMessagePromptTemplate bug (#763)
HumanMessagePromptTemplate and some other MessagePromptTemplates were
not built correctly.

This fixes SystemMessage Example.
2023-08-14 22:22:11 +01:00
igorrCarvalho
cb66255b84 Refactor: Refactor api modal constant 2023-08-14 18:17:12 -03:00
gustavoschaedler
501d7399a8 🔒 chore(auth.py): add support for retrieving current user and current active user
🔒 chore(auth.py): add support for creating user tokens with user id

🔒 chore(auth.py): add support for updating last_login_at when creating user tokens

🔒 chore(auth.py): add support for updating user information

🔒 chore(login.py): add support for retrieving current active user in login route

🐛 fix(users.py): fix import order and remove unused imports to improve code readability
 feat(users.py): add support for pagination in read_all_users endpoint to retrieve a list of users with pagination
🔧 refactor(users.py): rename update_user function to patch_user for better semantics and consistency
🔧 refactor(users.py): refactor update_user function to use update_user function from models module for better code organization and reusability
 feat(users.py): add support for creating a superuser for testing purposes in add_super_user_for_testing_purposes_delete_me_before_merge_into_dev endpoint
2023-08-14 21:18:47 +01:00
Gabriel Luiz Freitas Almeida
e0f625e793 🐛 fix(utils.py): add condition to check if prompt has 'partial' attribute before calling it to prevent error 2023-08-14 17:17:57 -03:00
Gabriel Luiz Freitas Almeida
2144e1ec91 🐛 fix(types.py): handle case where prompt template is not present in PromptVertex
ℹ️ The code was modified to handle a case where the `template` attribute is not present in the `PromptVertex` class. If the `template` attribute is not found, the code checks if the `prompt` attribute is present and uses its `template` attribute instead. This change ensures that the code does not break when the `template` attribute is missing.
2023-08-14 17:16:54 -03:00
Gabriel Luiz Freitas Almeida
861b8d048e 🔧 chore(Makefile): update 'install_backend' target to include 'deploy' extras when installing dependencies with Poetry 2023-08-14 17:05:52 -03:00
Gabriel Luiz Freitas Almeida
a9bb04ee24 🐛 fix(base.py): add is_task parameter to Vertex constructor to indicate if the vertex is a task
 feat(base.py): add `get_result` method to `Vertex` to retrieve the result of a built vertex
🐛 fix(types.py): pass `is_task=True` to `super().__init__` in `CustomComponentVertex` constructor
 feat(worker.py): add `build_vertex` task to build a vertex asynchronously
2023-08-14 17:05:40 -03:00
Cristhian Zanforlin Lousa
d9d0513a91 🔨 refactor(UserManagementModal/index.tsx): add placeholder text to username input field for better user experience
🔨 refactor(loginPage/index.tsx): remove unnecessary link to attribute in the Sign Up button
2023-08-14 16:59:38 -03:00
Gabriel Luiz Freitas Almeida
9df5e94195
Prevent Default on Ctrl + Backspace in ReactFlow (#706) 2023-08-14 19:42:29 +00:00
Cristhian Zanforlin Lousa
754d26633a 🐛 fix(constants.ts): add backtick (`) and backtick (´) to specialCharsRegex to include them as special characters 2023-08-14 16:39:22 -03:00
Cristhian Zanforlin Lousa
4522cd383e 🐛 fix(reactflowUtils.ts): fix bug with control+backspace key combination on Windows/Linux and Mac 2023-08-14 16:28:52 -03:00
Cristhian Zanforlin Lousa
a531cc6066 🔧 chore(reactflowUtils.ts): remove console.log statement for keydown event in handleKeyDown function
🐛 fix(reactflowUtils.ts): fix handleKeyDown function to properly handle special characters and backspace key
2023-08-14 15:58:26 -03:00
Gabriel Luiz Freitas Almeida
00b8dd7af3 🔧 chore(manager.py): remove unused import statement for redis module
🔧 chore(manager.py): add try-except block to handle ImportError and provide clear error message when redis-py package is not installed
🔧 chore(manager.py): add import statement for redis module in the is_connected method to avoid NameError
2023-08-14 15:53:32 -03:00
anovazzi1
1f528072b9 format code 2023-08-14 12:53:08 -03:00
igorrCarvalho
e705f5bdf4 Refactor[UserManagementModal]: Refactor admin user sign to use password input component 2023-08-14 12:38:59 -03:00
igorrCarvalho
019e34190a Refactor: Remove Link in signup button 2023-08-14 12:27:50 -03:00
Gabriel Luiz Freitas Almeida
e8d3a5df6d 🔨 chore(base.py): add upsert method to BaseCacheManager to provide a common interface for inserting or updating cache items
 feat(manager.py): add upsert method to InMemoryCache and RedisCache to support inserting or updating cache items
🐛 fix(manager.py): fix client_id generation in handle_websocket method to avoid overwriting existing cache items
🔨 chore(manager.py): refactor handle_websocket method to use upsert method and improve readability
2023-08-14 12:25:14 -03:00
Gabriel Luiz Freitas Almeida
20afabd90a 🐛 fix(manager.py): change cache_manager.set to cache_manager.upsert to update or insert cache value
 feat(manager.py): add result_dict to cache instead of directly setting langchain_object to improve cache semantics
🐛 fix(manager.py): handle case when langchain_object is not found in cache and raise ValueError
2023-08-14 12:23:54 -03:00
Gabriel Luiz Freitas Almeida
5df7341eec 🐛 fix(chat.py): rename flow_data_store variable to cache_manager for better clarity and consistency
 feat(chat.py): update references to flow_data_store to cache_manager for improved semantics and readability
🐛 fix(chat.py): fix incorrect cache key in chat_manager.set_cache() method call
🐛 fix(chat.py): fix incorrect cache key in chat_manager.chat_history.empty_history() method call
2023-08-14 12:23:21 -03:00
igorrCarvalho
610e168dbc Refactor[routes.tsx]: Remove sign up page while user cant sign up to langflow 2023-08-14 12:18:48 -03:00
Gabriel Luiz Freitas Almeida
5e47d0ff14
adding ChatVertexAI LLM component back into the config.yaml (#724) 2023-08-14 15:10:26 +00:00
Gabriel Luiz Freitas Almeida
5089480bc0
Update pyproject.toml (#754) 2023-08-14 15:07:57 +00:00
anovazzi1
60575d9f78 removed dead code 2023-08-14 11:16:15 -03:00
Cristhian Zanforlin Lousa
9acf9e39aa 🔧 fix(constants.ts): add specialCharsRegex constant to match special characters in strings
🔧 fix(reactflowUtils.ts): update handleKeyDown function to prevent deletion of block when a special character is the last character in the input value
2023-08-14 11:15:26 -03:00
Gabriel Luiz Freitas Almeida
37773e0ca1 📝 chore(.env.example): add documentation for LANGFLOW_CACHE_TYPE environment variable and its possible values 2023-08-13 23:46:26 -03:00
Gabriel Luiz Freitas Almeida
4bf4768ca7 🔧 chore(base.Dockerfile): update poetry install command to exclude dev dependencies and include deploy dependencies for production deployment 2023-08-13 23:45:59 -03:00
Gabriel Luiz Freitas Almeida
5f0c014dcb 📦 chore(pyproject.toml): update dependencies and extras
🔒 chore(pyproject.toml): update celery, redis, and flower versions and make them optional dependencies

🔀 chore(pyproject.toml): add celery, redis, and flower to the deploy extra dependencies
2023-08-13 23:45:34 -03:00
Gabriel Luiz Freitas Almeida
0ed1165e53 🐳 chore(docker-compose.celery.yml): add dependencies and environment variables for redis cache and queue
🔧 fix(docker-compose.celery.yml): update uvicorn command to include debug log level

🔧 fix(docker-compose.celery.yml): update flower command to include redis broker URL

🔧 fix(docker-compose.celery.yml): add dependencies and environment variables for redis cache and queue in frontend service
2023-08-13 23:43:14 -03:00
Gabriel Luiz Freitas Almeida
561e048278 🐛 fix(manager.py): fix import statements and variable names for better organization and readability
 feat(manager.py): add support for chat cache and attach it to the chat manager for better chat history management
🔧 chore(manager.py): change client_id format in set_cache method to avoid conflicts with existing cache keys
2023-08-13 23:41:08 -03:00
Gabriel Luiz Freitas Almeida
64292aa997 feat(cache.py): add cache manager class to manage cache for different clients and notify observers on changes 2023-08-13 23:40:42 -03:00
Gabriel Luiz Freitas Almeida
f8f99c6881 🐛 fix(utils.py): rename cache_type variable to langchain_cache_type for clarity
🐛 fix(manager.py): add test connections to cache and database managers for initialization
2023-08-13 23:40:12 -03:00
Gabriel Luiz Freitas Almeida
0833b00fdc 🔧 chore(celery_app.py): refactor celery_app to use a separate function make_celery for improved modularity and readability
🔧 chore(celeryconfig.py): update broker_url and result_backend to use LANGFLOW_REDIS_HOST and LANGFLOW_REDIS_PORT environment variables if available, fallback to default values if not
2023-08-13 23:39:01 -03:00
Gabriel Luiz Freitas Almeida
1a51e90c43 🐛 fix(chat.py): remove unused import and variable 'flow_data_store' to improve code readability
 feat(chat.py): add support for cache_manager to handle chat history and cache langchain_object
🆕 feat(chat/manager.py): add ChatManager class to handle websocket connections and chat history
🆕 feat(chat/manager.py): add ChatHistory class to manage chat history for each client
🆕 feat(chat/manager.py): add methods to handle websocket connections, send messages, and process chat messages
🆕 feat(chat/manager.py): add method to set cache for a client and handle websocket communication
2023-08-13 23:38:31 -03:00
Gabriel Luiz Freitas Almeida
f65efbc43b 🔀 refactor(base.py): move cache settings to a separate section for better organization and readability
🔀 refactor(base.py): rename CACHE_TYPE variable to REDIS_CACHE_TYPE to improve clarity
🔀 refactor(base.py): rename REDIS_HOST, REDIS_PORT, REDIS_DB, and REDIS_CACHE_EXPIRE variables to improve clarity
🔀 refactor(base.py): remove unused import statements
🔀 refactor(settings.py): remove unused import statements
🔀 refactor(settings.py): remove unused code and comments
🔀 refactor(settings.py): remove unused function `save_settings_to_yaml`
🔀 refactor(settings.py): remove unused function `update_settings`
🔀 refactor(settings.py): remove unused function `update_from_yaml`
🔀 refactor(settings.py): remove unused constant `BASE_COMPONENTS_PATH`
🔀 refactor(settings.py): remove unused class attributes
🔀 refactor(settings.py): remove unused class methods
🔀 refactor(settings.py): remove unused class `Settings`
2023-08-13 23:37:56 -03:00
Gabriel Luiz Freitas Almeida
34ac959f5a 🔄 refactor(cache): reorganize imports and remove unused imports and variables in cache module
🔄 refactor(cache): rename BaseCache class to BaseCacheManager for better clarity and consistency
🔄 refactor(cache): remove cache_manager from __all__ in cache module
🔄 refactor(cache): remove unused import of Service in BaseCacheManager class
🔄 refactor(cache): rename cache_manager to BaseCacheManager in factory module
🔄 refactor(cache): remove unused import of InMemoryCache in factory module
🔄 refactor(cache): remove flow module and its related code as it is no longer used

🔧 fix(manager.py): fix import statements and class inheritance in cache manager module
 feat(manager.py): add InMemoryCache class to implement a simple in-memory cache using an OrderedDict
 feat(manager.py): add RedisCache class to implement a Redis-based cache using the redis-py library
2023-08-13 23:37:22 -03:00
Rodrigo Nader
823b140181 feat: Add documentation for various tools
- Added documentation for BingSearchRun, Calculator, GoogleSearchResults, GoogleSearchRun, GoogleSerperRun, and InfoSQLDatabaseTool components.
2023-08-13 20:14:02 -03:00
Gabriel Luiz Freitas Almeida
017b24f744 Merge remote-tracking branch 'origin/dev' into celery 2023-08-13 19:29:56 -03:00
Gabriel Luiz Freitas Almeida
5954e6daa0 🔧 fix(endpoints.py): remove unused import 'process_graph_cached' and replace it with 'process_graph_cached_worker' for processing graph data asynchronously
🔧 fix(endpoints.py): add error handling for processing tweaks and log the error message
 feat(endpoints.py): use 'process_graph_cached_worker' to process graph data asynchronously and return the result in 'ProcessResponse'
2023-08-13 19:26:48 -03:00
Gabriel Luiz Freitas Almeida
304e824ef7 feat(worker.py): add worker module to handle background tasks in LangFlow backend
🔧 chore(worker.py): refactor process_graph_cached function to improve readability and maintainability
2023-08-13 19:25:59 -03:00
Gabriel Luiz Freitas Almeida
43ba81c2ee 📦 chore(core): add Celery configuration files
 feat(celery_app.py): add Celery app configuration for langflow with Redis as broker and backend
 feat(celeryconfig.py): add Celery configuration file with environment variable support for broker URL and result backend URL
2023-08-13 19:25:28 -03:00
Gabriel Luiz Freitas Almeida
d1a9ed45d7 📦 chore(pyproject.toml): update orjson version from 3.9.1 to 3.9.3 for bug fixes and improvements
📦 chore(pyproject.toml): add celery version 5.3.1, redis version 4.6.0, and flower version 2.0.1 to dev dependencies for task queue and monitoring
2023-08-13 17:54:53 -03:00
Gabriel Luiz Freitas Almeida
62ccab2cb9 📦 chore(docker-compose.celery.yml): add docker-compose file for running Celery worker and Flower 2023-08-13 17:49:08 -03:00
Gabriel Luiz Freitas Almeida
a1df839dc1 🐛 fix(dev.Dockerfile): update uvicorn command to use --factory flag and create_app function to improve modularity and maintainability 2023-08-13 17:48:05 -03:00
Gabriel Luiz Freitas Almeida
0c689dcc16
Fixed bug on Export Modal (#751) 2023-08-13 20:47:44 +00:00