Skip to content

Commit 1a2523f

Browse files
authored
feat: bedrock_endpoint_url (langgenius#12838)
1 parent 03243cb commit 1a2523f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

api/core/model_runtime/model_providers/bedrock/bedrock.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ provider_credential_schema:
123123
en_US: AWS GovCloud (US-West)
124124
zh_Hans: AWS GovCloud (US-West)
125125
ja_JP: AWS GovCloud (米国西部)
126+
- variable: bedrock_endpoint_url
127+
label:
128+
zh_Hans: Bedrock Endpoint URL
129+
en_US: Bedrock Endpoint URL
130+
type: text-input
131+
required: false
132+
placeholder:
133+
zh_Hans: 在此输入您的 Bedrock Endpoint URL, 如:https://123456.cloudfront.net
134+
en_US: Enter your Bedrock Endpoint URL, e.g. https://123456.cloudfront.net
126135
- variable: model_for_validation
127136
required: false
128137
label:

api/core/model_runtime/model_providers/bedrock/get_bedrock_client.py

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def get_bedrock_client(service_name: str, credentials: Mapping[str, str]):
1313
client_config = Config(region_name=region_name)
1414
aws_access_key_id = credentials.get("aws_access_key_id")
1515
aws_secret_access_key = credentials.get("aws_secret_access_key")
16+
bedrock_endpoint_url = credentials.get("bedrock_endpoint_url")
1617

1718
if aws_access_key_id and aws_secret_access_key:
1819
# use aksk to call bedrock
@@ -21,6 +22,7 @@ def get_bedrock_client(service_name: str, credentials: Mapping[str, str]):
2122
config=client_config,
2223
aws_access_key_id=aws_access_key_id,
2324
aws_secret_access_key=aws_secret_access_key,
25+
**({"endpoint_url": bedrock_endpoint_url} if bedrock_endpoint_url else {}),
2426
)
2527
else:
2628
# use iam without aksk to call

0 commit comments

Comments
 (0)