Skip to main content

mistral_openapi_client/models/
conversation_response.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/// ConversationResponse : The response after appending new entries to the conversation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ConversationResponse {
17    #[serde(rename = "object", skip_serializing_if = "Option::is_none")]
18    pub object: Option<Object>,
19    #[serde(rename = "conversation_id")]
20    pub conversation_id: String,
21    #[serde(rename = "outputs")]
22    pub outputs: Vec<models::OutputsInner>,
23    #[serde(rename = "usage")]
24    pub usage: Box<models::ConversationUsageInfo>,
25    #[serde(rename = "guardrails", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub guardrails: Option<Option<Vec<serde_json::Value>>>,
27}
28
29impl ConversationResponse {
30    /// The response after appending new entries to the conversation.
31    pub fn new(conversation_id: String, outputs: Vec<models::OutputsInner>, usage: models::ConversationUsageInfo) -> ConversationResponse {
32        ConversationResponse {
33            object: None,
34            conversation_id,
35            outputs,
36            usage: Box::new(usage),
37            guardrails: None,
38        }
39    }
40}
41/// 
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum Object {
44    #[serde(rename = "conversation.response")]
45    ConversationResponse,
46}
47
48impl Default for Object {
49    fn default() -> Object {
50        Self::ConversationResponse
51    }
52}
53