Class: Google::Apis::DiscoveryengineV1alpha::GoogleCloudDiscoveryengineV1alphaCompletionSuggestion

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

Overview

Autocomplete suggestions that are imported from Customer.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDiscoveryengineV1alphaCompletionSuggestion

Returns a new instance of GoogleCloudDiscoveryengineV1alphaCompletionSuggestion.



6844
6845
6846
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 6844

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

Instance Attribute Details

#alternative_phrasesArray<String>

Alternative matching phrases for this suggestion. Corresponds to the JSON property alternativePhrases

Returns:

  • (Array<String>)


6808
6809
6810
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 6808

def alternative_phrases
  @alternative_phrases
end

#frequencyFixnum

Frequency of this suggestion. Will be used to rank suggestions when score is not available. Corresponds to the JSON property frequency

Returns:

  • (Fixnum)


6814
6815
6816
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 6814

def frequency
  @frequency
end

#global_scoreFloat

Global score of this suggestion. Control how this suggestion would be scored / ranked. Corresponds to the JSON property globalScore

Returns:

  • (Float)


6820
6821
6822
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 6820

def global_score
  @global_score
end

#group_idString

If two suggestions have the same groupId, they will not be returned together. Instead the one ranked higher will be returned. This can be used to deduplicate semantically identical suggestions. Corresponds to the JSON property groupId

Returns:

  • (String)


6827
6828
6829
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 6827

def group_id
  @group_id
end

#group_scoreFloat

The score of this suggestion within its group. Corresponds to the JSON property groupScore

Returns:

  • (Float)


6832
6833
6834
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 6832

def group_score
  @group_score
end

#language_codeString

BCP-47 language code of this suggestion. Corresponds to the JSON property languageCode

Returns:

  • (String)


6837
6838
6839
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 6837

def language_code
  @language_code
end

#suggestionString

Required. The suggestion text. Corresponds to the JSON property suggestion

Returns:

  • (String)


6842
6843
6844
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 6842

def suggestion
  @suggestion
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6849
6850
6851
6852
6853
6854
6855
6856
6857
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 6849

def update!(**args)
  @alternative_phrases = args[:alternative_phrases] if args.key?(:alternative_phrases)
  @frequency = args[:frequency] if args.key?(:frequency)
  @global_score = args[:global_score] if args.key?(:global_score)
  @group_id = args[:group_id] if args.key?(:group_id)
  @group_score = args[:group_score] if args.key?(:group_score)
  @language_code = args[:language_code] if args.key?(:language_code)
  @suggestion = args[:suggestion] if args.key?(:suggestion)
end