Structued Outputs
Structued Outputs ensure that the model always follows your supplied JSON schema. Portkey supports OpenAI's Structured Outputs featue out of the box with our SDKs & APIs.
Structued Outputs is different from OpenAI's JSON Mode
as well as Function Calling
. Check out this table for a quick comparison.
Difference Between Structued Outputs, JSON Mode, and Function Calling
If you are connecting the model to tools, functions, data, etc. in your system, then you should use function calling.
And if you want to structure the model's output when it responds to the user, then you should use a structured
response_format
.In
response_format
, you can set it as{ "type": "json_object" }
to enable the JSON Mode.And you can set it as
{ "type": "json_schema" }
to use the Structued Outputs Mode described above.
For more, refer to OpenAI's detailed documentation on Structued Outputs here.
Last updated