fix: bedrock region was always set to "us-east-1" not respecting the env var. (#4582)

* fix: bedrock region was always set to "us-east-1" not respecting the env
var.

code had AWS_REGION_NAME referenced, but not used, unified to
AWS_DEFAULT_REGION as per documentation

* DRY code improvement and fix caught by tests.

* Supporting litellm configuration
This commit is contained in:
Mike Plachta
2026-02-24 09:59:01 -08:00
committed by GitHub
parent 51754899a2
commit 7377e1aa26
7 changed files with 48 additions and 23 deletions

View File

@@ -81,7 +81,7 @@ def test_create_llm_from_env_with_unaccepted_attributes() -> None:
"OPENAI_API_KEY": "fake-key",
"AWS_ACCESS_KEY_ID": "fake-access-key",
"AWS_SECRET_ACCESS_KEY": "fake-secret-key",
"AWS_REGION_NAME": "us-west-2",
"AWS_DEFAULT_REGION": "us-west-2",
},
):
llm = create_llm(llm_value=None)
@@ -89,7 +89,7 @@ def test_create_llm_from_env_with_unaccepted_attributes() -> None:
assert llm.model == "gpt-3.5-turbo"
assert not hasattr(llm, "AWS_ACCESS_KEY_ID")
assert not hasattr(llm, "AWS_SECRET_ACCESS_KEY")
assert not hasattr(llm, "AWS_REGION_NAME")
assert not hasattr(llm, "AWS_DEFAULT_REGION")
def test_create_llm_with_partial_attributes() -> None: