pub struct File {
pub id: String,
pub object: String,
pub bytes: u64,
pub created_at: u64,
pub filename: String,
pub purpose: String,
pub status: String,
pub status_details: Option<String>,
}Expand description
Represents a file object in OpenAI’s system
Fields§
§id: StringUnique identifier for the file
object: StringThe object type, which is always “file”
bytes: u64The size of the file, in bytes
created_at: u64The Unix timestamp (in seconds) for when the file was created
filename: StringThe name of the file
purpose: StringThe intended purpose of the file
status: StringThe current status of the file
status_details: Option<String>Additional details about the file’s status, if available
Implementations§
Source§impl File
impl File
Sourcepub fn purpose_enum(&self) -> Option<FilePurpose>
pub fn purpose_enum(&self) -> Option<FilePurpose>
Get the file purpose as a typed enum
Sourcepub fn is_fine_tune_file(&self) -> bool
pub fn is_fine_tune_file(&self) -> bool
Check if this file can be used for fine-tuning
Sourcepub fn is_assistants_file(&self) -> bool
pub fn is_assistants_file(&self) -> bool
Check if this file can be used with Assistants
Sourcepub fn is_batch_file(&self) -> bool
pub fn is_batch_file(&self) -> bool
Check if this file can be used for batch processing
Sourcepub fn size_human_readable(&self) -> String
pub fn size_human_readable(&self) -> String
Get human-readable file size
Sourcepub fn created_at_formatted(&self) -> String
pub fn created_at_formatted(&self) -> String
Get the creation date as a formatted string
Trait Implementations§
Source§impl<'de> Deserialize<'de> for File
impl<'de> Deserialize<'de> for File
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more