Struct async_openai::Files
source · 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. The size of all the files uploaded by one organization can be up to 100 GB.
The size of individual files can be a maximum of 512 MB or 2 million tokens for Assistants. See the Assistants Tools guide to learn more about the types of files supported. The Fine-tuning API only supports .jsonl
files.
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.
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
Auto Trait Implementations§
impl<'c, C> Freeze for Files<'c, C>
impl<'c, C> !RefUnwindSafe for Files<'c, C>
impl<'c, C> Send for Files<'c, C>where
C: Sync,
impl<'c, C> Sync for Files<'c, C>where
C: Sync,
impl<'c, C> Unpin for Files<'c, C>
impl<'c, C> !UnwindSafe for Files<'c, C>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more