Package com.google.cloud.aiplatform.v1
Class RagContexts.Context.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<RagContexts.Context.Builder>
com.google.cloud.aiplatform.v1.RagContexts.Context.Builder
- All Implemented Interfaces:
RagContexts.ContextOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- RagContexts.Context
public static final class RagContexts.Context.Builder
extends com.google.protobuf.GeneratedMessage.Builder<RagContexts.Context.Builder>
implements RagContexts.ContextOrBuilder
A context of the query.Protobuf type
google.cloud.aiplatform.v1.RagContexts.Context-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()Context of the retrieved chunk.According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type.The file display name.If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.The text chunk.getChunk()Context of the retrieved chunk.Context of the retrieved chunk.Context of the retrieved chunk.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptordoublegetScore()According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type.The file display name.com.google.protobuf.ByteStringThe file display name.If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.com.google.protobuf.ByteStringIf the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.getText()The text chunk.com.google.protobuf.ByteStringThe text chunk.booleanhasChunk()Context of the retrieved chunk.booleanhasScore()According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeChunk(RagChunk value) Context of the retrieved chunk.mergeFrom(RagContexts.Context other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) Context of the retrieved chunk.setChunk(RagChunk.Builder builderForValue) Context of the retrieved chunk.setScore(double value) According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type.setSourceDisplayName(String value) The file display name.setSourceDisplayNameBytes(com.google.protobuf.ByteString value) The file display name.setSourceUri(String value) If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.setSourceUriBytes(com.google.protobuf.ByteString value) If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.The text chunk.setTextBytes(com.google.protobuf.ByteString value) The text chunk.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<RagContexts.Context.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<RagContexts.Context.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<RagContexts.Context.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<RagContexts.Context.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<RagContexts.Context.Builder>
-
mergeFrom
public RagContexts.Context.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<RagContexts.Context.Builder>- Throws:
IOException
-
getSourceUri
If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.
string source_uri = 1;- Specified by:
getSourceUriin interfaceRagContexts.ContextOrBuilder- Returns:
- The sourceUri.
-
getSourceUriBytes
public com.google.protobuf.ByteString getSourceUriBytes()If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.
string source_uri = 1;- Specified by:
getSourceUriBytesin interfaceRagContexts.ContextOrBuilder- Returns:
- The bytes for sourceUri.
-
setSourceUri
If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.
string source_uri = 1;- Parameters:
value- The sourceUri to set.- Returns:
- This builder for chaining.
-
clearSourceUri
If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.
string source_uri = 1;- Returns:
- This builder for chaining.
-
setSourceUriBytes
If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.
string source_uri = 1;- Parameters:
value- The bytes for sourceUri to set.- Returns:
- This builder for chaining.
-
getSourceDisplayName
The file display name.
string source_display_name = 5;- Specified by:
getSourceDisplayNamein interfaceRagContexts.ContextOrBuilder- Returns:
- The sourceDisplayName.
-
getSourceDisplayNameBytes
public com.google.protobuf.ByteString getSourceDisplayNameBytes()The file display name.
string source_display_name = 5;- Specified by:
getSourceDisplayNameBytesin interfaceRagContexts.ContextOrBuilder- Returns:
- The bytes for sourceDisplayName.
-
setSourceDisplayName
The file display name.
string source_display_name = 5;- Parameters:
value- The sourceDisplayName to set.- Returns:
- This builder for chaining.
-
clearSourceDisplayName
The file display name.
string source_display_name = 5;- Returns:
- This builder for chaining.
-
setSourceDisplayNameBytes
The file display name.
string source_display_name = 5;- Parameters:
value- The bytes for sourceDisplayName to set.- Returns:
- This builder for chaining.
-
getText
The text chunk.
string text = 2;- Specified by:
getTextin interfaceRagContexts.ContextOrBuilder- Returns:
- The text.
-
getTextBytes
public com.google.protobuf.ByteString getTextBytes()The text chunk.
string text = 2;- Specified by:
getTextBytesin interfaceRagContexts.ContextOrBuilder- Returns:
- The bytes for text.
-
setText
The text chunk.
string text = 2;- Parameters:
value- The text to set.- Returns:
- This builder for chaining.
-
clearText
The text chunk.
string text = 2;- Returns:
- This builder for chaining.
-
setTextBytes
The text chunk.
string text = 2;- Parameters:
value- The bytes for text to set.- Returns:
- This builder for chaining.
-
hasScore
public boolean hasScore()According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type. For example, if the metric type is COSINE_DISTANCE, it represents the distance between the query and the context. The larger the distance, the less relevant the context is to the query. The range is [0, 2], while 0 means the most relevant and 2 means the least relevant.
optional double score = 6;- Specified by:
hasScorein interfaceRagContexts.ContextOrBuilder- Returns:
- Whether the score field is set.
-
getScore
public double getScore()According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type. For example, if the metric type is COSINE_DISTANCE, it represents the distance between the query and the context. The larger the distance, the less relevant the context is to the query. The range is [0, 2], while 0 means the most relevant and 2 means the least relevant.
optional double score = 6;- Specified by:
getScorein interfaceRagContexts.ContextOrBuilder- Returns:
- The score.
-
setScore
According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type. For example, if the metric type is COSINE_DISTANCE, it represents the distance between the query and the context. The larger the distance, the less relevant the context is to the query. The range is [0, 2], while 0 means the most relevant and 2 means the least relevant.
optional double score = 6;- Parameters:
value- The score to set.- Returns:
- This builder for chaining.
-
clearScore
According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type. For example, if the metric type is COSINE_DISTANCE, it represents the distance between the query and the context. The larger the distance, the less relevant the context is to the query. The range is [0, 2], while 0 means the most relevant and 2 means the least relevant.
optional double score = 6;- Returns:
- This builder for chaining.
-
hasChunk
public boolean hasChunk()Context of the retrieved chunk.
.google.cloud.aiplatform.v1.RagChunk chunk = 7;- Specified by:
hasChunkin interfaceRagContexts.ContextOrBuilder- Returns:
- Whether the chunk field is set.
-
getChunk
Context of the retrieved chunk.
.google.cloud.aiplatform.v1.RagChunk chunk = 7;- Specified by:
getChunkin interfaceRagContexts.ContextOrBuilder- Returns:
- The chunk.
-
setChunk
Context of the retrieved chunk.
.google.cloud.aiplatform.v1.RagChunk chunk = 7; -
setChunk
Context of the retrieved chunk.
.google.cloud.aiplatform.v1.RagChunk chunk = 7; -
mergeChunk
Context of the retrieved chunk.
.google.cloud.aiplatform.v1.RagChunk chunk = 7; -
clearChunk
Context of the retrieved chunk.
.google.cloud.aiplatform.v1.RagChunk chunk = 7; -
getChunkBuilder
Context of the retrieved chunk.
.google.cloud.aiplatform.v1.RagChunk chunk = 7; -
getChunkOrBuilder
Context of the retrieved chunk.
.google.cloud.aiplatform.v1.RagChunk chunk = 7;- Specified by:
getChunkOrBuilderin interfaceRagContexts.ContextOrBuilder
-