Class: Vapi::FallbackGladiaTranscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • model (Vapi::FallbackGladiaTranscriberModel) (defaults to: OMIT)
  • language_behaviour (Vapi::FallbackGladiaTranscriberLanguageBehaviour) (defaults to: OMIT)
  • language (Vapi::FallbackGladiaTranscriberLanguage) (defaults to: OMIT)

    Defines the language to use for the transcription. Required when languageBehaviour is ‘manual’.

  • languages (Vapi::FallbackGladiaTranscriberLanguages) (defaults to: OMIT)

    Defines the languages to use for the transcription. Required when languageBehaviour is ‘manual’.

  • transcription_hint (String) (defaults to: OMIT)

    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.

  • prosody (Boolean) (defaults to: OMIT)

    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.

  • audio_enhancer (Boolean) (defaults to: OMIT)

    If true, audio will be pre-processed to improve accuracy but latency will increase. Default value is false.

  • confidence_threshold (Float) (defaults to: OMIT)

    Transcripts below this confidence threshold will be discarded. @default 0.4

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_enhancerBoolean (readonly)

Returns If true, audio will be pre-processed to improve accuracy but latency will increase. Default value is false.

Returns:

  • (Boolean)

    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_thresholdFloat (readonly)

Returns Transcripts below this confidence threshold will be discarded. @default 0.4.

Returns:

  • (Float)

    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

#languageVapi::FallbackGladiaTranscriberLanguage (readonly)

Returns Defines the language to use for the transcription. Required when languageBehaviour is ‘manual’.

Returns:



18
19
20
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 18

def language
  @language
end

#language_behaviourVapi::FallbackGladiaTranscriberLanguageBehaviour (readonly)



15
16
17
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 15

def language_behaviour
  @language_behaviour
end

#languagesVapi::FallbackGladiaTranscriberLanguages (readonly)

Returns Defines the languages to use for the transcription. Required when languageBehaviour is ‘manual’.

Returns:



21
22
23
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 21

def languages
  @languages
end

#modelVapi::FallbackGladiaTranscriberModel (readonly)



13
14
15
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 13

def model
  @model
end

#prosodyBoolean (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.

Returns:

  • (Boolean)

    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_hintString (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.

Returns:

  • (String)

    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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


122
123
124
# File 'lib/vapi_server_sdk/types/fallback_gladia_transcriber.rb', line 122

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