Struct async_openai::Files
source · pub struct Files<'c> { /* private fields */ }
Expand description
Files are used to upload documents that can be used with features like Fine-tuning.
Implementations§
source§impl<'c> Files<'c>
impl<'c> Files<'c>
pub fn new(client: &'c Client) -> 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 contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
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 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.
sourcepub async fn retrieve_content(
&self,
file_id: &str
) -> Result<String, OpenAIError>
pub async fn retrieve_content( &self, file_id: &str ) -> Result<String, OpenAIError>
Returns the contents of the specified file