Skip to main content

mistral_openapi_client/models/
completion_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 CompletionJobOut {
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::CompletionTrainingParameters>,
55    #[serde(rename = "repositories", skip_serializing_if = "Option::is_none")]
56    pub repositories: Option<Vec<models::GithubRepositoryOut>>,
57}
58
59impl CompletionJobOut {
60    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::CompletionTrainingParameters) -> CompletionJobOut {
61        CompletionJobOut {
62            id,
63            auto_start,
64            model,
65            status,
66            created_at,
67            modified_at,
68            training_files,
69            validation_files: None,
70            object: None,
71            fine_tuned_model: None,
72            suffix: None,
73            integrations: None,
74            trained_tokens: None,
75            metadata: None,
76            job_type: None,
77            hyperparameters: Box::new(hyperparameters),
78            repositories: None,
79        }
80    }
81}
82/// The current status of the fine-tuning job.
83#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
84pub enum Status {
85    #[serde(rename = "QUEUED")]
86    Queued,
87    #[serde(rename = "STARTED")]
88    Started,
89    #[serde(rename = "VALIDATING")]
90    Validating,
91    #[serde(rename = "VALIDATED")]
92    Validated,
93    #[serde(rename = "RUNNING")]
94    Running,
95    #[serde(rename = "FAILED_VALIDATION")]
96    FailedValidation,
97    #[serde(rename = "FAILED")]
98    Failed,
99    #[serde(rename = "SUCCESS")]
100    Success,
101    #[serde(rename = "CANCELLED")]
102    Cancelled,
103    #[serde(rename = "CANCELLATION_REQUESTED")]
104    CancellationRequested,
105}
106
107impl Default for Status {
108    fn default() -> Status {
109        Self::Queued
110    }
111}
112/// The object type of the fine-tuning job.
113#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
114pub enum Object {
115    #[serde(rename = "job")]
116    Job,
117}
118
119impl Default for Object {
120    fn default() -> Object {
121        Self::Job
122    }
123}
124/// The type of job (`FT` for fine-tuning).
125#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
126pub enum JobType {
127    #[serde(rename = "completion")]
128    Completion,
129}
130
131impl Default for JobType {
132    fn default() -> JobType {
133        Self::Completion
134    }
135}
136