Class: AssemblyAI::Realtime::ConfigureEndUtteranceSilenceThreshold

Inherits:
Object
  • Object
show all
Defined in:
lib/assemblyai/realtime/types/configure_end_utterance_silence_threshold.rb

Overview

Configure the threshold for how long to wait before ending an utterance. Default

is 700ms.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(end_utterance_silence_threshold:, additional_properties: nil) ⇒ AssemblyAI::Realtime::ConfigureEndUtteranceSilenceThreshold



24
25
26
27
28
# File 'lib/assemblyai/realtime/types/configure_end_utterance_silence_threshold.rb', line 24

def initialize(end_utterance_silence_threshold:, additional_properties: nil)
  @end_utterance_silence_threshold = end_utterance_silence_threshold
  @additional_properties = additional_properties
  @_field_set = { "end_utterance_silence_threshold": end_utterance_silence_threshold }
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)



14
15
16
# File 'lib/assemblyai/realtime/types/configure_end_utterance_silence_threshold.rb', line 14

def additional_properties
  @additional_properties
end

#end_utterance_silence_thresholdInteger (readonly)



12
13
14
# File 'lib/assemblyai/realtime/types/configure_end_utterance_silence_threshold.rb', line 12

def end_utterance_silence_threshold
  @end_utterance_silence_threshold
end

Class Method Details

.from_json(json_object:) ⇒ AssemblyAI::Realtime::ConfigureEndUtteranceSilenceThreshold

Deserialize a JSON object to an instance of

ConfigureEndUtteranceSilenceThreshold


35
36
37
38
39
# File 'lib/assemblyai/realtime/types/configure_end_utterance_silence_threshold.rb', line 35

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  end_utterance_silence_threshold = struct["end_utterance_silence_threshold"]
  new(end_utterance_silence_threshold: end_utterance_silence_threshold, additional_properties: struct)
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.


54
55
56
# File 'lib/assemblyai/realtime/types/configure_end_utterance_silence_threshold.rb', line 54

def self.validate_raw(obj:)
  obj.end_utterance_silence_threshold.is_a?(Integer) != false || raise("Passed value for field obj.end_utterance_silence_threshold is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ConfigureEndUtteranceSilenceThreshold to a JSON object



44
45
46
# File 'lib/assemblyai/realtime/types/configure_end_utterance_silence_threshold.rb', line 44

def to_json(*_args)
  @_field_set&.to_json
end