📝 docs(walkthroughtutorial.md): add tutorial for deploying Langflow on Google Cloud Platform
The `deploy_langflow_gcp.sh` script is added to the `scripts/gcp` directory. This script sets up the necessary VM, image, and networking configuration for deploying Langflow on Google Cloud Platform. It also creates firewall rules, installs dependencies, and starts the Langflow server.
The `walkthroughtutorial.md` file is added to the `scripts/gcp` directory. This file provides a step-by-step tutorial on how to deploy Langflow on Google Cloud Platform using the `deploy_langflow_gcp.sh` script. It includes instructions on setting up the GCP environment, running the script, and connecting to the Langflow VM.
Cleanup instructions are also provided in the tutorial for removing the resources created during the deployment process.
📝 docs(walkthroughtutorial_spot.md): add walkthrough tutorial for deploying Langflow on Google Cloud Platform
This commit adds a new file `walkthroughtutorial_spot.md` which contains a step-by-step tutorial for deploying Langflow on Google Cloud Platform (GCP) using Google Cloud Shell. The tutorial provides an introduction, prerequisites, instructions for setting up the GCP environment, deploying Langflow, connecting to the Langflow VM, and cleaning up resources after the deployment.
The tutorial is authored by Robert Wilkins III and has a duration of 45 minutes. It assumes that the user has a GCP account and basic knowledge of Google Cloud Shell. The tutorial also includes links to relevant documentation and provides commands for configuring the GCP environment and deploying Langflow.
The tutorial is comprehensive and aims to guide users through the process of deploying Langflow on GCP. It also includes cleanup instructions for removing the resources created during the tutorial if desired.
✨ 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
🔧 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
✨ 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
✨ 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
🔒 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
🔧 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
✨ 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
🔧 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
✨ 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
🔄 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
🔧 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'
✨ 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
🚧 feat(base.Dockerfile): create python-base stage with shared environment variables
🚧 feat(base.Dockerfile): create builder-base stage for building dependencies and creating virtual environment
🚧 feat(base.Dockerfile): create development stage for development and testing
🐛 fix(directory_reader.py): return False if code is not valid Python to prevent false positives
🐛 fix(directory_reader.py): fix method name from is_type_hint_used_but_not_imported to _is_type_hint_used_in_args for consistency
🐛 fix(directory_reader.py): fix method name from is_type_hint_imported to _is_type_hint_imported for consistency
🐛 fix(directory_reader.py): fix return value of _is_type_hint_used_in_args method to return False if type hint is used but not imported
🐛 fix(test_custom_component.py): update assertion to expect return_type as a list instead of a string
🐛 fix(test_vectorstore_template.py): update assertion to check if all vectorstores in settings are present in the response
🔧 chore(Metaphor.py): update search method to use the provided parameters for use_autoprompt and search_num_results
🔧 chore(Metaphor.py): update find_similar method to use the provided parameter for similar_num_results
🐛 fix(Metaphor.py): ignore type error for returning a list with mixed types
🐛 fix(Vectara.py): add condition to check if documents and embedding are not None before creating Vectara instance
🐛 fix(CustomComponent.py): change return type of get_function_entrypoint_return_type to List[str] to match the actual return value
The MetaphorToolkit component is added to the langflow toolkit. It provides functionality for searching metaphors using the Metaphor API. The component includes three tools: search, get_contents, and find_similar. The search tool allows users to search for metaphors using a query. The get_contents tool retrieves the contents of a webpage based on the ids returned from the search tool. The find_similar tool finds search results similar to a given URL returned from the search tool.
The MetaphorToolkit component is still in beta and requires a Metaphor API key to function. The API key is stored securely and can be configured in the field_config of the component. For more information, refer to the documentation: [Metaphor Toolkit Documentation](https://python.langchain.com/docs/integrations/tools/metaphor_search)