Class: Google::Apis::AiplatformV1::GoogleCloudAiplatformV1Fact

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/aiplatform_v1/classes.rb,
lib/google/apis/aiplatform_v1/representations.rb,
lib/google/apis/aiplatform_v1/representations.rb

Overview

The fact used in grounding.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1Fact

Returns a new instance of GoogleCloudAiplatformV1Fact.



12211
12212
12213
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 12211

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#chunkGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1RagChunk

A RagChunk includes the content of a chunk of a RagFile, and associated metadata. Corresponds to the JSON property chunk



12173
12174
12175
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 12173

def chunk
  @chunk
end

#queryString

Query that is used to retrieve this fact. Corresponds to the JSON property query

Returns:

  • (String)


12178
12179
12180
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 12178

def query
  @query
end

#scoreFloat

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. Corresponds to the JSON property score

Returns:

  • (Float)


12189
12190
12191
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 12189

def score
  @score
end

#summaryString

If present, the summary/snippet of the fact. Corresponds to the JSON property summary

Returns:

  • (String)


12194
12195
12196
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 12194

def summary
  @summary
end

#titleString

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

Returns:

  • (String)


12199
12200
12201
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 12199

def title
  @title
end

#uriString

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

Returns:

  • (String)


12204
12205
12206
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 12204

def uri
  @uri
end

#vector_distanceFloat

If present, the distance between the query vector and this fact vector. Corresponds to the JSON property vectorDistance

Returns:

  • (Float)


12209
12210
12211
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 12209

def vector_distance
  @vector_distance
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



12216
12217
12218
12219
12220
12221
12222
12223
12224
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 12216

def update!(**args)
  @chunk = args[:chunk] if args.key?(:chunk)
  @query = args[:query] if args.key?(:query)
  @score = args[:score] if args.key?(:score)
  @summary = args[:summary] if args.key?(:summary)
  @title = args[:title] if args.key?(:title)
  @uri = args[:uri] if args.key?(:uri)
  @vector_distance = args[:vector_distance] if args.key?(:vector_distance)
end