EmbedContentRequest Class

Represents a request containing the content for the model to embed.

Definition

Namespace: GenerativeAI.Types
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public class EmbedContentRequest
Inheritance
Object    EmbedContentRequest

Constructors

EmbedContentRequestInitializes a new instance of the EmbedContentRequest class

Properties

Content Gets or sets the content to embed. Only the Parts.Text fields will be counted.
Model Gets or sets the model's resource name. This serves as an ID for the model to use. Format: models/{model}.
OutputDimensionality Gets or sets an optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. Cannot be set when using models/embedding-001.
TaskType Gets or sets the optional task type for which the embeddings will be used. Can only be set for models/embedding-001.
Title Gets or sets an optional title for the text when the task type is [!:TaskType.RetrievalDocument]. Specifying a title provides better quality embeddings for retrieval.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also