guidance-ai / guidance

A guidance language for controlling large language models.
MIT License
18.73k stars 1.03k forks source link

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

Open hudson-ai opened 1 week ago

hudson-ai commented 1 week 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 1 week ago

Note that

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

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