@@ -554,7 +554,7 @@ class OpenAI(authToken: String, baseUri: Uri = OpenAIUris.OpenAIBaseUri) {
554
554
*/
555
555
def createFineTuningJob (fineTuningRequestBody : FineTuningJobRequestBody ): Request [Either [OpenAIException , FineTuningJobResponse ]] =
556
556
openAIAuthRequest
557
- .post(openAIUris.FineTuning )
557
+ .post(openAIUris.FineTuningJobs )
558
558
.body(fineTuningRequestBody)
559
559
.response(asJson_parseErrors[FineTuningJobResponse ])
560
560
@@ -565,14 +565,31 @@ class OpenAI(authToken: String, baseUri: Uri = OpenAIUris.OpenAIBaseUri) {
565
565
def listFineTuningJobs (
566
566
queryParameters : finetuning.QueryParameters = finetuning.QueryParameters .empty
567
567
): Request [Either [OpenAIException , ListFineTuningJobResponse ]] = {
568
- val uri = openAIUris.FineTuning
568
+ val uri = openAIUris.FineTuningJobs
569
569
.withParams(queryParameters.toMap)
570
570
571
571
openAIAuthRequest
572
572
.get(uri)
573
573
.response(asJson_parseErrors[ListFineTuningJobResponse ])
574
574
}
575
575
576
+ /** Get status updates for a fine-tuning job.
577
+ *
578
+ * [[https://platform.openai.com/docs/api-reference/fine-tuning/list-events ]]
579
+ */
580
+ def listFineTuningJobEvents (
581
+ fineTuningJobId : String ,
582
+ queryParameters : finetuning.QueryParameters = finetuning.QueryParameters .empty
583
+ ): Request [Either [OpenAIException , ListFineTuningJobEventResponse ]] = {
584
+ val uri = openAIUris
585
+ .fineTuningJobEvents(fineTuningJobId)
586
+ .withParams(queryParameters.toMap)
587
+
588
+ openAIAuthRequest
589
+ .get(uri)
590
+ .response(asJson_parseErrors[ListFineTuningJobEventResponse ])
591
+ }
592
+
576
593
/** Gets info about the fine-tune job.
577
594
*
578
595
* [[https://platform.openai.com/docs/api-reference/embeddings/create ]]
@@ -1068,7 +1085,7 @@ private class OpenAIUris(val baseUri: Uri) {
1068
1085
val Files : Uri = uri " $baseUri/files "
1069
1086
val Models : Uri = uri " $baseUri/models "
1070
1087
val Moderations : Uri = uri " $baseUri/moderations "
1071
- val FineTuning : Uri = uri " $baseUri/fine_tuning/jobs "
1088
+ val FineTuningJobs : Uri = uri " $baseUri/fine_tuning/jobs "
1072
1089
val Transcriptions : Uri = audioBase.addPath(" transcriptions" )
1073
1090
val Translations : Uri = audioBase.addPath(" translations" )
1074
1091
val VariationsImage : Uri = imageBase.addPath(" variations" )
@@ -1078,6 +1095,9 @@ private class OpenAIUris(val baseUri: Uri) {
1078
1095
val ThreadsRuns : Uri = uri " $baseUri/threads/runs "
1079
1096
val VectorStores : Uri = uri " $baseUri/vector_stores "
1080
1097
1098
+ def fineTuningJob (fineTuningJobId : String ): Uri = FineTuningJobs .addPath(fineTuningJobId)
1099
+ def fineTuningJobEvents (fineTuningJobId : String ): Uri = fineTuningJob(fineTuningJobId).addPath(" events" )
1100
+
1081
1101
def file (fileId : String ): Uri = Files .addPath(fileId)
1082
1102
def fileContent (fileId : String ): Uri = Files .addPath(fileId, " content" )
1083
1103
def model (modelId : String ): Uri = Models .addPath(modelId)
0 commit comments