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.
Deployment refactor changed AVAILABLE_MODEL_DEPLOYMENTS to a list where it was previously a dictionary. Reverted it back to a dictionary.
AI Description
This pull request makes changes to the
get_available_deployments
function insrc/backend/config/deployments.py
, thedeployment_prompt
function insrc/backend/scripts/cli/prompts.py
, and theget_default_deployment
,get_deployment_by_name
,get_deployment_definition
, andget_deployment_definitions
functions insrc/backend/services/deployment.py
. It also updates thevalidate_deployment_model
function insrc/backend/services/request_validators.py
.The following changes are made:
get_available_deployments
function now returns a dictionary instead of a list, with the key being the deployment name and the value being the deployment object. This change is made to better handle the community deployments, which are now added to theinstalled_deployments
dictionary using theupdate
method instead of theextend
method.deployment_prompt
function now iterates over theenv_vars
method of theconfigs
object instead of directly accessing theenv_vars
attribute.get_default_deployment
,get_deployment_by_name
,get_deployment_definition
, andget_deployment_definitions
functions now iterate over the values of theAVAILABLE_MODEL_DEPLOYMENTS
dictionary instead of directly accessing the dictionary.validate_deployment_model
function now iterates over the values of theAVAILABLE_MODEL_DEPLOYMENTS
dictionary instead of directly accessing the dictionary.mock_available_model_deployments
function insrc/backend/tests/integration/conftest.py
andsrc/backend/tests/unit/conftest.py
now patches theAVAILABLE_MODEL_DEPLOYMENTS
variable with theMOCKED_DEPLOYMENTS
object instead of a list of its values.test_get_default_deployment_none_available
function insrc/backend/tests/unit/services/test_deployment.py
now patches theAVAILABLE_MODEL_DEPLOYMENTS
variable with an empty dictionary instead of an empty list.test_get_deployment_definitions_with_db_deployments
function insrc/backend/tests/unit/services/test_deployment.py
now patches theAVAILABLE_MODEL_DEPLOYMENTS
variable with a dictionary of deployment names and objects instead of a list of deployment objects.