Skip to main content

mistral_openapi_client/models/
chat_completion_event_preview.rs

1/*
2 * Mistral AI API
3 *
4 * 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.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ChatCompletionEventPreview {
16    #[serde(rename = "event_id")]
17    pub event_id: String,
18    #[serde(rename = "correlation_id")]
19    pub correlation_id: String,
20    #[serde(rename = "created_at")]
21    pub created_at: String,
22    #[serde(rename = "extra_fields")]
23    pub extra_fields: std::collections::HashMap<String, models::ExtraFieldsValue>,
24    #[serde(rename = "nb_input_tokens")]
25    pub nb_input_tokens: i32,
26    #[serde(rename = "nb_output_tokens")]
27    pub nb_output_tokens: i32,
28}
29
30impl ChatCompletionEventPreview {
31    pub fn new(event_id: String, correlation_id: String, created_at: String, extra_fields: std::collections::HashMap<String, models::ExtraFieldsValue>, nb_input_tokens: i32, nb_output_tokens: i32) -> ChatCompletionEventPreview {
32        ChatCompletionEventPreview {
33            event_id,
34            correlation_id,
35            created_at,
36            extra_fields,
37            nb_input_tokens,
38            nb_output_tokens,
39        }
40    }
41}
42