refactor: improve maintainability and testability of Vertex.build_params (#5808)
* refactor: Simplify parameter building in Vertex class using ParameterHandler * feat: Add unit tests for ParameterHandler class and organize test structure * refactor: rename openai.py to openai_chat_model.py to avoid overlapping names - Introduced a new OpenAIModelComponent class to facilitate text generation using OpenAI's language models. - Implemented various input fields including max_tokens, model_kwargs, json_mode, model_name, openai_api_base, api_key, temperature, and seed for enhanced configurability. - Added methods for building the model and handling exceptions from OpenAI API calls. - This component enhances the existing framework by integrating OpenAI's capabilities, allowing users to generate text with customizable parameters. * refactor: update OpenAIModelComponent import paths to use openai_chat_model - Changed import statements in model_input_constants.py, __init__.py, and test_tool_calling_agent.py to reflect the new OpenAIModelComponent location. - This refactor improves code organization and clarity by ensuring consistent usage of the updated component structure. * fix(param_handler): add error handling for invalid field types - Introduced a ValueError exception for invalid field types in the ParameterHandler class. - This change enhances robustness by ensuring that only valid field types are processed, improving error reporting for developers. * feat: Support list-based file path handling in ParameterHandler * test: Add comprehensive tests for ParameterHandler field processing * feat: Enhance field skipping logic in ParameterHandler Add support for skipping fields with type "other" in the parameter handling process * refactor: Simplify storage service initialization and edge parameter processing * refactor: Modernize parameter handling with pattern matching Improve type handling and conversion in ParameterHandler by: - Replacing conditional logic with pattern matching - Simplifying type conversion for various field types - Reducing nested conditionals - Enhancing code readability and maintainability * refactor: Update type hints for CycleEdge in parameter handling --------- Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
This commit is contained in:
parent
3480fb160f
commit
d77686d9d2
11 changed files with 534 additions and 143 deletions
|
|
@ -0,0 +1 @@
|
|||
"""Tests package for langflow."""
|
||||
Loading…
Add table
Add a link
Reference in a new issue