Class Fact (3.56.0)

public final class Fact extends GeneratedMessageV3 implements FactOrBuilder

The fact used in grounding.

Protobuf type google.cloud.aiplatform.v1.Fact

Implements

FactOrBuilder

Static Fields

QUERY_FIELD_NUMBER

public static final int QUERY_FIELD_NUMBER
Field Value
Type Description
int

SCORE_FIELD_NUMBER

public static final int SCORE_FIELD_NUMBER
Field Value
Type Description
int

SUMMARY_FIELD_NUMBER

public static final int SUMMARY_FIELD_NUMBER
Field Value
Type Description
int

TITLE_FIELD_NUMBER

public static final int TITLE_FIELD_NUMBER
Field Value
Type Description
int

URI_FIELD_NUMBER

public static final int URI_FIELD_NUMBER
Field Value
Type Description
int

VECTOR_DISTANCE_FIELD_NUMBER

public static final int VECTOR_DISTANCE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Fact getDefaultInstance()
Returns
Type Description
Fact

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Fact.Builder newBuilder()
Returns
Type Description
Fact.Builder

newBuilder(Fact prototype)

public static Fact.Builder newBuilder(Fact prototype)
Parameter
Name Description
prototype Fact
Returns
Type Description
Fact.Builder

parseDelimitedFrom(InputStream input)

public static Fact parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Fact
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Fact parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Fact
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Fact parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Fact
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Fact parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Fact
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Fact parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Fact
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Fact parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Fact
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Fact parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Fact
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Fact parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Fact
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Fact parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Fact
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Fact parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Fact
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Fact parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Fact
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Fact parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Fact
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Fact> parser()
Returns
Type Description
Parser<Fact>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public Fact getDefaultInstanceForType()
Returns
Type Description
Fact

getParserForType()

public Parser<Fact> getParserForType()
Returns
Type Description
Parser<Fact>
Overrides

getQuery()

public String getQuery()

Query that is used to retrieve this fact.

optional string query = 1;

Returns
Type Description
String

The query.

getQueryBytes()

public ByteString getQueryBytes()

Query that is used to retrieve this fact.

optional string query = 1;

Returns
Type Description
ByteString

The bytes for query.

getScore()

public double getScore()

If present, 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 fact 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 fact. The larger the distance, the less relevant the fact 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
Type Description
double

The score.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getSummary()

public String getSummary()

If present, the summary/snippet of the fact.

optional string summary = 4;

Returns
Type Description
String

The summary.

getSummaryBytes()

public ByteString getSummaryBytes()

If present, the summary/snippet of the fact.

optional string summary = 4;

Returns
Type Description
ByteString

The bytes for summary.

getTitle()

public String getTitle()

If present, it refers to the title of this fact.

optional string title = 2;

Returns
Type Description
String

The title.

getTitleBytes()

public ByteString getTitleBytes()

If present, it refers to the title of this fact.

optional string title = 2;

Returns
Type Description
ByteString

The bytes for title.

getUri()

public String getUri()

If present, this uri links to the source of the fact.

optional string uri = 3;

Returns
Type Description
String

The uri.

getUriBytes()

public ByteString getUriBytes()

If present, this uri links to the source of the fact.

optional string uri = 3;

Returns
Type Description
ByteString

The bytes for uri.

getVectorDistance() (deprecated)

public double getVectorDistance()

Deprecated. google.cloud.aiplatform.v1.Fact.vector_distance is deprecated. See google/cloud/aiplatform/v1/vertex_rag_service.proto;l=284

If present, the distance between the query vector and this fact vector.

optional double vector_distance = 5 [deprecated = true];

Returns
Type Description
double

The vectorDistance.

hasQuery()

public boolean hasQuery()

Query that is used to retrieve this fact.

optional string query = 1;

Returns
Type Description
boolean

Whether the query field is set.

hasScore()

public boolean hasScore()

If present, 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 fact 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 fact. The larger the distance, the less relevant the fact 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
Type Description
boolean

Whether the score field is set.

hasSummary()

public boolean hasSummary()

If present, the summary/snippet of the fact.

optional string summary = 4;

Returns
Type Description
boolean

Whether the summary field is set.

hasTitle()

public boolean hasTitle()

If present, it refers to the title of this fact.

optional string title = 2;

Returns
Type Description
boolean

Whether the title field is set.

hasUri()

public boolean hasUri()

If present, this uri links to the source of the fact.

optional string uri = 3;

Returns
Type Description
boolean

Whether the uri field is set.

hasVectorDistance() (deprecated)

public boolean hasVectorDistance()

Deprecated. google.cloud.aiplatform.v1.Fact.vector_distance is deprecated. See google/cloud/aiplatform/v1/vertex_rag_service.proto;l=284

If present, the distance between the query vector and this fact vector.

optional double vector_distance = 5 [deprecated = true];

Returns
Type Description
boolean

Whether the vectorDistance field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Fact.Builder newBuilderForType()
Returns
Type Description
Fact.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Fact.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Fact.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Fact.Builder toBuilder()
Returns
Type Description
Fact.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException