pub struct CreateFileRequest {
pub file: PathBuf,
pub purpose: FilePurpose,
pub expires_after: Option<ExpiresAfter>,
pub extra_body_map: 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: PathBufThe File object (not file name) to be uploaded.
purpose: FilePurposeThe 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.
extra_body_map: Option<Map<String, Value>>Trait Implementations§
Source§impl Clone for CreateFileRequest
impl Clone for CreateFileRequest
Source§impl Debug for CreateFileRequest
impl Debug for CreateFileRequest
Source§impl Default for CreateFileRequest
impl Default for CreateFileRequest
Source§impl Post for CreateFileRequest
impl Post for CreateFileRequest
Source§impl PostNoStream for CreateFileRequest
impl PostNoStream for CreateFileRequest
Source§async fn get_response_string(
&self,
client: &Client,
base_url: &str,
options: &RequestOptions,
) -> Result<String, OapiError>
async fn get_response_string( &self, client: &Client, base_url: &str, options: &RequestOptions, ) -> Result<String, OapiError>
Sends a file upload POST request using multipart/form-data format. This implementation handles the actual file upload with proper file handling.