Class EmbedContentConfig
-
- All Implemented Interfaces:
public abstract class EmbedContentConfig extends JsonSerializable
Optional parameters for the embed_content method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classEmbedContentConfig.BuilderBuilder for EmbedContentConfig.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description EmbedContentConfig()
-
Method Summary
Modifier and Type Method Description abstract Optional<HttpOptions>httpOptions()Used to override HTTP request options. abstract Optional<String>taskType()Type of task for which the embedding will be used. abstract Optional<String>title()Title for the text. abstract Optional<Integer>outputDimensionality()Reduced dimension for the output embedding. abstract Optional<String>mimeType()Gemini Enterprise Agent Platform only. abstract Optional<Boolean>autoTruncate()Gemini Enterprise Agent Platform only. abstract Optional<Boolean>documentOcr()Gemini Enterprise Agent Platform only. abstract Optional<Boolean>audioTrackExtraction()Gemini Enterprise Agent Platform only. static EmbedContentConfig.Builderbuilder()Instantiates a builder for EmbedContentConfig. abstract EmbedContentConfig.BuildertoBuilder()Creates a builder with the same values as this instance. static EmbedContentConfigfromJson(String jsonString)Deserializes a JSON string to a EmbedContentConfig object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
httpOptions
abstract Optional<HttpOptions> httpOptions()
Used to override HTTP request options.
-
title
abstract Optional<String> title()
Title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`.
-
outputDimensionality
abstract Optional<Integer> outputDimensionality()
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. You cannot set this value if using the earlier model (`models/embedding-001`).
-
mimeType
abstract Optional<String> mimeType()
Gemini Enterprise Agent Platform only. The MIME type of the input.
-
autoTruncate
abstract Optional<Boolean> autoTruncate()
Gemini Enterprise Agent Platform only. Whether to silently truncate inputs longer than the max sequence length. If this option is set to false, oversized inputs will lead to an INVALID_ARGUMENT error, similar to other text APIs.
-
documentOcr
abstract Optional<Boolean> documentOcr()
Gemini Enterprise Agent Platform only. Whether to enable OCR for document content. Only applicable to Gemini Embedding 2 models.
-
audioTrackExtraction
abstract Optional<Boolean> audioTrackExtraction()
Gemini Enterprise Agent Platform only. Whether to extract audio from video content. Only applicable to Gemini Embedding 2 models.
-
builder
static EmbedContentConfig.Builder builder()
Instantiates a builder for EmbedContentConfig.
-
toBuilder
abstract EmbedContentConfig.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static EmbedContentConfig fromJson(String jsonString)
Deserializes a JSON string to a EmbedContentConfig object.
-
-
-
-