guardrails-ai / guardrails

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

[feat]Implement Dynamic Metadata-Driven Validators #1076

Open Anchaliya75 opened 3 days ago

Anchaliya75 commented 3 days ago

Description Modify the validators' base code to read data from metadata instead of initialization kwargs.

Why is this needed To dynamically add metadata in validate on the client side without redeploying docker image again. Ex: we need to redeploy docker image If we want to change the categories for pii_entities from ["PERSON","LOCATION"] to ["PERSON","PHONE_NUMBER","LOCATION"]

image

End result User can dynamically change categories for multiple guardrails from client-side using guard.validate()

image
zsimjee commented 3 days ago

I like this idea. Would be nice to have - by default - all initializer-level args that effect validation be at the metadata-level