Skip to main content

Structured Outputs

Sutro’s SDK allows you to enforce a JSON schema for the outputs of your inference job. This can be useful if you want to ensure that the outputs of your inference job are in a specific format, or if you want to extract specific information from the outputs. To specify a schema for the outputs of your inference job, you can pass a Pydantic Model or a JSON schema to the output_schema parameter in the SDK. If you pass a JSON schema, it must follow the json-schema.org specification.

Example with Pydantic Model

Example with JSON Schema