Class: Google::Apis::DialogflowV2::GoogleCloudDialogflowV2SpeechToTextConfig

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

Overview

Configures speech transcription for ConversationProfile.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDialogflowV2SpeechToTextConfig

Returns a new instance of GoogleCloudDialogflowV2SpeechToTextConfig.



15468
15469
15470
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 15468

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

Instance Attribute Details

#audio_encodingString

Audio encoding of the audio content to process. Corresponds to the JSON property audioEncoding

Returns:

  • (String)


15404
15405
15406
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 15404

def audio_encoding
  @audio_encoding
end

#enable_word_infoBoolean Also known as: enable_word_info?

If true, Dialogflow returns SpeechWordInfo in StreamingRecognitionResult with information about the recognized speech words, e.g. start and end time offsets. If false or unspecified, Speech doesn't return any word-level information. Corresponds to the JSON property enableWordInfo

Returns:

  • (Boolean)


15412
15413
15414
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 15412

def enable_word_info
  @enable_word_info
end

#language_codeString

The language of the supplied audio. Dialogflow does not do translations. See Language Support for a list of the currently supported language codes. Note that queries in the same session do not necessarily need to specify the same language. Corresponds to the JSON property languageCode

Returns:

  • (String)


15421
15422
15423
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 15421

def language_code
  @language_code
end

#modelString

Which Speech model to select. Select the model best suited to your domain to get best results. If a model is not explicitly specified, then Dialogflow auto- selects a model based on other parameters in the SpeechToTextConfig and Agent settings. If enhanced speech model is enabled for the agent and an enhanced version of the specified model for the language does not exist, then the speech is recognized using the standard version of the specified model. Refer to Cloud Speech API documentation for more details. If you specify a model, the following models typically have the best performance: - phone_call (best for Agent Assist and telephony) - latest_short (best for Dialogflow non-telephony)

  • command_and_search Leave this field unspecified to use Agent Speech settings for model selection. Corresponds to the JSON property model

Returns:

  • (String)


15438
15439
15440
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 15438

def model
  @model
end

#phrase_setsArray<String>

List of names of Cloud Speech phrase sets that are used for transcription. Corresponds to the JSON property phraseSets

Returns:

  • (Array<String>)


15443
15444
15445
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 15443

def phrase_sets
  @phrase_sets
end

#sample_rate_hertzFixnum

Sample rate (in Hertz) of the audio content sent in the query. Refer to Cloud Speech API documentation for more details. Corresponds to the JSON property sampleRateHertz

Returns:

  • (Fixnum)


15450
15451
15452
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 15450

def sample_rate_hertz
  @sample_rate_hertz
end

#speech_model_variantString

The speech model used in speech to text. SPEECH_MODEL_VARIANT_UNSPECIFIED, USE_BEST_AVAILABLE will be treated as USE_ENHANCED. It can be overridden in AnalyzeContentRequest and StreamingAnalyzeContentRequest request. If enhanced model variant is specified and an enhanced version of the specified model for the language does not exist, then it would emit an error. Corresponds to the JSON property speechModelVariant

Returns:

  • (String)


15459
15460
15461
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 15459

def speech_model_variant
  @speech_model_variant
end

#use_timeout_based_endpointingBoolean Also known as: use_timeout_based_endpointing?

Use timeout based endpointing, interpreting endpointer sensitivy as seconds of timeout value. Corresponds to the JSON property useTimeoutBasedEndpointing

Returns:

  • (Boolean)


15465
15466
15467
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 15465

def use_timeout_based_endpointing
  @use_timeout_based_endpointing
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 15473

def update!(**args)
  @audio_encoding = args[:audio_encoding] if args.key?(:audio_encoding)
  @enable_word_info = args[:enable_word_info] if args.key?(:enable_word_info)
  @language_code = args[:language_code] if args.key?(:language_code)
  @model = args[:model] if args.key?(:model)
  @phrase_sets = args[:phrase_sets] if args.key?(:phrase_sets)
  @sample_rate_hertz = args[:sample_rate_hertz] if args.key?(:sample_rate_hertz)
  @speech_model_variant = args[:speech_model_variant] if args.key?(:speech_model_variant)
  @use_timeout_based_endpointing = args[:use_timeout_based_endpointing] if args.key?(:use_timeout_based_endpointing)
end