refactor: enhance CustomComponent class and updates tests (#3201)

* fix: update CustomComponent to use properties for user_id and flow_id

Refactored user_id and flow_id in CustomComponent to use properties for better encapsulation and code clarity

* refactor: update CustomComponent initialization and remove unused imports

Refactored the CustomComponent class to streamline initialization and removed unnecessary import for BaseCallbackHandler

* refactor: update build_custom_component_template to use cc_instance for field order to improve consistency and clarity

* refactor: update user_id parameter in FlowToolComponent to use self.user_id for consistency

* refactor: remove unused _tree attribute and clean up imports in CustomComponent for better code clarity

* refactor: rename CustomComponent to Component for consistency in directory_reader.py import and usage

* refactor: enhance timestamp handling in _timestamp_to_str for better validation and error reporting in message.py

* refactor: preserve async get_file_content_dicts method for backwards compatibility in message.py

* refactor: update function_entrypoint_name to _function_entrypoint_name for consistency in test_custom_component.py

* feat: add client fixture for improved test structure in test_data_components.py

* feat: add unit tests for PromptComponent including template processing and custom fields in test_prompt_component.py

* feat: add dev dependencies for improved testing and development tools in pyproject.toml
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-08-05 16:55:29 -03:00 • committed by GitHub
commit f706b05438
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 1823 additions and 89 deletions

View file

@ -12,6 +12,11 @@ from httpx import Response
from langflow.components import data
@pytest.fixture
def client():
pass
@pytest.fixture
def api_request():
# This fixture provides an instance of APIRequest for each test case