Skip to main content

mistral_openapi_client/models/
function_result_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 FunctionResultEntry {
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 = "id", skip_serializing_if = "Option::is_none")]
25    pub id: Option<String>,
26    #[serde(rename = "tool_call_id")]
27    pub tool_call_id: String,
28    #[serde(rename = "result")]
29    pub result: String,
30}
31
32impl FunctionResultEntry {
33    pub fn new(tool_call_id: String, result: String) -> FunctionResultEntry {
34        FunctionResultEntry {
35            object: None,
36            r#type: None,
37            created_at: None,
38            completed_at: None,
39            id: None,
40            tool_call_id,
41            result,
42        }
43    }
44}
45/// 
46#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
47pub enum Object {
48    #[serde(rename = "entry")]
49    Entry,
50}
51
52impl Default for Object {
53    fn default() -> Object {
54        Self::Entry
55    }
56}
57/// 
58#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
59pub enum Type {
60    #[serde(rename = "function.result")]
61    FunctionResult,
62}
63
64impl Default for Type {
65    fn default() -> Type {
66        Self::FunctionResult
67    }
68}
69