Class: Vapi::TalkscriberTranscriber
- Inherits:
-
Object
- Object
- Vapi::TalkscriberTranscriber
- Defined in:
- lib/vapi_server_sdk/types/talkscriber_transcriber.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#fallback_plan ⇒ Vapi::FallbackTranscriberPlan
readonly
This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
-
#language ⇒ Vapi::TalkscriberTranscriberLanguage
readonly
This is the language that will be set for the transcription.
-
#model ⇒ String
readonly
This is the model that will be used for the transcription.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TalkscriberTranscriber
Deserialize a JSON object to an instance of TalkscriberTranscriber.
-
.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: OMIT, fallback_plan: OMIT, additional_properties: nil) ⇒ Vapi::TalkscriberTranscriber constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TalkscriberTranscriber to a JSON object.
Constructor Details
#initialize(model: OMIT, language: OMIT, fallback_plan: OMIT, additional_properties: nil) ⇒ Vapi::TalkscriberTranscriber
35 36 37 38 39 40 41 42 43 |
# File 'lib/vapi_server_sdk/types/talkscriber_transcriber.rb', line 35 def initialize(model: OMIT, language: OMIT, fallback_plan: OMIT, additional_properties: nil) @model = model if model != OMIT @language = language if language != OMIT @fallback_plan = fallback_plan if fallback_plan != OMIT @additional_properties = additional_properties @_field_set = { "model": model, "language": language, "fallbackPlan": fallback_plan }.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/talkscriber_transcriber.rb', line 20 def additional_properties @additional_properties end |
#fallback_plan ⇒ Vapi::FallbackTranscriberPlan (readonly)
Returns This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
18 19 20 |
# File 'lib/vapi_server_sdk/types/talkscriber_transcriber.rb', line 18 def fallback_plan @fallback_plan end |
#language ⇒ Vapi::TalkscriberTranscriberLanguage (readonly)
Returns This is the language that will be set for the transcription. The list of languages Whisper supports can be found here: github.com/openai/whisper/blob/main/whisper/tokenizer.py.
15 16 17 |
# File 'lib/vapi_server_sdk/types/talkscriber_transcriber.rb', line 15 def language @language end |
#model ⇒ String (readonly)
Returns This is the model that will be used for the transcription.
11 12 13 |
# File 'lib/vapi_server_sdk/types/talkscriber_transcriber.rb', line 11 def model @model end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TalkscriberTranscriber
Deserialize a JSON object to an instance of TalkscriberTranscriber
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/vapi_server_sdk/types/talkscriber_transcriber.rb', line 49 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 = parsed_json["language"] if parsed_json["fallbackPlan"].nil? fallback_plan = nil else fallback_plan = parsed_json["fallbackPlan"].to_json fallback_plan = Vapi::FallbackTranscriberPlan.from_json(json_object: fallback_plan) end new( model: model, language: language, fallback_plan: fallback_plan, 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.
81 82 83 84 85 |
# File 'lib/vapi_server_sdk/types/talkscriber_transcriber.rb', line 81 def self.validate_raw(obj:) obj.model&.is_a?(String) != false || raise("Passed value for field obj.model is not the expected type, validation failed.") obj.language&.is_a?(Vapi::TalkscriberTranscriberLanguage) != false || raise("Passed value for field obj.language is not the expected type, validation failed.") obj.fallback_plan.nil? || Vapi::FallbackTranscriberPlan.validate_raw(obj: obj.fallback_plan) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TalkscriberTranscriber to a JSON object
71 72 73 |
# File 'lib/vapi_server_sdk/types/talkscriber_transcriber.rb', line 71 def to_json(*_args) @_field_set&.to_json end |