Commit graph

4,121 commits

Author SHA1 Message Date
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
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
9fcadcb0a5 📦 chore(base.Dockerfile): add base Dockerfile for Python project setup
🚧 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
2023-08-13 17:46:02 -03:00
Gabriel Luiz Freitas Almeida
f8d4bb70ac 📦 chore(frontend): add .dockerignore file to exclude node_modules and build directories from Docker image 2023-08-13 17:45:31 -03:00
Gabriel Luiz Freitas Almeida
3d8d44538f Merge branch 'release' into dev 2023-08-10 10:10:28 -03:00
Gabriel Luiz Freitas Almeida
fe5a35aa37 Merge remote-tracking branch 'origin/main' into release 2023-08-10 09:55:42 -03:00
Gabriel Luiz Freitas Almeida
2751b92b6b 🔖 chore(pyproject.toml): bump version from 0.4.6 to 0.4.7 for langflow package 2023-08-10 09:54:47 -03:00
Gabriel Luiz Freitas Almeida
45d1b34197
Improves CustomComponents Errors (#748) 2023-08-10 09:44:44 -03:00
Gabriel Luiz Freitas Almeida
df77ba81f7 🐛 fix(custom_component.py): fix condition to check if Optional type hint is used but not imported in the code 2023-08-10 09:24:10 -03:00
Gabriel Luiz Freitas Almeida
564634d36c 🐛 fix(directory_reader.py): handle SyntaxError when parsing code to prevent crashes
🐛 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
2023-08-10 09:23:36 -03:00
Gabriel Luiz Freitas Almeida
261e258ed4 🐛 fix(loading.py): make a copy of the params before modifying it to prevent unintended side effects 2023-08-10 09:23:02 -03:00
Gabriel Luiz Freitas Almeida
7b22fd2711
add waitlist button on header (#742) 2023-08-10 07:59:03 -03:00
Gabriel Luiz Freitas Almeida
79858561a6
Adds Join The Waitlist button, Vectara, Metaphor in Beta and other fixes (#744) 2023-08-09 17:51:47 -03:00
Gabriel Luiz Freitas Almeida
8c41415a32 🐛 fix(custom_component.py): handle case when return_type is None to prevent errors
🐛 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
2023-08-09 17:50:03 -03:00
Gabriel Luiz Freitas Almeida
30aad35cc6
Merge branch 'main' into release 2023-08-09 17:41:23 -03:00
Gabriel Luiz Freitas Almeida
8a599a85fe
Adds Vectara VectorStore and Metaphor Toolkit (#743) 2023-08-09 17:40:26 -03:00
Gabriel Luiz Freitas Almeida
e1407d0595 🔧 chore(Metaphor.py): refactor build method to accept additional parameters for improved configurability
🔧 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
2023-08-09 17:12:22 -03:00
Gabriel Luiz Freitas Almeida
89c3306512 🔒 chore(poetry.lock): update aiofiles version from 23.2.0 to 23.2.1 to fix a bug related to file support for asyncio
🔒 chore(poetry.lock): update dnspython version from 2.4.1 to 2.4.2 to fix a bug related to DNS toolkit
2023-08-09 15:53:45 -03:00
Gabriel Luiz Freitas Almeida
29766ecaf0 🐛 fix(Metaphor.py): ignore type error for importing Metaphor from metaphor_python
🐛 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
2023-08-09 15:53:18 -03:00
Gabriel Luiz Freitas Almeida
9bbdd9465b 🔨 refactor(Vectara.py): reorganize function parameters for better readability and maintainability
🔧 chore(Vectara.py): add "embedding" parameter to the build function to support custom embeddings in VectaraComponent
2023-08-09 15:47:22 -03:00
Gabriel Luiz Freitas Almeida
e5e23a1da6 🐛 fix(component.py): add support for "documentation" field in template_config to properly handle component documentation
🐛 fix(types.py): update_attributes function now updates frontend_node with "documentation" field from template_config
2023-08-09 15:32:41 -03:00
Gabriel Luiz Freitas Almeida
38b6831b57 feat(Metaphor.py): add MetaphorToolkit component to langflow toolkit
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)
2023-08-09 15:29:11 -03:00
Gabriel Luiz Freitas Almeida
d16d916952 🐛 fix(custom_component.py): improve parsing of return type in CustomComponent class
 feat(custom_component.py): add support for parsing return type when it is a Union of types in CustomComponent class
2023-08-09 15:28:39 -03:00
Gabriel Luiz Freitas Almeida
639550d537 🔧 chore(pyproject.toml): add metaphor-python dependency to improve code analysis and documentation generation
⬆️ feat(pyproject.toml): upgrade black dependency to version 23.1.0 for code formatting
2023-08-09 15:26:51 -03:00
Gabriel Luiz Freitas Almeida
b3e512f55f feat(PromptRunner.py): add PromptRunner component to run a Chain with a given PromptTemplate
 feat(Vectara.py): add VectaraComponent to implement Vector Store using Vectara
🔧 chore(vectorstores): add empty __init__.py file to the vectorstores directory
2023-08-09 14:37:20 -03:00
Gabriel Luiz Freitas Almeida
72f88e1a16 🐛 fix(custom_component.py): handle return_type as a Union[type1, type2] and add support for multiple return types in add_base_classes function
🐛 fix(types.py): handle multiple return types in add_base_classes function and raise HTTPException with appropriate error message if return type is invalid
2023-08-09 14:36:45 -03:00
Gabriel Luiz Freitas Almeida
c9e489a195 🔖 chore(pyproject.toml): bump version from 0.4.5 to 0.4.6 for langflow package 2023-08-09 13:50:14 -03:00
anovazzi1
5e370f3e34
Refactoring: Rename Generic Variable Names to More Descriptive Ones (#725)
This PR is a code refactoring initiative aiming to improve the
readability and maintainability of our codebase. It specifically targets
generic or non-descriptive variable names, renaming them to more
meaningful names that better express their purpose within the code.
2023-08-09 11:21:34 -03:00
anovazzi1
21fb5aad6c style(headerComponent): capitalize the first letter of "The" in "Join The Waitlist" for consistency and readability 2023-08-09 10:59:50 -03:00
anovazzi1
181beb810e style(headerComponent): capitalize the first letter of "join the waitlist" to improve consistency and readability 2023-08-09 10:44:25 -03:00
anovazzi1
24cc59674b chore(headerComponent): remove commented out code for waitlist link
The commented out code for the waitlist link in the header component has been removed. This code was not being used and was cluttering the codebase.
2023-08-09 10:28:50 -03:00
Gabriel Luiz Freitas Almeida
be14d45589 🐛 fix(utils.py): handle CommandError when running migrations and delete alembic_version table if wrong revision in DB 2023-08-09 10:28:41 -03:00
Gabriel Luiz Freitas Almeida
3b04048e75 🔥 refactor(custom-component.mdx): remove width property from style to improve responsiveness and avoid fixed width 2023-08-09 09:49:25 -03:00
Gabriel Luiz Freitas Almeida
61bee4424f
Add zip_path and workspace_url fields (#729) 2023-08-09 09:18:30 -03:00
Gabriel Luiz Freitas Almeida
d3cb71d357
fix(vector_store.py): change the way pinecone_api_key and pinecone_env are extracted so they don't get passed to the classmethod (#740) 2023-08-09 09:10:09 -03:00
Gabriel Luiz Freitas Almeida
f7afbd89b0 🔧 chore(vector_store.py): change the way pinecone_api_key and pinecone_env are retrieved from params dictionary to improve code readability and remove unnecessary code duplication 2023-08-09 08:48:53 -03:00
Melvin Hillsman
f4ad8572e7 Add zip_path and workspace_url fields
As noted in the
[documentation](https://python.langchain.com/docs/integrations/document_loaders/slack)
for this plugin zip_path is the first named parameter not file_path and
workspace_url is the second with zip_path being required and
workspace_url being optional.

Fixes #695

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
2023-08-08 21:01:34 -05:00
anovazzi1
a99a7fe189 fix(headerComponent): fix conditional rendering of waitlist link in header component
chore(headerComponent): comment out unused waitlist link in header component
chore(applies.css): update styling of waitlist link in header component to match design requirements
2023-08-08 22:06:14 -03:00