Enforcing structured JSON schema output is important for handling LLM outputs downstream with other systems and APIs in your applications.
For an in-depth technical deep dive of how we implemented this feature, see our blog post.
First, return a string:
First, get a basic string output out:
Values other than strings
You can change the output type to be a different type, e.g.
float. This typing is strictly enforced.
Please let us know if there are specific types you'd like to see supported.
Multiple outputs in JSON schema
You can also add multiple output types in one call. The output is a JSON schema that is also strictly enforced.
Great! You've successfully run an LLM with structured JSON schema outputs.