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 1 TB.
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 200 MB in size. The input also has a specific required format.
Please contact us if you need to increase these storage limits. 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 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 us if you need to increase these storage limits.
Sourcepub async fn create_byot<T0: Clone, R: DeserializeOwned>(
&self,
request: T0,
) -> Result<R, OpenAIError>
pub async fn create_byot<T0: Clone, R: DeserializeOwned>( &self, request: T0, ) -> Result<R, 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 1 TB.
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 200 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. Returns a list of files that belong to the user’s organization.
Sourcepub async fn list_byot<T0: Serialize, R: DeserializeOwned>(
&self,
query: T0,
) -> Result<R, OpenAIError>
pub async fn list_byot<T0: Serialize, R: DeserializeOwned>( &self, query: T0, ) -> Result<R, 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. Returns information about a specific file.
Sourcepub async fn retrieve_byot<T0: Display, R: DeserializeOwned>(
&self,
file_id: T0,
) -> Result<R, OpenAIError>
pub async fn retrieve_byot<T0: Display, R: DeserializeOwned>( &self, file_id: T0, ) -> Result<R, 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. Delete a file.
Sourcepub async fn delete_byot<T0: Display, R: DeserializeOwned>(
&self,
file_id: T0,
) -> Result<R, OpenAIError>
pub async fn delete_byot<T0: Display, R: DeserializeOwned>( &self, file_id: T0, ) -> Result<R, OpenAIError>
Delete a file.