guidance-ai / guidance

A guidance language for controlling large language models.
MIT License
19.12k stars 1.04k forks source link

[Feature] `JSON` generation should allow `false` subschemas to blacklist keys #1018

Open hudson-ai opened 2 months ago

hudson-ai commented 2 months ago

E.g. the following schema should allow the generation of any object that does not contain the key "name":

{
 "type": "object",
 "properties": {
   "name": false
 },
 "required": []
}
hudson-ai commented 2 months ago

Note that

{
 "type": "object",
 "properties": {
   "name": false
 },
 "required": ["name"]
 }

should still raise an exception because there are no valid instances of this schema