From 344a33064cb3046eb53afca98b9c96d886482741 Mon Sep 17 00:00:00 2001 From: peterbanda Date: Mon, 13 Nov 2023 17:15:09 +0100 Subject: [PATCH] Optional 'file statistics' added to FileInfo holder (provided by Azure)/ --- .../scala/io/cequence/openaiscala/JsonFormats.scala | 1 + .../openaiscala/domain/response/FileInfo.scala | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/openai-client/src/main/scala/io/cequence/openaiscala/JsonFormats.scala b/openai-client/src/main/scala/io/cequence/openaiscala/JsonFormats.scala index 846988e6..f5fdfd18 100644 --- a/openai-client/src/main/scala/io/cequence/openaiscala/JsonFormats.scala +++ b/openai-client/src/main/scala/io/cequence/openaiscala/JsonFormats.scala @@ -87,6 +87,7 @@ object JsonFormats { implicit val embeddingFormat: Format[EmbeddingResponse] = Json.format[EmbeddingResponse] + implicit val fileStatisticsFormat: Format[FileStatistics] = Json.format[FileStatistics] implicit val fileInfoFormat: Format[FileInfo] = Json.format[FileInfo] implicit val fineTuneEventFormat: Format[FineTuneEvent] = { diff --git a/openai-core/src/main/scala/io/cequence/openaiscala/domain/response/FileInfo.scala b/openai-core/src/main/scala/io/cequence/openaiscala/domain/response/FileInfo.scala index ec1d4f0e..c02a1fcf 100644 --- a/openai-core/src/main/scala/io/cequence/openaiscala/domain/response/FileInfo.scala +++ b/openai-core/src/main/scala/io/cequence/openaiscala/domain/response/FileInfo.scala @@ -6,8 +6,17 @@ case class FileInfo( id: String, bytes: Long, created_at: ju.Date, + updated_at: Option[ju.Date], filename: String, purpose: String, status: String, // uploaded, processed, pending, error, deleting or deleted - status_details: Option[String] + status_details: Option[String], + statistics: Option[FileStatistics] +) + +case class FileStatistics( + // The number of contained training examples in files of kind "fine-tune" once validation of file content is complete. + examples: Int, + // The number of tokens used in prompts and completions for files of kind "fine-tune" once validation of file content is complete. + tokens: Int )