Class: Google::Apis::SpeechV1::RecognizeResponse

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

Overview

The only message returned to the client by the Recognize method. It contains the result as zero or more sequential SpeechRecognitionResult messages.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ RecognizeResponse

Returns a new instance of RecognizeResponse.



1112
1113
1114
# File 'lib/google/apis/speech_v1/classes.rb', line 1112

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

Instance Attribute Details

#request_idFixnum

The ID associated with the request. This is a unique ID specific only to the given request. Corresponds to the JSON property requestId

Returns:

  • (Fixnum)


1087
1088
1089
# File 'lib/google/apis/speech_v1/classes.rb', line 1087

def request_id
  @request_id
end

#resultsArray<Google::Apis::SpeechV1::SpeechRecognitionResult>

Sequential list of transcription results corresponding to sequential portions of audio. Corresponds to the JSON property results



1093
1094
1095
# File 'lib/google/apis/speech_v1/classes.rb', line 1093

def results
  @results
end

#speech_adaptation_infoGoogle::Apis::SpeechV1::SpeechAdaptationInfo

Information on speech adaptation use in results Corresponds to the JSON property speechAdaptationInfo



1098
1099
1100
# File 'lib/google/apis/speech_v1/classes.rb', line 1098

def speech_adaptation_info
  @speech_adaptation_info
end

#total_billed_timeString

When available, billed audio seconds for the corresponding request. Corresponds to the JSON property totalBilledTime

Returns:

  • (String)


1103
1104
1105
# File 'lib/google/apis/speech_v1/classes.rb', line 1103

def total_billed_time
  @total_billed_time
end

#using_legacy_modelsBoolean Also known as: using_legacy_models?

Whether request used legacy asr models (was not automatically migrated to use conformer models). Corresponds to the JSON property usingLegacyModels

Returns:

  • (Boolean)


1109
1110
1111
# File 'lib/google/apis/speech_v1/classes.rb', line 1109

def using_legacy_models
  @using_legacy_models
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1117
1118
1119
1120
1121
1122
1123
# File 'lib/google/apis/speech_v1/classes.rb', line 1117

def update!(**args)
  @request_id = args[:request_id] if args.key?(:request_id)
  @results = args[:results] if args.key?(:results)
  @speech_adaptation_info = args[:speech_adaptation_info] if args.key?(:speech_adaptation_info)
  @total_billed_time = args[:total_billed_time] if args.key?(:total_billed_time)
  @using_legacy_models = args[:using_legacy_models] if args.key?(:using_legacy_models)
end