I expected to read about the methods used by the libraries to get the structured output and not a comparison of the language compatibility for each. Fortunately the same author have a blog post ( https://www.boundaryml.com/blog/type-definition-prompting-ba... ) explaining how their approach works and how it compares to instructor ( https://github.com/jxnl/instructor ). Basically these libraries provide two things: 1.…
Will you be able to share an example code or gist ?
message = dedent(
f"""
As a genius expert, your task is to understand the content and provide
the parsed objects in json that match the following json_schema:\n
{json.dumps(response_model.model_json_schema(), indent=2)}
Make sure to return an instance of the JSON, not the schema itself
"""
)
Then depending on the mode, either they add another message `Return the correct JSON response within a ```json codeblock. not the JSON_SCHEMA` or they set the response format to json.