OpenAIFileObject

@Serializable
data class OpenAIFileObject(val id: String, val bytes: Long = 0, val createdAt: Long, val filename: String = "", val obj: String = "file", val purpose: OpenAIPurpose = OpenAIPurpose.ASSISTANTS, val expiresAt: Long? = null) : AIFileResult, Mapper<ApiFile>

A file object returned by the OpenAI Files API.

Constructors

Link copied to clipboard
constructor(id: String, bytes: Long = 0, createdAt: Long, filename: String = "", obj: String = "file", purpose: OpenAIPurpose = OpenAIPurpose.ASSISTANTS, expiresAt: Long? = null)

Properties

Link copied to clipboard
val bytes: Long

The file size in bytes.

Link copied to clipboard
@Serializable(with = FlexibleInstantSerializer::class)
@SerialName(value = "created_at")
val createdAt: Long

Unix timestamp (in seconds) when the file was created.

Link copied to clipboard
@Serializable(with = FlexibleInstantSerializer::class)
@SerialName(value = "expires_at")
val expiresAt: Long?

Unix timestamp (in seconds) when the file expires, if applicable.

Link copied to clipboard

The name of the file.

Link copied to clipboard
open override val id: String

The unique file identifier.

Link copied to clipboard
@SerialName(value = "object")
val obj: String

The object type (always "file").

Link copied to clipboard

The intended purpose of the file.

Functions

Link copied to clipboard
Link copied to clipboard

Returns expiresAt as an Instant, or null if the file never expires.

Link copied to clipboard
open override fun map(): ApiFile
Link copied to clipboard