Skip to content

Commit 5b340ef

Browse files
committed
🐛 changing validation result to be either a str or ValidationOutcome to run the app locally
1 parent 4c1bd80 commit 5b340ef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

detectors/guardrails_ai_wrapper/detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def run(self, input: ContentAnalysisHttpRequest) -> ContentsAnalysisResponse:
3838
logger.info(f"Validation successful for text: {text}")
3939
except Exception as e:
4040
logger.error(f"Validation failed for text: {text} with error: {e}")
41-
validation_result = e
41+
validation_result = str(e)
4242

4343
content_analyses.append(
4444
ContentAnalysisResponse(

detectors/guardrails_ai_wrapper/scheme.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ContentAnalysisResponse(BaseModel):
4545
text: str = Field(
4646
example="My email address is [email protected] and [email protected]"
4747
)
48-
validation_result: Union[Exception, ValidationOutcome]
48+
validation_result: Union[str, ValidationOutcome]
4949
evidences: Optional[List[EvidenceObj]] = Field(
5050
description="Optional field providing evidences for the provided detection",
5151
default=[],

0 commit comments

Comments
 (0)