Skip to content

Commit 258548e

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 2b8b301 commit 258548e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

packages/uipath-platform/src/uipath/platform/guardrails/_guardrails_service.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,11 @@ def evaluate_guardrail(
121121
"parameters": parameters,
122122
"guardrailName": guardrail.name,
123123
}
124-
if (
125-
guardrail.validator_type == BYO_VALIDATOR_TYPE
126-
and guardrail.byo_validator_name is not None
127-
):
124+
if guardrail.validator_type == BYO_VALIDATOR_TYPE:
125+
if not guardrail.byo_validator_name:
126+
raise ValueError(
127+
"BYOG guardrails require byo_validator_name when validator_type is 'byo'."
128+
)
128129
payload["byoValidatorName"] = guardrail.byo_validator_name
129130
spec = RequestSpec(
130131
method="POST",

0 commit comments

Comments
 (0)