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 ChatCompletionStreamResponseDelta : A chat completion delta generated by streamed model responses.

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

/// # on openapi.yaml
///
/// ```yaml
/// ChatCompletionStreamResponseDelta:
///   type: object
///   description: A chat completion delta generated by streamed model responses.
///   properties:
///     content:
///       type: string
///       description: The contents of the chunk message.
///       nullable: true
///     function_call:
///       deprecated: true
///       type: object
///       description:
///         Deprecated and replaced by `tool_calls`. The name and arguments of
///         a function that should be called, as generated by the model.
///       properties:
///         arguments:
///           type: string
///           description:
///             The arguments to call the function with, as generated by the model
///             in JSON format. Note that the model does not always generate
///             valid JSON, and may hallucinate parameters not defined by your
///             function schema. Validate the arguments in your code before
///             calling your function.
///         name:
///           type: string
///           description: The name of the function to call.
///     tool_calls:
///       type: array
///       items:
///         $ref: "#/components/schemas/ChatCompletionMessageToolCallChunk"
///     role:
///       type: string
///       enum:
///         - developer
///         - system
///         - user
///         - assistant
///         - tool
///       description: The role of the author of this message.
///     refusal:
///       type: string
///       description: The refusal message generated by the model.
///       nullable: true
/// ```
#[derive(Debug, Serialize, Deserialize)]
pub struct ChatCompletionStreamResponseDelta {
    /// The contents of the chunk message.
    #[serde(rename = "content")]
    pub content: Option<String>,
    #[serde(rename = "function_call")]
    pub function_call: Option<crate::models::ChatCompletionStreamResponseDeltaFunctionCall>,
    /// The refusal message generated by the model.
    #[serde(rename = "refusal")]
    pub refusal: Option<String>,
    /// The role of the author of this message.
    #[serde(rename = "role")]
    pub role: Option<String>,
    #[serde(rename = "tool_calls")]
    pub tool_calls: Option<Vec<crate::models::ChatCompletionMessageToolCallChunk>>,
}

impl Default for ChatCompletionStreamResponseDelta {
    fn default() -> Self {
        Self {
            content: None,
            function_call: None,
            refusal: None,
            role: None,
            tool_calls: None,
        }
    }
}