Skip to main content

mistral_openapi_client/models/
classifier_job_out.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 ClassifierJobOut {
16    /// The ID of the job.
17    #[serde(rename = "id")]
18    pub id: uuid::Uuid,
19    #[serde(rename = "auto_start")]
20    pub auto_start: bool,
21    #[serde(rename = "model")]
22    pub model: String,
23    /// The current status of the fine-tuning job.
24    #[serde(rename = "status")]
25    pub status: Status,
26    /// The UNIX timestamp (in seconds) for when the fine-tuning job was created.
27    #[serde(rename = "created_at")]
28    pub created_at: i32,
29    /// The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.
30    #[serde(rename = "modified_at")]
31    pub modified_at: i32,
32    /// A list containing the IDs of uploaded files that contain training data.
33    #[serde(rename = "training_files")]
34    pub training_files: Vec<uuid::Uuid>,
35    #[serde(rename = "validation_files", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub validation_files: Option<Option<Vec<uuid::Uuid>>>,
37    /// The object type of the fine-tuning job.
38    #[serde(rename = "object", skip_serializing_if = "Option::is_none")]
39    pub object: Option<Object>,
40    #[serde(rename = "fine_tuned_model", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub fine_tuned_model: Option<Option<String>>,
42    #[serde(rename = "suffix", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub suffix: Option<Option<String>>,
44    #[serde(rename = "integrations", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
45    pub integrations: Option<Option<Vec<models::WandbIntegrationOut>>>,
46    #[serde(rename = "trained_tokens", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
47    pub trained_tokens: Option<Option<i32>>,
48    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
49    pub metadata: Option<Option<Box<models::JobMetadataOut>>>,
50    /// The type of job (`FT` for fine-tuning).
51    #[serde(rename = "job_type", skip_serializing_if = "Option::is_none")]
52    pub job_type: Option<JobType>,
53    #[serde(rename = "hyperparameters")]
54    pub hyperparameters: Box<models::ClassifierTrainingParameters>,
55}
56
57impl ClassifierJobOut {
58    pub fn new(id: uuid::Uuid, auto_start: bool, model: String, status: Status, created_at: i32, modified_at: i32, training_files: Vec<uuid::Uuid>, hyperparameters: models::ClassifierTrainingParameters) -> ClassifierJobOut {
59        ClassifierJobOut {
60            id,
61            auto_start,
62            model,
63            status,
64            created_at,
65            modified_at,
66            training_files,
67            validation_files: None,
68            object: None,
69            fine_tuned_model: None,
70            suffix: None,
71            integrations: None,
72            trained_tokens: None,
73            metadata: None,
74            job_type: None,
75            hyperparameters: Box::new(hyperparameters),
76        }
77    }
78}
79/// The current status of the fine-tuning job.
80#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
81pub enum Status {
82    #[serde(rename = "QUEUED")]
83    Queued,
84    #[serde(rename = "STARTED")]
85    Started,
86    #[serde(rename = "VALIDATING")]
87    Validating,
88    #[serde(rename = "VALIDATED")]
89    Validated,
90    #[serde(rename = "RUNNING")]
91    Running,
92    #[serde(rename = "FAILED_VALIDATION")]
93    FailedValidation,
94    #[serde(rename = "FAILED")]
95    Failed,
96    #[serde(rename = "SUCCESS")]
97    Success,
98    #[serde(rename = "CANCELLED")]
99    Cancelled,
100    #[serde(rename = "CANCELLATION_REQUESTED")]
101    CancellationRequested,
102}
103
104impl Default for Status {
105    fn default() -> Status {
106        Self::Queued
107    }
108}
109/// The object type of the fine-tuning job.
110#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
111pub enum Object {
112    #[serde(rename = "job")]
113    Job,
114}
115
116impl Default for Object {
117    fn default() -> Object {
118        Self::Job
119    }
120}
121/// The type of job (`FT` for fine-tuning).
122#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
123pub enum JobType {
124    #[serde(rename = "classifier")]
125    Classifier,
126}
127
128impl Default for JobType {
129    fn default() -> JobType {
130        Self::Classifier
131    }
132}
133