Class: Google::Apis::AiplatformV1::GoogleCloudAiplatformV1RagContextsContext

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

A context of the query.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1RagContextsContext

Returns a new instance of GoogleCloudAiplatformV1RagContextsContext.



30846
30847
30848
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 30846

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



30816
30817
30818
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 30816

def chunk
  @chunk
end

#scoreFloat

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

Returns:

  • (Float)


30827
30828
30829
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 30827

def score
  @score
end

#source_display_nameString

The file display name. Corresponds to the JSON property sourceDisplayName

Returns:

  • (String)


30832
30833
30834
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 30832

def source_display_name
  @source_display_name
end

#source_uriString

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

Returns:

  • (String)


30839
30840
30841
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 30839

def source_uri
  @source_uri
end

#textString

The text chunk. Corresponds to the JSON property text

Returns:

  • (String)


30844
30845
30846
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 30844

def text
  @text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



30851
30852
30853
30854
30855
30856
30857
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 30851

def update!(**args)
  @chunk = args[:chunk] if args.key?(:chunk)
  @score = args[:score] if args.key?(:score)
  @source_display_name = args[:source_display_name] if args.key?(:source_display_name)
  @source_uri = args[:source_uri] if args.key?(:source_uri)
  @text = args[:text] if args.key?(:text)
end