Skip to main content

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