pub struct Files<'c, C: Config> { /* private fields */ }
Expand description
Files are used to upload documents that can be used with features like Assistants and Fine-tuning.
Implementations§
Source§impl<'c, C: Config> Files<'c, C>
impl<'c, C: Config> Files<'c, C>
pub fn new(client: &'c Client<C>) -> Self
Sourcepub async fn create(
&self,
request: CreateFileRequest,
) -> Result<OpenAIFile, OpenAIError>
pub async fn create( &self, request: CreateFileRequest, ) -> Result<OpenAIFile, OpenAIError>
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 100 GB.
The Assistants API supports files up to 2 million tokens and of specific file types. See the 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 100 MB in size. The input also has a specific required format.
Please contact us if you need to increase these storage limits.
Sourcepub async fn list<Q>(&self, query: &Q) -> Result<ListFilesResponse, OpenAIError>
pub async fn list<Q>(&self, query: &Q) -> Result<ListFilesResponse, OpenAIError>
Returns a list of files that belong to the user’s organization.
Sourcepub async fn retrieve(&self, file_id: &str) -> Result<OpenAIFile, OpenAIError>
pub async fn retrieve(&self, file_id: &str) -> Result<OpenAIFile, OpenAIError>
Returns information about a specific file.
Sourcepub async fn delete(
&self,
file_id: &str,
) -> Result<DeleteFileResponse, OpenAIError>
pub async fn delete( &self, file_id: &str, ) -> Result<DeleteFileResponse, OpenAIError>
Delete a file.