feat: Clean up the modelinput unification#12025
feat: Clean up the modelinput unification#12025erichare wants to merge 4 commits intorelease-1.8.0from
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-1.8.0 #12025 +/- ##
================================================
Coverage ? 36.99%
================================================
Files ? 1588
Lines ? 78081
Branches ? 11838
================================================
Hits ? 28885
Misses ? 47574
Partials ? 1622
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This pull request introduces significant improvements to model input handling and embedding model instantiation, along with some refactoring and cleanup of provider-specific field visibility logic. The most important changes are the addition of a unified function for updating build configurations based on model input, a new embedding model factory, and stricter requirements for certain provider fields.
Model input handling improvements:
handle_model_input_updatetounified_models.py, which centralizes and streamlines the process of updating build configurations for components with model inputs. This function replaces previous ad-hoc logic for showing/hiding provider-specific fields and refreshing options, making the codebase more maintainable and extensible. [1] [2] [3]Embedding model instantiation:
get_embeddingsfunction inunified_models.py, providing a standardized way to instantiate embedding models with provider-specific parameters, credential resolution, and available models support. This complements the existingget_llmfor language models. [1] [2] [3]Provider field requirements:
project_idandurlfields, ensuring these values must be provided rather than relying solely on environment variable fallbacks. [1] [2]Refactoring and cleanup:
update_provider_fields_visibilityand related helpers) fromagentics.helpers.model_config.pyand updated all components to use the new unifiedhandle_model_input_updateinstead. This reduces duplication and potential for errors. [1] [2] [3] [4] [5] [6] [7] [8]Component updates:
base_component.py,csv_agent.py, andopenai_tools.pyto usehandle_model_input_updatefor build config updates, ensuring consistent provider field handling and option refreshes across all components. [1] [2] [3]Let me know if you'd like a deeper walkthrough of the new unified model input update flow or the embedding model factory!