-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: Enhance component testing and error handling with dynamic retrieval #4526
Conversation
CodSpeed Performance ReportMerging #4526 will degrade performances by 15.11%Comparing Summary
Benchmarks breakdown
|
…or dynamic component retrieval
…andling - Introduced `VersionComponentMapping` TypedDict for structured version mapping. - Updated `FILE_NAMES_MAPPING` to use a list of `VersionComponentMapping`. - Added comprehensive error messages for missing or invalid mappings in `test_all_versions_have_a_file_name_defined`. - Improved `test_component_versions` with detailed exception handling and error reporting. - Ensured `component_class` is defined before running tests.
…structure and readability in test_prompt_component.py
…ved version handling
… improved modularity and readability
Implement comprehensive tests for both ChatInput and TextInputComponent to ensure proper functionality, including message responses and handling of various input scenarios. This enhances reliability and aids in future development.
Implement comprehensive tests for ChatOutput and TextOutputComponent, validating message responses, source properties, and behavior with various input types to ensure reliability and consistency across output components.
…elds - Added missing `info` fields to various input components to provide better context and descriptions. - Improved code readability by ensuring consistent formatting and structure across JSON files. - Updated `message_response` method to handle cases where `graph` attribute might not be present. - Enhanced `build_vectorize_options` method to set `authentication` and `parameters` to `None` if no values are provided. - Refined `AgentComponent` to include `info` for `agent_llm` and other fields, improving clarity on their purpose.
98796fe
to
885b7ba
Compare
…mponent attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this
This pull request includes several changes aimed at improving the robustness and functionality of the codebase by adding checks for the existence of attributes before accessing them, and introducing a new
PlaceholderGraph
class.The fixes in the PR are needed for the tests to pass. The most important changes are listed below:
Attribute Existence Checks
graph
attribute before accessing its properties, improving error handling and robustness. (src/backend/base/langflow/base/io/chat.py
,src/backend/base/langflow/base/tools/flow_tool.py
,src/backend/base/langflow/components/deactivated/message.py
,src/backend/base/langflow/components/deactivated/store_message.py
,src/backend/base/langflow/components/outputs/chat.py
) [1] [2] [3] [4] [5]New PlaceholderGraph Class
PlaceholderGraph
class to provide default values forgraph
attributes, preventing potential attribute errors. (src/backend/base/langflow/custom/custom_component/component.py
) [1] [2]JSON Configuration Updates
Agent Flow.json
configuration file to include additional information and ensure consistency with the new attribute checks. (src/backend/base/langflow/initial_setup/starter_projects/Agent Flow.json
) [1] [2]