Class: Google::Apis::DialogflowV2::GoogleCloudDialogflowV2SpeechContext

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

Overview

Hints for the speech recognizer to help with recognition in a specific conversation state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ GoogleCloudDialogflowV2SpeechContext

Returns a new instance of GoogleCloudDialogflowV2SpeechContext.



3116
3117
3118
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3116

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

Instance Attribute Details

#boostFloat

Optional. Boost for this context compared to other contexts:

  • If the boost is positive, Dialogflow will increase the probability that the phrases in this context are recognized over similar sounding phrases.
  • If the boost is unspecified or non-positive, Dialogflow will not apply any boost. Dialogflow recommends that you use boosts in the range (0, 20] and that you find a value that fits your use case with binary search. Corresponds to the JSON property boost

Returns:

  • (Float)


3100
3101
3102
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3100

def boost
  @boost
end

#phrasesArray<String>

Optional. A list of strings containing words and phrases that the speech recognizer should recognize with higher likelihood. This list can be used to:

  • improve accuracy for words and phrases you expect the user to say, e.g. typical commands for your Dialogflow agent
  • add additional words to the speech recognizer vocabulary
  • ... See the Cloud Speech documentation for usage limits. Corresponds to the JSON property phrases

Returns:

  • (Array<String>)


3114
3115
3116
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3114

def phrases
  @phrases
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3121
3122
3123
3124
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3121

def update!(**args)
  @boost = args[:boost] if args.key?(:boost)
  @phrases = args[:phrases] if args.key?(:phrases)
end