Skip to main content

mistral_openapi_client/models/
function_call_entry.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 FunctionCallEntry {
16    #[serde(rename = "object", skip_serializing_if = "Option::is_none")]
17    pub object: Option<Object>,
18    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
19    pub r#type: Option<Type>,
20    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
21    pub created_at: Option<String>,
22    #[serde(rename = "completed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub completed_at: Option<Option<String>>,
24    #[serde(rename = "agent_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub agent_id: Option<Option<String>>,
26    #[serde(rename = "model", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub model: Option<Option<String>>,
28    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
29    pub id: Option<String>,
30    #[serde(rename = "tool_call_id")]
31    pub tool_call_id: String,
32    #[serde(rename = "name")]
33    pub name: String,
34    #[serde(rename = "arguments")]
35    pub arguments: Box<models::FunctionCallEntryArguments>,
36    #[serde(rename = "confirmation_status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub confirmation_status: Option<Option<ConfirmationStatus>>,
38}
39
40impl FunctionCallEntry {
41    pub fn new(tool_call_id: String, name: String, arguments: models::FunctionCallEntryArguments) -> FunctionCallEntry {
42        FunctionCallEntry {
43            object: None,
44            r#type: None,
45            created_at: None,
46            completed_at: None,
47            agent_id: None,
48            model: None,
49            id: None,
50            tool_call_id,
51            name,
52            arguments: Box::new(arguments),
53            confirmation_status: None,
54        }
55    }
56}
57/// 
58#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
59pub enum Object {
60    #[serde(rename = "entry")]
61    Entry,
62}
63
64impl Default for Object {
65    fn default() -> Object {
66        Self::Entry
67    }
68}
69/// 
70#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
71pub enum Type {
72    #[serde(rename = "function.call")]
73    FunctionCall,
74}
75
76impl Default for Type {
77    fn default() -> Type {
78        Self::FunctionCall
79    }
80}
81/// 
82#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
83pub enum ConfirmationStatus {
84    #[serde(rename = "pending")]
85    Pending,
86    #[serde(rename = "allowed")]
87    Allowed,
88    #[serde(rename = "denied")]
89    Denied,
90}
91
92impl Default for ConfirmationStatus {
93    fn default() -> ConfirmationStatus {
94        Self::Pending
95    }
96}
97