-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Update JSON API and example notebook #699
Update JSON API and example notebook #699
Conversation
Thanks @riedgar-ms ! Looks great. The only change I would suggest is changing One other note unrelated to this PR, why do we have |
No particular reason on the argument naming, beyond "That's what came to mind first." I have updated (tag @hudson-ai for info). We probably should review the arguments across all public functions, and make sure we're consistent about which have to be named when present. |
Wonderful! Thank you @riedgar-ms for looping me in :) May be a separate PR, but it may be worth adding some extra info around effective prompting (in E.g. showing the LM what schema it will use ahead of time and even adding {
"type": "object",
"properties": {
"description" : { "type" : "string" },
"name" : { "type" : "string" },
"age" : { "type" : "integer" },
"armour" : { "type" : "string", "enum" : ["leather", "chainmail", "plate"] },
"weapon" : { "type" : "string", "enum" : ["sword", "axe", "mace", "spear", "bow", "crossbow"] },
"class" : { "type" : "string" },
"mantra" : { "type" : "string" },
"strength" : { "type" : "integer" },
"quest_items" : {
"type" : "array",
"items": { "type": "string" },
"examples": ["Triforce", "Master Sword"],
}
}
} (although maybe not these examples, as Nintendo is very protective of its IP) I'd also put forward that generating JSON is a popular enough use-case that an example deserves to be in the |
@hudson-ai Something like that would probably be good in expanded documentation (I have a few ideas for what to do with the notebooks, since the fact that they're not run regularly is a big problem). @slundberg does this look better to you? |
Ping @slundberg |
…ub.com/riedgar-ms/guidance into riedgar-ms/json-notebook-schema-update
@slundberg does this address your concerns? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #699 +/- ##
==========================================
- Coverage 69.19% 65.61% -3.58%
==========================================
Files 53 53
Lines 3967 3967
==========================================
- Hits 2745 2603 -142
- Misses 1222 1364 +142 ☔ View full report in Codecov by Sentry. |
@slundberg does this address your concerns? |
Is the API now more in line with your preferences @slundberg ? |
…ebook-schema-update
API seems fine to me. Seems like a nice set of updates and examples - thanks! Merging. |
Add the new JSON schema functionality to the example notebook for guaranteeing valid syntax. Also, rename the
json_schema
argument in theguidance.json()
function to be justschema
.