Class GeminiFileUploadRequest
Uploads a file to the Gemini File API. Response type is GeminiFileUploadResponse.
public class GeminiFileUploadRequest : IGeminiMultiPartPostRequest, IGeminiRequest
- Inheritance
-
GeminiFileUploadRequest
- Implements
- Extension Methods
Remarks
Only available in the beta API.
Constructors
GeminiFileUploadRequest(string, bool)
Creates a new GeminiFileUploadRequest.
public GeminiFileUploadRequest(string contentType, bool useBetaApi = true)
Parameters
contentType
stringThe content type of the data.
useBetaApi
boolShould the request use the Beta API?
Remarks
Only available in the beta API.
GeminiFileUploadRequest(GeminiContentType, bool)
Creates a new GeminiFileUploadRequest.
public GeminiFileUploadRequest(GeminiContentType contentType, bool useBetaApi = true)
Parameters
contentType
GeminiContentTypeThe content type of the data.
useBetaApi
boolShould the request use the Beta API?
Remarks
Only available in the beta API.
Fields
ApiVersion
The API version to use.
public string ApiVersion
Field Value
File
Optional metadata for the GeminiFile to be uploaded.
public GeminiFileUploadMetaData File
Field Value
MimeType
The IANA standard MIME type of the GeminiFileUploadRequest.
public string MimeType
Field Value
RawData
The raw file data to upload.
public byte[] RawData
Field Value
- byte[]
Properties
AuthMethod
The preferred authentication method.
public GeminiAuthMethod AuthMethod { get; set; }
Property Value
ContentType
public string ContentType { get; }
Property Value
OAuthAccessToken
The OAuth access token to authenticate the request, if using OAuthAccessToken as AuthMethod.
public string OAuthAccessToken { get; set; }
Property Value
Methods
GetEndpointUri(GeminiRequestMetadata)
Gets the URI to the API endpoint.
public string GetEndpointUri(GeminiRequestMetadata metadata)
Parameters
metadata
GeminiRequestMetadataThe metadata of the request to be carried out on the URI.
Returns
- string
The URI.
GetUtf8EncodedData(string)
Converts the request object to a UTF-8 encoded multi-part string.
public string GetUtf8EncodedData(string dataSeperator)
Parameters
dataSeperator
stringThe boundary to seperate each part of the data.
Returns
- string
The string data.