mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
fix(converse_transformation.py): fix encoding model
This commit is contained in:
parent
814d8ba54c
commit
8e7363acf5
4 changed files with 441 additions and 324 deletions
|
@ -279,16 +279,30 @@ class BaseAWSLLM:
|
|||
return None
|
||||
|
||||
def _get_aws_region_name(
|
||||
self, optional_params: dict, model: Optional[str] = None
|
||||
self,
|
||||
optional_params: dict,
|
||||
model: Optional[str] = None,
|
||||
model_id: Optional[str] = None,
|
||||
) -> str:
|
||||
"""
|
||||
Get the AWS region name from the environment variables
|
||||
Get the AWS region name from the environment variables.
|
||||
|
||||
Parameters:
|
||||
optional_params (dict): Optional parameters for the model call
|
||||
model (str): The model name
|
||||
model_id (str): The model ID. This is the ARN of the model, if passed in as a separate param.
|
||||
|
||||
Returns:
|
||||
str: The AWS region name
|
||||
"""
|
||||
aws_region_name = optional_params.get("aws_region_name", None)
|
||||
### SET REGION NAME ###
|
||||
if aws_region_name is None:
|
||||
# check model arn #
|
||||
aws_region_name = self._get_aws_region_from_model_arn(model)
|
||||
if model_id is not None:
|
||||
aws_region_name = self._get_aws_region_from_model_arn(model_id)
|
||||
else:
|
||||
aws_region_name = self._get_aws_region_from_model_arn(model)
|
||||
# check env #
|
||||
litellm_aws_region_name = get_secret("AWS_REGION_NAME", None)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue