-
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
feat: Add Multi-Model Provider Support to Agent Component #4416
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Integrated model provider constants from `model_input_constants.py` into the Agent component to support multiple LLM providers - Added dynamic field management for different model providers (OpenAI, Azure, Groq, Anthropic, NVIDIA) - Implemented a dropdown for model provider selection with automatic input field updates
making custom separate from sort
dosubot
bot
added
size:L
This PR changes 100-499 lines, ignoring generated files.
enhancement
New feature or request
python
Pull requests that update Python code
labels
Nov 5, 2024
edwinjosechittilappilly
requested review from
ogabrielluiz,
NadirJ,
carlosrcoelho and
italojohnny
November 5, 2024 21:00
github-actions
bot
added
enhancement
New feature or request
and removed
enhancement
New feature or request
labels
Nov 5, 2024
italojohnny
approved these changes
Nov 6, 2024
CodSpeed Performance ReportMerging #4416 will improve performances by 17.29%Comparing Summary
Benchmarks breakdown
|
joaoguilhermeS
pushed a commit
that referenced
this pull request
Nov 7, 2024
* Add Multi-Model Provider Support to Agent Component - Integrated model provider constants from `model_input_constants.py` into the Agent component to support multiple LLM providers - Added dynamic field management for different model providers (OpenAI, Azure, Groq, Anthropic, NVIDIA) - Implemented a dropdown for model provider selection with automatic input field updates * sorted list * Update agent.py making custom separate from sort * chore: remove unit test --------- Co-authored-by: italojohnny <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
lgtm
This PR has been approved by a maintainer
python
Pull requests that update Python code
size:L
This PR changes 100-499 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes Made
model_input_constants.py
into the Agent component to support multiple LLM providersTechnical Details
Model Provider Integration:
MODEL_PROVIDERS_DICT
frommodel_input_constants.py
to manage provider-specific configurationsDynamic Field Management:
Provider-Specific Model Building:
get_llm()
and_build_llm_model()
methods to construct the appropriate LLM instanceThis update makes the Agent component more flexible by supporting multiple LLM providers while maintaining a clean and intuitive interface.
This pull request refactors the model components and their associated constants, improving the organization and maintainability of the code. The changes include the removal of the
ModelConstants
class, the introduction of a new module for model input constants, and updates to the agent component to utilize the new constants.Refactoring of model components and constants:
ModelConstants
class and its initialization logic frommodel_constants.py
.model_input_constants.py
to define model input constants and utility functions for filtering and creating input fields.get_model_info
function frommodel_utils.py
as its functionality is now covered by the new constants module.Updates to agent components:
agent.py
to use the newMODEL_PROVIDERS_DICT
andALL_PROVIDER_FIELDS
frommodel_input_constants.py
for managing model provider inputs and fields.AgentComponent
class to dynamically handle model provider inputs using the new constants, enhancing flexibility and reducing redundancy [1] [2].