Class GroundingChunkRetrievedContext
-
- All Implemented Interfaces:
public abstract class GroundingChunkRetrievedContext extends JsonSerializable
Context retrieved from a data source to ground the model's response. This is used when a retrieval tool fetches information from a user-provided corpus or a public dataset.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classGroundingChunkRetrievedContext.BuilderBuilder for GroundingChunkRetrievedContext.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description GroundingChunkRetrievedContext()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>documentName()Output only. abstract Optional<RagChunk>ragChunk()Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. abstract Optional<String>text()The content of the retrieved data source. abstract Optional<String>title()The title of the retrieved data source. abstract Optional<String>uri()The URI of the retrieved data source. abstract Optional<List<GroundingChunkCustomMetadata>>customMetadata()Optional. abstract Optional<String>fileSearchStore()Optional. static GroundingChunkRetrievedContext.Builderbuilder()Instantiates a builder for GroundingChunkRetrievedContext. abstract GroundingChunkRetrievedContext.BuildertoBuilder()Creates a builder with the same values as this instance. static GroundingChunkRetrievedContextfromJson(String jsonString)Deserializes a JSON string to a GroundingChunkRetrievedContext 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
-
documentName
abstract Optional<String> documentName()
Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. This field is not supported in Gemini API.
-
ragChunk
abstract Optional<RagChunk> ragChunk()
Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is populated only when the RAG retrieval tool is used. This field is not supported in Gemini API.
-
customMetadata
abstract Optional<List<GroundingChunkCustomMetadata>> customMetadata()
Optional. User-provided metadata about the retrieved context. This field is not supported in Vertex AI.
-
fileSearchStore
abstract Optional<String> fileSearchStore()
Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`. This field is not supported in Vertex AI.
-
builder
static GroundingChunkRetrievedContext.Builder builder()
Instantiates a builder for GroundingChunkRetrievedContext.
-
toBuilder
abstract GroundingChunkRetrievedContext.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static GroundingChunkRetrievedContext fromJson(String jsonString)
Deserializes a JSON string to a GroundingChunkRetrievedContext object.
-
-
-
-