Skip to content

Commit

Permalink
Do not parse output of generate.JSON in README (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlouf authored Dec 10, 2023
1 parent 5df56a5 commit ac3ae2f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,6 @@ print(sequence)
# "weapon": "sword",
# "strength": 0
# }

parsed = Character.model_validate_json(sequence)
print(parsed)
# name='piggyback' age=23 armor=<Armor.chainmail: 'chainmail'> weapon=<Weapon.sword: 'sword'> strength=0
```

The method works with union types, optional types, arrays, nested schemas, etc. Some field constraints are [not supported yet](https://github.com/outlines-dev/outlines/issues/215), but everything else should work.
Expand Down

0 comments on commit ac3ae2f

Please sign in to comment.