openai_struct/models/
create_chat_completion_stream_response_choices.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#[allow(unused_imports)]
12use serde_json::Value;
13
14#[derive(Debug, Serialize, Deserialize)]
15pub struct CreateChatCompletionStreamResponseChoices {
16    #[serde(rename = "delta")]
17    pub delta: crate::models::ChatCompletionStreamResponseDelta,
18    /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.
19    #[serde(rename = "finish_reason")]
20    pub finish_reason: String,
21    /// The index of the choice in the list of choices.
22    #[serde(rename = "index")]
23    pub index: i32,
24    #[serde(rename = "logprobs")]
25    pub logprobs: Option<crate::models::CreateChatCompletionResponseLogprobs>,
26}
27
28impl Default for CreateChatCompletionStreamResponseChoices {
29    fn default() -> Self {
30        Self {
31            delta: Default::default(),
32            finish_reason: "".to_string(),
33            index: 0,
34            logprobs: None,
35        }
36    }
37}