pub struct CreateFileRequest {
pub file: PathBuf,
pub purpose: FilePurpose,
pub expires_after: Option<ExpiresAfter>,
pub extra_body: Option<Map<String, Value>>,
}
Expand description
Upload a file that can be used across various endpoints.
Individual files can be up to 512 MB, and the size of all files uploaded by one organization can be up to 1 TB.
The Assistants API supports files up to 2 million tokens and of specific file types. See the OpenAI Assistants Tools guide for details.
The Fine-tuning API only supports .jsonl
files. The input also has certain
required formats for fine-tuning
chat or
completions
models.
The Batch API only supports .jsonl
files up to 200 MB in size. The input also
has a specific required
format.
Please contact OpenAI if you need to increase these storage limits.
Fields§
§file: PathBuf
The File object (not file name) to be uploaded.
purpose: FilePurpose
The intended purpose of the uploaded file. One of: - assistants
: Used in the
Assistants API - batch
: Used in the Batch API - fine-tune
: Used for
fine-tuning - vision
: Images used for vision fine-tuning - user_data
:
Flexible file type for any purpose - evals
: Used for eval data sets
expires_after: Option<ExpiresAfter>
The expiration policy for a file. By default, files with purpose=batch
expire
after 30 days and all other files are persisted until they are manually deleted.
This parameter is not supported by Qwen is not tested.
extra_body: Option<Map<String, Value>>
Trait Implementations§
Source§impl Clone for CreateFileRequest
impl Clone for CreateFileRequest
Source§fn clone(&self) -> CreateFileRequest
fn clone(&self) -> CreateFileRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CreateFileRequest
impl Debug for CreateFileRequest
Source§impl Default for CreateFileRequest
impl Default for CreateFileRequest
Source§fn default() -> CreateFileRequest
fn default() -> CreateFileRequest
Source§impl Post for CreateFileRequest
impl Post for CreateFileRequest
fn is_streaming(&self) -> bool
Source§impl PostNoStream for CreateFileRequest
impl PostNoStream for CreateFileRequest
Source§fn get_response_string(
&self,
url: &str,
key: &str,
) -> impl Future<Output = Result<String, OapiError>> + Send + Sync
fn get_response_string( &self, url: &str, key: &str, ) -> impl Future<Output = Result<String, OapiError>> + Send + Sync
Sends a file upload POST request using multipart/form-data format. This implementation handles the actual file upload with proper file handling.