Class: Vapi::AssemblyAiTranscriber
- Inherits:
-
Object
- Object
- Vapi::AssemblyAiTranscriber
- Defined in:
- lib/vapi_server_sdk/types/assembly_ai_transcriber.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#disable_partial_transcripts ⇒ Boolean
readonly
Disable partial transcripts.
-
#end_utterance_silence_threshold ⇒ Float
readonly
The duration of the end utterance silence threshold in milliseconds.
-
#language ⇒ String
readonly
This is the language that will be set for the transcription.
-
#realtime_url ⇒ String
readonly
The WebSocket URL that the transcriber connects to.
-
#word_boost ⇒ Array<String>
readonly
Add up to 2500 characters of custom vocabulary.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::AssemblyAiTranscriber
Deserialize a JSON object to an instance of AssemblyAiTranscriber.
-
.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.
Instance Method Summary collapse
- #initialize(language: OMIT, realtime_url: OMIT, word_boost: OMIT, end_utterance_silence_threshold: OMIT, disable_partial_transcripts: OMIT, additional_properties: nil) ⇒ Vapi::AssemblyAiTranscriber constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AssemblyAiTranscriber to a JSON object.
Constructor Details
#initialize(language: OMIT, realtime_url: OMIT, word_boost: OMIT, end_utterance_silence_threshold: OMIT, disable_partial_transcripts: OMIT, additional_properties: nil) ⇒ Vapi::AssemblyAiTranscriber
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/vapi_server_sdk/types/assembly_ai_transcriber.rb', line 35 def initialize(language: OMIT, realtime_url: OMIT, word_boost: OMIT, end_utterance_silence_threshold: OMIT, disable_partial_transcripts: OMIT, additional_properties: nil) @language = language if language != OMIT @realtime_url = realtime_url if realtime_url != OMIT @word_boost = word_boost if word_boost != OMIT @end_utterance_silence_threshold = end_utterance_silence_threshold if end_utterance_silence_threshold != OMIT @disable_partial_transcripts = disable_partial_transcripts if disable_partial_transcripts != OMIT @additional_properties = additional_properties @_field_set = { "language": language, "realtimeUrl": realtime_url, "wordBoost": word_boost, "endUtteranceSilenceThreshold": end_utterance_silence_threshold, "disablePartialTranscripts": disable_partial_transcripts }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/vapi_server_sdk/types/assembly_ai_transcriber.rb', line 20 def additional_properties @additional_properties end |
#disable_partial_transcripts ⇒ Boolean (readonly)
Returns Disable partial transcripts.
Set to true to not receive partial transcripts. Defaults to false.
18 19 20 |
# File 'lib/vapi_server_sdk/types/assembly_ai_transcriber.rb', line 18 def disable_partial_transcripts @disable_partial_transcripts end |
#end_utterance_silence_threshold ⇒ Float (readonly)
Returns The duration of the end utterance silence threshold in milliseconds.
15 16 17 |
# File 'lib/vapi_server_sdk/types/assembly_ai_transcriber.rb', line 15 def end_utterance_silence_threshold @end_utterance_silence_threshold end |
#language ⇒ String (readonly)
Returns This is the language that will be set for the transcription.
9 10 11 |
# File 'lib/vapi_server_sdk/types/assembly_ai_transcriber.rb', line 9 def language @language end |
#realtime_url ⇒ String (readonly)
Returns The WebSocket URL that the transcriber connects to.
11 12 13 |
# File 'lib/vapi_server_sdk/types/assembly_ai_transcriber.rb', line 11 def realtime_url @realtime_url end |
#word_boost ⇒ Array<String> (readonly)
Returns Add up to 2500 characters of custom vocabulary.
13 14 15 |
# File 'lib/vapi_server_sdk/types/assembly_ai_transcriber.rb', line 13 def word_boost @word_boost end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::AssemblyAiTranscriber
Deserialize a JSON object to an instance of AssemblyAiTranscriber
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/vapi_server_sdk/types/assembly_ai_transcriber.rb', line 58 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) language = parsed_json["language"] realtime_url = parsed_json["realtimeUrl"] word_boost = parsed_json["wordBoost"] end_utterance_silence_threshold = parsed_json["endUtteranceSilenceThreshold"] disable_partial_transcripts = parsed_json["disablePartialTranscripts"] new( language: language, realtime_url: realtime_url, word_boost: word_boost, end_utterance_silence_threshold: end_utterance_silence_threshold, disable_partial_transcripts: disable_partial_transcripts, 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.
89 90 91 92 93 94 95 |
# File 'lib/vapi_server_sdk/types/assembly_ai_transcriber.rb', line 89 def self.validate_raw(obj:) obj.language&.is_a?(String) != false || raise("Passed value for field obj.language is not the expected type, validation failed.") obj.realtime_url&.is_a?(String) != false || raise("Passed value for field obj.realtime_url is not the expected type, validation failed.") obj.word_boost&.is_a?(Array) != false || raise("Passed value for field obj.word_boost is not the expected type, validation failed.") obj.end_utterance_silence_threshold&.is_a?(Float) != false || raise("Passed value for field obj.end_utterance_silence_threshold is not the expected type, validation failed.") obj.disable_partial_transcripts&.is_a?(Boolean) != false || raise("Passed value for field obj.disable_partial_transcripts is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of AssemblyAiTranscriber to a JSON object
79 80 81 |
# File 'lib/vapi_server_sdk/types/assembly_ai_transcriber.rb', line 79 def to_json(*_args) @_field_set&.to_json end |