@@ -4,6 +4,45 @@ import sttp.openai.OpenAIExceptions.OpenAIException.DeserializationOpenAIExcepti
4
4
import sttp .openai .json .SnakePickle
5
5
import ujson .Str
6
6
7
+ /** @param id
8
+ * The object identifier, which can be referenced in the API endpoints.
9
+ * @param createdAt
10
+ * The Unix timestamp (in seconds) for when the fine-tuning job was created.
11
+ * @param error
12
+ * For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.
13
+ * @param fineTunedModel
14
+ * The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.
15
+ * @param finishedAt
16
+ * The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still
17
+ * running.
18
+ * @param hyperparameters
19
+ * The hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs.
20
+ * @param model
21
+ * The base model that is being fine-tuned.
22
+ * @param `object`
23
+ * The object type, which is always "fine_tuning.job".
24
+ * @param organizationId
25
+ * The organization that owns the fine-tuning job.
26
+ * @param resultFiles
27
+ * The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API.
28
+ * @param status
29
+ * The current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled.
30
+ * @param trainedTokens
31
+ * The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.
32
+ * @param trainingFile
33
+ * The file ID used for training. You can retrieve the training data with the Files API.
34
+ * @param validationFile
35
+ * The file ID used for validation. You can retrieve the validation results with the Files API.
36
+ * @param integrations
37
+ * A list of integrations to enable for this fine-tuning job.
38
+ * @param seed
39
+ * The seed used for the fine-tuning job.
40
+ * @param estimatedFinish
41
+ * The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is
42
+ * not running.
43
+ * @param method
44
+ * The method used for fine-tuning.
45
+ */
7
46
case class FineTuningResponse (
8
47
id : String ,
9
48
createdAt : Int ,
@@ -53,12 +92,11 @@ object Status {
53
92
54
93
implicit val statusRW : SnakePickle .Reader [Status ] = SnakePickle
55
94
.reader[ujson.Value ]
56
- .map[Status ](
57
- jsonValue =>
58
- SnakePickle .read[ujson.Value ](jsonValue) match {
59
- case Str (value) => byStatusValue.getOrElse(value, CustomStatus (value))
60
- case e => throw DeserializationOpenAIException (new Exception (s " Could not deserialize: $e" ))
61
- }
95
+ .map[Status ](jsonValue =>
96
+ SnakePickle .read[ujson.Value ](jsonValue) match {
97
+ case Str (value) => byStatusValue.getOrElse(value, CustomStatus (value))
98
+ case e => throw DeserializationOpenAIException (new Exception (s " Could not deserialize: $e" ))
99
+ }
62
100
)
63
101
64
102
case object ValidatingFiles extends Status (" validating_files" )
@@ -80,3 +118,13 @@ object Status {
80
118
private val byStatusValue = values.map(status => status.value -> status).toMap
81
119
82
120
}
121
+
122
+ case class ListFineTuningResponse (
123
+ `object` : String = " list" ,
124
+ data : Seq [FineTuningResponse ],
125
+ hasMore : Boolean
126
+ )
127
+
128
+ object ListFineTuningResponse {
129
+ implicit val listFineTuningResponseR : SnakePickle .Reader [ListFineTuningResponse ] = SnakePickle .macroR[ListFineTuningResponse ]
130
+ }
0 commit comments