openai-struct 0.0.4

利用openai的openapi生成的rust结构体
Documentation
/*
 * OpenAI API
 *
 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
 *
 * OpenAPI spec pub version: 2.3.0
 *
 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
 */

/// pub EasyInputMessage : A message input to the model with a role indicating instruction following hierarchy. Instructions given with the `developer` or `system` role take precedence over instructions given with the `user` role. Messages with the `assistant` role are presumed to have been generated by the model in previous interactions.

#[allow(unused_imports)]
use serde_json::Value;

#[derive(Debug, Serialize, Deserialize)]
pub struct EasyInputMessage {
    /// Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
    #[serde(rename = "content")]
    pub content: Value,
    /// The role of the message input. One of `user`, `assistant`, `system`, or `developer`.
    #[serde(rename = "role")]
    pub role: String,
    /// The type of the message input. Always `message`.
    #[serde(rename = "type")]
    #[serde(default = "default_type")]
    pub _type: Option<String>,
}

fn default_type() -> Option<String> {
    Some("message".into())
}