Generate structured outputs using FriendliAI’s Structured Outputs feature.
Type | Description | Name at OpenAI |
---|---|---|
json_schema | The model returns a JSON object that conforms to the given schema. | Structured Outputs |
json_object | The model can return any JSON object. | JSON mode |
regex | The model returns a string that conforms to the given regex schema. | N/A |
pydantic
library to define a schema for the output.Define Object Schema
Asking the model for structured output
Using structured output results
null
, boolean
, number
, integer
, string
, object
, array
), and the supported JSON schema keywords are listed below.
integer
exclusiveMinimum
, exclusiveMaximum
, minimum
, maximum
(Note: these are not supported in number
)string
pattern
format
uuid
, date-time
, date
, time
object
properties
additionalProperties
is ignored, and is always set to False
.required
: We support both required and optional properties, but have these limitations:
required
. If not, the first required property is moved to the first.array
items
minItems
: We support only 0
or 1
for minItems
.const
and enum
only support constant values of null, boolean, number, and string.
anyOf
for schema composition.
$ref
) to “internal” subschemas. These subschemas must be defined within $defs
, and the value of $ref
must be a valid URI pointing to a subschema. Please refer here for more details.
title
, $comments
or description
are accepted but ignored.