mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
Merge branch 'main' into elasticsearch-integration
This commit is contained in:
commit
7d026f29a3
14 changed files with 19 additions and 19 deletions
|
|
@ -40,8 +40,8 @@ def test_api_key_from_header_overrides_config():
|
|||
"""Test API key from request header overrides config via client property"""
|
||||
config = BedrockConfig(api_key="config-key", region_name="us-east-1")
|
||||
adapter = BedrockInferenceAdapter(config=config)
|
||||
adapter.provider_data_api_key_field = "aws_bedrock_api_key"
|
||||
adapter.get_request_provider_data = MagicMock(return_value=SimpleNamespace(aws_bedrock_api_key="header-key"))
|
||||
adapter.provider_data_api_key_field = "aws_bearer_token_bedrock"
|
||||
adapter.get_request_provider_data = MagicMock(return_value=SimpleNamespace(aws_bearer_token_bedrock="header-key"))
|
||||
|
||||
# The client property is where header override happens (in OpenAIMixin)
|
||||
assert adapter.client.api_key == "header-key"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from llama_stack.providers.remote.inference.bedrock.config import BedrockConfig
|
|||
|
||||
def test_bedrock_config_defaults_no_env(monkeypatch):
|
||||
"""Test BedrockConfig defaults when env vars are not set"""
|
||||
monkeypatch.delenv("AWS_BEDROCK_API_KEY", raising=False)
|
||||
monkeypatch.delenv("AWS_BEARER_TOKEN_BEDROCK", raising=False)
|
||||
monkeypatch.delenv("AWS_DEFAULT_REGION", raising=False)
|
||||
config = BedrockConfig()
|
||||
assert config.auth_credential is None
|
||||
|
|
@ -35,5 +35,5 @@ def test_bedrock_config_sample():
|
|||
sample = BedrockConfig.sample_run_config()
|
||||
assert "api_key" in sample
|
||||
assert "region_name" in sample
|
||||
assert sample["api_key"] == "${env.AWS_BEDROCK_API_KEY:=}"
|
||||
assert sample["api_key"] == "${env.AWS_BEARER_TOKEN_BEDROCK:=}"
|
||||
assert sample["region_name"] == "${env.AWS_DEFAULT_REGION:=us-east-2}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue