mistral_rouille/models/
message.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 * Build date: 2024-06-15T23:41:00.377209-06:00[America/Mexico_City]
7 * Generated using: https://openapi-generator.tech
8 * Open API specification v0.0.2 provided by Mistral @ https://docs.mistral.ai/redocusaurus/plugin-redoc-0.yaml
9 * Custom generation templates by [GovCraft Ai](https://www.govcraft.ai)
10 * Contact: roland@govcraft.ai
11 */
12
13use crate::models;
14use serde::{Deserialize, Serialize};
15
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct Message {
18    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
19    pub role: Option<String>,
20    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
21    pub content: Option<String>,
22    #[serde(rename = "tool_calls", skip_serializing_if = "Option::is_none")]
23    pub tool_calls: Option<Vec<models::ChatResponseFnTool>>,
24}
25
26impl Message {
27    /// Creates a new `Message` instance.
28    ///
29    /// # Arguments
30    ///
31    /// # Returns
32    ///
33    /// A new `Message` instance.
34    pub fn new() -> Message {
35        Message {
36            role: None,
37            content: None,
38            tool_calls: None,
39        }
40    }
41}