-
-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a concise schema DSL alternative to JSON schema #790
Comments
I came up with an alternative syntax which feels quite good. Here's a description from draft documentation:
|
I dumped that documentation into Claude 3.7 Sonnet and got it to implement the parser plus tests: https://claude.ai/share/0c76d2e8-3702-4768-93da-6deb427dd09d |
Hah, got this working: llm --schema 'name,age int,vibes: as a haiku' 'invent a dog' Works with
{
"name": "Barkley",
"age": 5,
"vibes": "Joyful playfulness,\nChasing dreams in fields of green,\nLoyal friend always."
} |
I pulled out just the new function into (files-to-prompt code.py -n; mypy code.py) | llm -m claude-3.7-sonnet -o thinking 1 'fix these errors' Result: https://gist.github.com/simonw/efd28bead811ca651171ebb822ffb3ed |
I made this a documented Python utility function called |
I added a debug tool is #793: llm schemas dsl 'name,age int' {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "integer"
}
},
"required": [
"name",
"age"
]
} |
Typing JSON schema manually is awful. I want to be able to run something like this instead:
The text was updated successfully, but these errors were encountered: