Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions guardrails/validator_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ class Validator:

rail_alias: str = ""

# chunking function returns empty list or list of 2 chunks
# first chunk is the chunk to validate
# second chunk is incomplete chunk that needs further accumulation
accumulated_chunks = []
run_in_separate_process = False
override_value_on_pass = False
required_metadata_keys = []
Expand All @@ -167,6 +163,11 @@ def __init__(
):
self.on_fail_descriptor: Union[str, OnFailAction] = "custom"

# chunking function returns empty list or list of 2 chunks
# first chunk is the chunk to validate
# second chunk is incomplete chunk that needs further accumulation
self.accumulated_chunks: List[str] = []

if on_fail is None:
on_fail = OnFailAction.NOOP
if isinstance(on_fail, OnFailAction):
Expand Down