guardrails-ai / guardrails

Adding guardrails to large language models.
https://www.guardrailsai.com/docs
Apache License 2.0
3.87k stars 288 forks source link

[bug] Verify Filter, Reask, and Refrain ser/de #1020

Open CalebCourier opened 3 weeks ago

CalebCourier commented 3 weeks ago

Describe the bug A user reported serialization issues while using the guardrails server when Filter, Reask, or Refrain were present in the guard history.

To Reproduce Setup a guard that will return one of the above.

Expected behavior All classes within ValidationOutcome and guard history (i.e. Call and its children), should serialize and deserialize without issue.

Library version: 0.5.0

CalebCourier commented 2 weeks ago

I am able to replicate this issue. It occurs when fetching the Guard history. We need to add custom serialization for these in ValidatorLogs. Specifically on the value_after_validation property.