64bit / async-openai

Rust library for OpenAI
https://docs.rs/async-openai
MIT License
1.11k stars 166 forks source link

Add support for the structured output response format #253

Closed q-ata closed 2 weeks ago

q-ata commented 1 month ago

OpenAI recently introduced the Structured Outputs feature which ensures that responses will adhere to a predefined JSON schema.

Last year at DevDay, we introduced JSON mode—a useful building block for developers looking to build reliable applications with our models. While JSON mode improves model reliability for generating valid JSON outputs, it does not guarantee that the model’s response will conform to a particular schema. Today we’re introducing Structured Outputs in the API, a new feature designed to ensure model-generated outputs will exactly match JSON Schemas provided by developers.

The documentation for using structured outputs is here.

64bit commented 2 weeks ago

This is released in v0.24.0