fix: prevent SageMaker TGI from being marked configured when only Bedrock keys are set (#7284)
Signed-off-by: ibaaaaal rifaldi.51922721@mahasiswa.unikom.ac.id Co-authored-by: Lifei Zhou <lifei@squareup.com>
This commit is contained in:
@@ -323,7 +323,7 @@ impl ProviderDef for BedrockProvider {
|
||||
BEDROCK_DOC_LINK,
|
||||
vec![
|
||||
ConfigKey::new("AWS_PROFILE", false, false, Some("default"), true),
|
||||
ConfigKey::new("AWS_REGION", false, false, None, true),
|
||||
ConfigKey::new("AWS_REGION", true, false, Some("us-east-1"), true),
|
||||
ConfigKey::new("AWS_BEARER_TOKEN_BEDROCK", false, true, None, true),
|
||||
ConfigKey::new("BEDROCK_ENABLE_CACHING", false, false, Some("false"), false),
|
||||
],
|
||||
@@ -456,11 +456,18 @@ mod tests {
|
||||
.iter()
|
||||
.find(|k| k.name == "AWS_REGION")
|
||||
.expect("AWS_REGION config key should exist");
|
||||
assert!(!aws_region.required, "AWS_REGION should not be required");
|
||||
assert!(
|
||||
aws_region.required,
|
||||
"AWS_REGION is required for Bedrock to be marked as configured"
|
||||
);
|
||||
assert!(
|
||||
!aws_region.secret,
|
||||
"AWS_REGION should not be marked as secret"
|
||||
);
|
||||
assert!(
|
||||
aws_region.default.is_some(),
|
||||
"AWS_REGION should have a default value"
|
||||
);
|
||||
|
||||
let bearer_token = meta
|
||||
.config_keys
|
||||
|
||||
@@ -285,8 +285,8 @@ impl ProviderDef for SageMakerTgiProvider {
|
||||
SAGEMAKER_TGI_DOC_LINK,
|
||||
vec![
|
||||
ConfigKey::new("SAGEMAKER_ENDPOINT_NAME", true, false, None, true),
|
||||
ConfigKey::new("AWS_REGION", true, false, Some("us-east-1"), true),
|
||||
ConfigKey::new("AWS_PROFILE", true, false, Some("default"), true),
|
||||
ConfigKey::new("AWS_REGION", false, false, Some("us-east-1"), true),
|
||||
ConfigKey::new("AWS_PROFILE", false, false, Some("default"), true),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user