Skip to content

Commit ca0330d

Browse files
author
michal.zyga
committed
add retrieve fine tuning job method
1 parent 55c23d0 commit ca0330d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

core/src/main/scala/sttp/openai/OpenAI.scala

+12
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,18 @@ class OpenAI(authToken: String, baseUri: Uri = OpenAIUris.OpenAIBaseUri) {
613613
.response(asJson_parseErrors[ListFineTuningJobCheckpointResponse])
614614
}
615615

616+
/** Get info about a fine-tuning job.
617+
*
618+
* [[https://platform.openai.com/docs/api-reference/fine-tuning/retrieve]]
619+
*
620+
* @param fineTuningJobId
621+
* The ID of the fine-tuning job.
622+
*/
623+
def retrieveFineTuningJob(fineTuningJobId: String): Request[Either[OpenAIException, FineTuningJobResponse]] =
624+
openAIAuthRequest
625+
.get(openAIUris.fineTuningJob(fineTuningJobId))
626+
.response(asJson_parseErrors[FineTuningJobResponse])
627+
616628
/** Gets info about the fine-tune job.
617629
*
618630
* [[https://platform.openai.com/docs/api-reference/embeddings/create]]

core/src/main/scala/sttp/openai/OpenAISyncClient.scala

+10
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,16 @@ class OpenAISyncClient private (
395395
): ListFineTuningJobCheckpointResponse =
396396
sendOrThrow(openAI.listFineTuningJobCheckpoints(fineTuningJobId, queryParameters))
397397

398+
/** Get info about a fine-tuning job.
399+
*
400+
* [[https://platform.openai.com/docs/api-reference/fine-tuning/retrieve]]
401+
*
402+
* @param fineTuningJobId
403+
* The ID of the fine-tuning job.
404+
*/
405+
def retrieveFineTuningJob(fineTuningJobId: String): FineTuningJobResponse =
406+
sendOrThrow(openAI.retrieveFineTuningJob(fineTuningJobId))
407+
398408
/** Gets info about the fine-tune job.
399409
*
400410
* [[https://platform.openai.com/docs/api-reference/embeddings/create]]

0 commit comments

Comments
 (0)