Skip to content

Commit

Permalink
update doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebCourier committed Mar 15, 2024
1 parent 82129fa commit 89be7c7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
10 changes: 8 additions & 2 deletions guardrails/classes/history/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def validation_response(self) -> Optional[Union[str, Dict, ReAsk]]:
"""The aggregated responses from the validation process across all
iterations within the current call.
Could contain ReAsks.
This value could contain ReAsks.
"""
number_of_iterations = self.iterations.length

Expand Down Expand Up @@ -261,7 +261,13 @@ def fixed_output(self) -> Optional[Union[str, Dict]]:

@property
def guarded_output(self) -> Optional[Union[str, Dict]]:
"""The final output after undergoing validation.
"""The complete validated output after all stages of validation are
completed.
This property contains the aggregate validated output after all
validation stages have been completed. Some values in the
validated output may be "fixed" values that were corrected
during validation.
This will only have a value if the Guard is in a passing state.
"""
Expand Down
7 changes: 4 additions & 3 deletions guardrails/classes/history/iteration.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ def validation_output(self) -> Optional[Union[ReAsk, str, Dict]]:

@property
def guarded_output(self) -> Optional[Union[str, Dict]]:
"""Any valid output after undergoing validation.
"""Any valid values after undergoing validation.
Could be a partial structure if field level reasks occur.
Could contain fixed values.
Some values in the validated output may be "fixed" values that
were corrected during validation. This property may be a partial
structure if field level reasks occur.
"""
return self.outputs.guarded_output

Expand Down
7 changes: 4 additions & 3 deletions guardrails/classes/history/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ class Outputs(ArbitraryModel):
description="The response from the validation process.", default=None
)
guarded_output: Optional[Union[str, Dict]] = Field(
description="Any valid output after validation."
"Could be a partial structure if field level reasks occur."
"Could contain fixed values.",
description="""Any valid values after undergoing validation.
Some values may be "fixed" values that were corrected during validation.
This property may be a partial structure if field level reasks occur.""",
default=None,
)
reasks: Sequence[ReAsk] = Field(
Expand Down

0 comments on commit 89be7c7

Please sign in to comment.