/*
* Mistral AI API
*
* Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// 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.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ResponseFormat {
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<models::ResponseFormats>,
#[serde(rename = "json_schema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub json_schema: Option<Option<Box<models::JsonSchema>>>,
}
impl 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.
pub fn new() -> ResponseFormat {
ResponseFormat {
r#type: None,
json_schema: None,
}
}
}