pub struct ResponseFormat {
pub type: Option<ResponseFormats>,
pub json_schema: Option<Option<Box<JsonSchema>>>,
}Expand description
ResponseFormat : Specify the format that the model must output. By default it will use { \"type\": \"text\" }. Setting to { \"type\": \"json_object\" } enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to { \"type\": \"json_schema\" } enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.
Fields§
§type: Option<ResponseFormats>§json_schema: Option<Option<Box<JsonSchema>>>Implementations§
Source§impl ResponseFormat
impl ResponseFormat
Sourcepub fn new() -> ResponseFormat
pub fn new() -> ResponseFormat
Specify the format that the model must output. By default it will use { \"type\": \"text\" }. Setting to { \"type\": \"json_object\" } enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to { \"type\": \"json_schema\" } enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.
Trait Implementations§
Source§impl Clone for ResponseFormat
impl Clone for ResponseFormat
Source§fn clone(&self) -> ResponseFormat
fn clone(&self) -> ResponseFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more