Skip to content

Commit fe698a4

Browse files
committed
Merge branch 'main' into fix_validator_imports
2 parents 9c71fab + 26756ee commit fe698a4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

guardrails/classes/history/iteration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ def create_msg_history_table(
215215
self.raw_output or "", title="Raw LLM Output", style="on #F5F5DC"
216216
),
217217
Panel(
218-
pretty_repr(self.validation_response),
218+
self.validation_response
219+
if isinstance(self.validation_response, str)
220+
else pretty_repr(self.validation_response),
219221
title="Validated Output",
220222
style="on #F0FFF0",
221223
),

guardrails/validators/endpoint_is_reachable.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from http import HTTPStatus
12
from typing import Any, Dict
23

34
from guardrails.logger import logger
@@ -31,7 +32,7 @@ def validate(self, value: Any, metadata: Dict) -> ValidationResult:
3132
# Check that the URL exists and can be reached
3233
try:
3334
response = requests.get(value)
34-
if response.status_code != 200:
35+
if response.status_code != HTTPStatus.OK:
3536
return FailResult(
3637
error_message=f"URL {value} returned "
3738
f"status code {response.status_code}",

0 commit comments

Comments
 (0)