openai_struct/models/
create_chat_completion_response.rs

1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11/// pub CreateChatCompletionResponse : Represents a chat completion response returned by model, based on the provided input.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// todo: 过长之后看
17#[derive(Debug, Serialize, Deserialize)]
18pub struct CreateChatCompletionResponse {
19    /// A list of chat completion choices. Can be more than one if `n` is greater than 1.
20    #[serde(rename = "choices")]
21    pub choices: Vec<crate::models::CreateChatCompletionResponseChoices>,
22    /// The Unix timestamp (in seconds) of when the chat completion was created.
23    #[serde(rename = "created")]
24    pub created: i32,
25    /// A unique identifier for the chat completion.
26    #[serde(rename = "id")]
27    pub id: String,
28    /// The model used for the chat completion.
29    #[serde(rename = "model")]
30    pub model: String,
31    /// The object type, which is always `chat.completion`.
32    #[serde(rename = "object")]
33    #[serde(default = "default_object")]
34    pub object: String,
35    #[serde(rename = "service_tier")]
36    pub service_tier: Option<crate::models::ServiceTier>,
37    /// This fingerprint represents the backend configuration that the model runs with.  Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
38    #[serde(rename = "system_fingerprint")]
39    pub system_fingerprint: Option<String>,
40    #[serde(rename = "usage")]
41    pub usage: Option<crate::models::CompletionUsage>,
42}
43
44fn default_object() -> String {
45    "chat.completion".into()
46}