File tree Expand file tree Collapse file tree 10 files changed +11
-11
lines changed
docs/docs/providers/inference
providers/remote/inference/bedrock
tests/unit/providers/inference Expand file tree Collapse file tree 10 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,6 @@ AWS Bedrock inference provider using OpenAI compatible endpoint.
2222## Sample Configuration
2323
2424``` yaml
25- api_key : ${env.AWS_BEDROCK_API_KEY :=}
25+ api_key : ${env.AWS_BEARER_TOKEN_BEDROCK :=}
2626region_name : ${env.AWS_DEFAULT_REGION:=us-east-2}
2727` ` `
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ providers:
4747 - provider_id : bedrock
4848 provider_type : remote::bedrock
4949 config :
50- api_key : ${env.AWS_BEDROCK_API_KEY :=}
50+ api_key : ${env.AWS_BEARER_TOKEN_BEDROCK :=}
5151 region_name : ${env.AWS_DEFAULT_REGION:=us-east-2}
5252 - provider_id : ${env.NVIDIA_API_KEY:+nvidia}
5353 provider_type : remote::nvidia
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ providers:
4747 - provider_id : bedrock
4848 provider_type : remote::bedrock
4949 config :
50- api_key : ${env.AWS_BEDROCK_API_KEY :=}
50+ api_key : ${env.AWS_BEARER_TOKEN_BEDROCK :=}
5151 region_name : ${env.AWS_DEFAULT_REGION:=us-east-2}
5252 - provider_id : ${env.NVIDIA_API_KEY:+nvidia}
5353 provider_type : remote::nvidia
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ providers:
4747 - provider_id : bedrock
4848 provider_type : remote::bedrock
4949 config :
50- api_key : ${env.AWS_BEDROCK_API_KEY :=}
50+ api_key : ${env.AWS_BEARER_TOKEN_BEDROCK :=}
5151 region_name : ${env.AWS_DEFAULT_REGION:=us-east-2}
5252 - provider_id : ${env.NVIDIA_API_KEY:+nvidia}
5353 provider_type : remote::nvidia
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ providers:
4747 - provider_id : bedrock
4848 provider_type : remote::bedrock
4949 config :
50- api_key : ${env.AWS_BEDROCK_API_KEY :=}
50+ api_key : ${env.AWS_BEARER_TOKEN_BEDROCK :=}
5151 region_name : ${env.AWS_DEFAULT_REGION:=us-east-2}
5252 - provider_id : ${env.NVIDIA_API_KEY:+nvidia}
5353 provider_type : remote::nvidia
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ providers:
4747 - provider_id : bedrock
4848 provider_type : remote::bedrock
4949 config :
50- api_key : ${env.AWS_BEDROCK_API_KEY :=}
50+ api_key : ${env.AWS_BEARER_TOKEN_BEDROCK :=}
5151 region_name : ${env.AWS_DEFAULT_REGION:=us-east-2}
5252 - provider_id : ${env.NVIDIA_API_KEY:+nvidia}
5353 provider_type : remote::nvidia
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ providers:
4747 - provider_id : bedrock
4848 provider_type : remote::bedrock
4949 config :
50- api_key : ${env.AWS_BEDROCK_API_KEY :=}
50+ api_key : ${env.AWS_BEARER_TOKEN_BEDROCK :=}
5151 region_name : ${env.AWS_DEFAULT_REGION:=us-east-2}
5252 - provider_id : ${env.NVIDIA_API_KEY:+nvidia}
5353 provider_type : remote::nvidia
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ async def openai_chat_completion(
111111 logger .error (f"AWS Bedrock authentication token expired: { error_msg } " )
112112 raise ValueError (
113113 "AWS Bedrock authentication failed: Bearer token has expired. "
114- "The AWS_BEDROCK_API_KEY environment variable contains an expired pre-signed URL. "
114+ "The AWS_BEARER_TOKEN_BEDROCK environment variable contains an expired pre-signed URL. "
115115 "Please refresh your token by generating a new pre-signed URL with AWS credentials. "
116116 "Refer to AWS Bedrock documentation for details on OpenAI-compatible endpoints."
117117 ) from e
Original file line number Diff line number Diff line change @@ -27,6 +27,6 @@ class BedrockConfig(RemoteInferenceProviderConfig):
2727 @classmethod
2828 def sample_run_config (cls , ** kwargs ):
2929 return {
30- "api_key" : "${env.AWS_BEDROCK_API_KEY :=}" ,
30+ "api_key" : "${env.AWS_BEARER_TOKEN_BEDROCK :=}" ,
3131 "region_name" : "${env.AWS_DEFAULT_REGION:=us-east-2}" ,
3232 }
Original file line number Diff line number Diff line change 99
1010def test_bedrock_config_defaults_no_env (monkeypatch ):
1111 """Test BedrockConfig defaults when env vars are not set"""
12- monkeypatch .delenv ("AWS_BEDROCK_API_KEY " , raising = False )
12+ monkeypatch .delenv ("AWS_BEARER_TOKEN_BEDROCK " , raising = False )
1313 monkeypatch .delenv ("AWS_DEFAULT_REGION" , raising = False )
1414 config = BedrockConfig ()
1515 assert config .auth_credential is None
@@ -35,5 +35,5 @@ def test_bedrock_config_sample():
3535 sample = BedrockConfig .sample_run_config ()
3636 assert "api_key" in sample
3737 assert "region_name" in sample
38- assert sample ["api_key" ] == "${env.AWS_BEDROCK_API_KEY :=}"
38+ assert sample ["api_key" ] == "${env.AWS_BEARER_TOKEN_BEDROCK :=}"
3939 assert sample ["region_name" ] == "${env.AWS_DEFAULT_REGION:=us-east-2}"
You can’t perform that action at this time.
0 commit comments