Interface IFileService
- Namespace
- OpenAI.Interfaces
- Assembly
- AntRunnerLib.dll
public interface IFileService
- Extension Methods
Methods
DeleteFile(String, CancellationToken)
Delete a file.
Task<FileDeleteResponse> DeleteFile(string fileId, CancellationToken cancellationToken = null)
Parameters
fileIdSystem.StringThe ID of the file to use for this request
cancellationTokenCancellationTokenPropagates notification that operations should be canceled.
Returns
- Task<FileDeleteResponse>
ListFile(CancellationToken)
Returns a list of files that belong to the user's organization.
Task<FileListResponse> ListFile(CancellationToken cancellationToken = null)
Parameters
cancellationTokenCancellationTokenPropagates notification that operations should be canceled.
Returns
- Task<FileListResponse>
RetrieveFile(String, CancellationToken)
Returns information about a specific file.
Task<FileResponse> RetrieveFile(string fileId, CancellationToken cancellationToken = null)
Parameters
fileIdSystem.StringThe ID of the file to use for this request
cancellationTokenCancellationTokenPropagates notification that operations should be canceled.
Returns
- Task<FileResponse>
RetrieveFileContent<T>(String, CancellationToken)
Returns the contents of the specified file
Task<FileContentResponse<T>> RetrieveFileContent<T>(string fileId, CancellationToken cancellationToken = null)
Parameters
fileIdSystem.StringThe ID of the file to use for this request
cancellationTokenCancellationTokenPropagates notification that operations should be canceled.
Returns
- Task<FileContentResponse<T>>
Type Parameters
T
UploadFile(String, Byte[], String, CancellationToken)
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.
Task<FileUploadResponse> UploadFile(string purpose, byte[] file, string fileName, CancellationToken cancellationToken = null)
Parameters
purposeSystem.StringThe intended purpose of the uploaded documents. Use "fine-tune" for Fine-tuning. This allows us to validate the format of the uploaded file.
fileSystem.Byte[]Name of the JSON Lines file to be uploaded. If the purpose is set to "fine-tune", each line is a JSON record with "prompt" and "completion" fields representing your training examples.
fileNameSystem.StringName of file
cancellationTokenCancellationTokenPropagates notification that operations should be canceled.
Returns
- Task<FileUploadResponse>