Table of Contents

Class IFileServiceExtension

Namespace
OpenAI.Interfaces
Assembly
AntRunnerLib.dll
public static class IFileServiceExtension
Inheritance
System.Object
IFileServiceExtension
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

Methods

FileUpload(IFileService, UploadFilePurposes.UploadFilePurpose, Stream, String, CancellationToken)

public static Task<FileUploadResponse> FileUpload(this IFileService service, UploadFilePurposes.UploadFilePurpose purpose, Stream file, string fileName, CancellationToken cancellationToken = null)

Parameters

service IFileService
purpose UploadFilePurposes.UploadFilePurpose
file Stream
fileName System.String
cancellationToken CancellationToken

Returns

Task<FileUploadResponse>

FileUpload(IFileService, UploadFilePurposes.UploadFilePurpose, Byte[], String, CancellationToken)

public static Task<FileUploadResponse> FileUpload(this IFileService service, UploadFilePurposes.UploadFilePurpose purpose, byte[] file, string fileName, CancellationToken cancellationToken = null)

Parameters

service IFileService
purpose UploadFilePurposes.UploadFilePurpose
file System.Byte[]
fileName System.String
cancellationToken CancellationToken

Returns

Task<FileUploadResponse>

FileUpload(IFileService, String, Stream, String, CancellationToken)

public static Task<FileUploadResponse> FileUpload(this IFileService service, string purpose, Stream file, string fileName, CancellationToken cancellationToken = null)

Parameters

service IFileService
purpose System.String
file Stream
fileName System.String
cancellationToken CancellationToken

Returns

Task<FileUploadResponse>

RetrieveFileContent(IFileService, String, CancellationToken)

Returns the contents of the specified file

public static Task<FileContentResponse<string>> RetrieveFileContent(this IFileService service, string fileId, CancellationToken cancellationToken = null)

Parameters

service IFileService
fileId System.String

The ID of the file to use for this request

cancellationToken CancellationToken

Propagates notification that operations should be canceled.

Returns

Task<FileContentResponse<System.String>>