Table of Contents

Class GeminiCorporaCreateRequest

Creates a new Corpora API resource. Response type can be GeminiCorpus, GeminiCorpusDocument or GeminiCorpusChunk.

public class GeminiCorporaCreateRequest : IGeminiPostRequest, IGeminiRequest
Inheritance
object
GeminiCorporaCreateRequest
Implements
Extension Methods

Remarks

Only available in the beta API.

Constructors

GeminiCorporaCreateRequest(bool)

public GeminiCorporaCreateRequest(bool useBetaApi = true)

Parameters

useBetaApi bool

Should the request use the Beta API?

Remarks

Only available in the beta API.

GeminiCorporaCreateRequest(IGeminiCorpusResourceId, bool)

public GeminiCorporaCreateRequest(IGeminiCorpusResourceId parentResourceId, bool useBetaApi = true)

Parameters

parentResourceId IGeminiCorpusResourceId

The parent resource under which this resource will be created in. Unsupported for Corpus creation requests.

useBetaApi bool

Should 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

string

CustomMetadata

User provided custom metadata stored as key-value pairs used for querying. A Document/Chunk can have a maximum of 20 CustomMetadata.

public GeminiCorpusCustomMetadata[] CustomMetadata

Field Value

GeminiCorpusCustomMetadata[]

Remarks

Not supported for Corpus creation requests.

Data

The content for the Chunk, such as text. The maximum number of tokens per chunk is 2043.

public GeminiCorpusChunkData Data

Field Value

GeminiCorpusChunkData

Remarks

Required for Chunk creation requests.

DisplayName

The human-readable display name for the resource.

public string DisplayName

Field Value

string

Remarks

The display name must be no more than 512 characters in length, including spaces. Unsupported for Chunk creation requests.
Example: "Docs on Semantic Retriever"

ParentResourceId

The parent resource under which this resource will be created in.

public IGeminiCorpusResourceId ParentResourceId

Field Value

IGeminiCorpusResourceId

Remarks

Not supported for Corpus creation requests.

ResourceId

The resource's ID.

public IGeminiCorpusResourceId ResourceId

Field Value

IGeminiCorpusResourceId

Remarks

The ID (name excluding the "corpora/" or "corpora//documents/", "corpora//documents/*/chunks/" prefixes) can contain up to 40
characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create,
a unique name will be derived from DisplayName along with a 12 character random suffix. For
Chunk creation requests, only the 12 character suffix will be generated.

Properties

AuthMethod

The preferred authentication method.

public GeminiAuthMethod AuthMethod { get; set; }

Property Value

GeminiAuthMethod

ContentType

The MIME type of the request content.

public string ContentType { get; }

Property Value

string

OAuthAccessToken

The OAuth access token to authenticate the request, if using OAuthAccessToken as AuthMethod.

public string OAuthAccessToken { get; set; }

Property Value

string

Methods

GetEndpointUri(GeminiRequestMetadata)

Gets the URI to the API endpoint.

public string GetEndpointUri(GeminiRequestMetadata metadata)

Parameters

metadata GeminiRequestMetadata

The metadata of the request to be carried out on the URI.

Returns

string

The URI.

GetUtf8EncodedData()

Converts the request object to a UTF-8 encoded string.

public string GetUtf8EncodedData()

Returns

string

The string data.