OpenAIFiles class

OpenAI File Management capability implementation

This module handles file upload, listing, retrieval, and deletion for OpenAI providers.

Implemented types

Constructors

OpenAIFiles.new(OpenAIClient client, OpenAIConfig config)

Properties

client OpenAIClient
final
config OpenAIConfig
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cleanupOldFiles(int olderThanDays) Future<List<FileDeleteResponse>>
Clean up old files (older than specified days)
deleteFile(String fileId) Future<FileDeleteResponse>
Delete a file
override
deleteFiles(List<String> fileIds) Future<List<FileDeleteResponse>>
Batch delete files
fileExists(String fileId) Future<bool>
Check if a file exists
getFileContent(String fileId) Future<List<int>>
Get file content
override
getFileContentAsString(String fileId) Future<String>
Get file content as string
getFileSize(String fileId) Future<int?>
Get file size in bytes
getTotalStorageUsed() Future<int>
Get total storage used
listFiles([FileListQuery? query]) Future<FileListResponse>
List files
override
listFilesByPurpose(FilePurpose purpose) Future<List<FileObject>>
List files by purpose
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
retrieveFile(String fileId) Future<FileObject>
Retrieve file metadata
override
toString() String
A string representation of this object.
inherited
uploadFile(FileUploadRequest request) Future<FileObject>
Upload a file
override
uploadFileFromBytes(List<int> bytes, FilePurpose purpose, {String? filename}) Future<FileObject>
Upload file from bytes with automatic filename

Operators

operator ==(Object other) bool
The equality operator.
inherited