Class: Vapi::FallbackGladiaTranscriber
- Inherits:
-
Object
- Object
- Vapi::FallbackGladiaTranscriber
- Defined in:
- lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#audio_enhancer ⇒ Boolean
readonly
If true, audio will be pre-processed to improve accuracy but latency will increase.
-
#confidence_threshold ⇒ Float
readonly
Transcripts below this confidence threshold will be discarded.
-
#language ⇒ Vapi::FallbackGladiaTranscriberLanguage
readonly
Defines the language to use for the transcription.
- #language_behaviour ⇒ Vapi::FallbackGladiaTranscriberLanguageBehaviour readonly
-
#languages ⇒ Vapi::FallbackGladiaTranscriberLanguages
readonly
Defines the languages to use for the transcription.
- #model ⇒ Vapi::FallbackGladiaTranscriberModel readonly
-
#prosody ⇒ Boolean
readonly
If prosody is true, you will get a transcription that can contain prosodies i.e.
-
#transcription_hint ⇒ String
readonly
Provides a custom vocabulary to the model to improve accuracy of transcribing context specific words, technical terms, names, etc.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::FallbackGladiaTranscriber
Deserialize a JSON object to an instance of FallbackGladiaTranscriber.
-
.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(model: OMIT, language_behaviour: OMIT, language: OMIT, languages: OMIT, transcription_hint: OMIT, prosody: OMIT, audio_enhancer: OMIT, confidence_threshold: OMIT, additional_properties: nil) ⇒ Vapi::FallbackGladiaTranscriber constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of FallbackGladiaTranscriber to a JSON object.
Constructor Details
#initialize(model: OMIT, language_behaviour: OMIT, language: OMIT, languages: OMIT, transcription_hint: OMIT, prosody: OMIT, audio_enhancer: OMIT, confidence_threshold: OMIT, additional_properties: nil) ⇒ Vapi::FallbackGladiaTranscriber
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 66 def initialize(model: OMIT, language_behaviour: OMIT, language: OMIT, languages: OMIT, transcription_hint: OMIT, prosody: OMIT, audio_enhancer: OMIT, confidence_threshold: OMIT, additional_properties: nil) @model = model if model != OMIT @language_behaviour = language_behaviour if language_behaviour != OMIT @language = language if language != OMIT @languages = languages if languages != OMIT @transcription_hint = transcription_hint if transcription_hint != OMIT @prosody = prosody if prosody != OMIT @audio_enhancer = audio_enhancer if audio_enhancer != OMIT @confidence_threshold = confidence_threshold if confidence_threshold != OMIT @additional_properties = additional_properties @_field_set = { "model": model, "languageBehaviour": language_behaviour, "language": language, "languages": languages, "transcriptionHint": transcription_hint, "prosody": prosody, "audioEnhancer": audio_enhancer, "confidenceThreshold": confidence_threshold }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
39 40 41 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 39 def additional_properties @additional_properties end |
#audio_enhancer ⇒ Boolean (readonly)
Returns If true, audio will be pre-processed to improve accuracy but latency will increase. Default value is false.
34 35 36 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 34 def audio_enhancer @audio_enhancer end |
#confidence_threshold ⇒ Float (readonly)
Returns Transcripts below this confidence threshold will be discarded. @default 0.4.
37 38 39 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 37 def confidence_threshold @confidence_threshold end |
#language ⇒ Vapi::FallbackGladiaTranscriberLanguage (readonly)
Returns Defines the language to use for the transcription. Required when languageBehaviour is ‘manual’.
18 19 20 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 18 def language @language end |
#language_behaviour ⇒ Vapi::FallbackGladiaTranscriberLanguageBehaviour (readonly)
15 16 17 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 15 def language_behaviour @language_behaviour end |
#languages ⇒ Vapi::FallbackGladiaTranscriberLanguages (readonly)
Returns Defines the languages to use for the transcription. Required when languageBehaviour is ‘manual’.
21 22 23 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 21 def languages @languages end |
#model ⇒ Vapi::FallbackGladiaTranscriberModel (readonly)
13 14 15 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 13 def model @model end |
#prosody ⇒ Boolean (readonly)
Returns If prosody is true, you will get a transcription that can contain prosodies i.e. (laugh) (giggles) (malefic laugh) (toss) (music)… Default value is false.
31 32 33 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 31 def prosody @prosody end |
#transcription_hint ⇒ String (readonly)
Returns Provides a custom vocabulary to the model to improve accuracy of transcribing context specific words, technical terms, names, etc. If empty, this argument is ignored. ⚠️ Warning ⚠️: Please be aware that the transcription_hint field has a character limit of 600. If you provide a transcription_hint longer than 600 characters, it will be automatically truncated to meet this limit.
28 29 30 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 28 def transcription_hint @transcription_hint end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::FallbackGladiaTranscriber
Deserialize a JSON object to an instance of FallbackGladiaTranscriber
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 95 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) model = parsed_json["model"] language_behaviour = parsed_json["languageBehaviour"] language = parsed_json["language"] languages = parsed_json["languages"] transcription_hint = parsed_json["transcriptionHint"] prosody = parsed_json["prosody"] audio_enhancer = parsed_json["audioEnhancer"] confidence_threshold = parsed_json["confidenceThreshold"] new( model: model, language_behaviour: language_behaviour, language: language, languages: languages, transcription_hint: transcription_hint, prosody: prosody, audio_enhancer: audio_enhancer, confidence_threshold: confidence_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.
132 133 134 135 136 137 138 139 140 141 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 132 def self.validate_raw(obj:) obj.model&.is_a?(Vapi::FallbackGladiaTranscriberModel) != false || raise("Passed value for field obj.model is not the expected type, validation failed.") obj.language_behaviour&.is_a?(Vapi::FallbackGladiaTranscriberLanguageBehaviour) != false || raise("Passed value for field obj.language_behaviour is not the expected type, validation failed.") obj.language&.is_a?(Vapi::FallbackGladiaTranscriberLanguage) != false || raise("Passed value for field obj.language is not the expected type, validation failed.") obj.languages&.is_a?(Vapi::FallbackGladiaTranscriberLanguages) != false || raise("Passed value for field obj.languages is not the expected type, validation failed.") obj.transcription_hint&.is_a?(String) != false || raise("Passed value for field obj.transcription_hint is not the expected type, validation failed.") obj.prosody&.is_a?(Boolean) != false || raise("Passed value for field obj.prosody is not the expected type, validation failed.") obj.audio_enhancer&.is_a?(Boolean) != false || raise("Passed value for field obj.audio_enhancer is not the expected type, validation failed.") obj.confidence_threshold&.is_a?(Float) != false || raise("Passed value for field obj.confidence_threshold is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of FallbackGladiaTranscriber to a JSON object
122 123 124 |
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 122 def to_json(*_args) @_field_set&.to_json end |