pub struct Files<'c, C: Config> { /* private fields */ }file only.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 each project can store up to 2.5 TB of files in total. There is no organization-wide storage limit.
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.
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 each project can store up to 2.5 TB of files in total. There is no organization-wide storage limit.
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.
Sourcepub async fn list(&self) -> Result<ListFilesResponse, OpenAIError>
pub async fn list(&self) -> Result<ListFilesResponse, OpenAIError>
Returns a list of files that belong to the user’s organization.
Sourcepub async fn list_byot<R: DeserializeOwned>(&self) -> Result<R, OpenAIError>
pub async fn list_byot<R: DeserializeOwned>(&self) -> 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.
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.
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.
Trait Implementations§
Source§impl<'c, C: Config> RequestOptionsBuilder for Files<'c, C>
Available on crate feature _api only.
impl<'c, C: Config> RequestOptionsBuilder for Files<'c, C>
_api only.