Class: Vapi::FallbackRimeAiVoice
- Inherits:
-
Object
- Object
- Vapi::FallbackRimeAiVoice
- Defined in:
- lib/vapi_server_sdk/types/fallback_rime_ai_voice.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#chunk_plan ⇒ Vapi::ChunkPlan
readonly
This is the plan for chunking the model output before it is sent to the voice provider.
-
#model ⇒ Vapi::FallbackRimeAiVoiceModel
readonly
This is the model that will be used.
-
#speed ⇒ Float
readonly
This is the speed multiplier that will be used.
-
#voice_id ⇒ Vapi::FallbackRimeAiVoiceId
readonly
This is the provider-specific ID that will be used.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::FallbackRimeAiVoice
Deserialize a JSON object to an instance of FallbackRimeAiVoice.
-
.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(voice_id:, model: OMIT, speed: OMIT, chunk_plan: OMIT, additional_properties: nil) ⇒ Vapi::FallbackRimeAiVoice constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of FallbackRimeAiVoice to a JSON object.
Constructor Details
#initialize(voice_id:, model: OMIT, speed: OMIT, chunk_plan: OMIT, additional_properties: nil) ⇒ Vapi::FallbackRimeAiVoice
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/vapi_server_sdk/types/fallback_rime_ai_voice.rb', line 35 def initialize(voice_id:, model: OMIT, speed: OMIT, chunk_plan: OMIT, additional_properties: nil) @voice_id = voice_id @model = model if model != OMIT @speed = speed if speed != OMIT @chunk_plan = chunk_plan if chunk_plan != OMIT @additional_properties = additional_properties @_field_set = { "voiceId": voice_id, "model": model, "speed": speed, "chunkPlan": chunk_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.
21 22 23 |
# File 'lib/vapi_server_sdk/types/fallback_rime_ai_voice.rb', line 21 def additional_properties @additional_properties end |
#chunk_plan ⇒ Vapi::ChunkPlan (readonly)
Returns This is the plan for chunking the model output before it is sent to the voice provider.
19 20 21 |
# File 'lib/vapi_server_sdk/types/fallback_rime_ai_voice.rb', line 19 def chunk_plan @chunk_plan end |
#model ⇒ Vapi::FallbackRimeAiVoiceModel (readonly)
Returns This is the model that will be used. Defaults to 'v1' when not specified.
14 15 16 |
# File 'lib/vapi_server_sdk/types/fallback_rime_ai_voice.rb', line 14 def model @model end |
#speed ⇒ Float (readonly)
Returns This is the speed multiplier that will be used.
16 17 18 |
# File 'lib/vapi_server_sdk/types/fallback_rime_ai_voice.rb', line 16 def speed @speed end |
#voice_id ⇒ Vapi::FallbackRimeAiVoiceId (readonly)
Returns This is the provider-specific ID that will be used.
12 13 14 |
# File 'lib/vapi_server_sdk/types/fallback_rime_ai_voice.rb', line 12 def voice_id @voice_id end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::FallbackRimeAiVoice
Deserialize a JSON object to an instance of FallbackRimeAiVoice
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/vapi_server_sdk/types/fallback_rime_ai_voice.rb', line 50 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["voiceId"].nil? voice_id = nil else voice_id = parsed_json["voiceId"].to_json voice_id = Vapi::FallbackRimeAiVoiceId.from_json(json_object: voice_id) end model = parsed_json["model"] speed = parsed_json["speed"] if parsed_json["chunkPlan"].nil? chunk_plan = nil else chunk_plan = parsed_json["chunkPlan"].to_json chunk_plan = Vapi::ChunkPlan.from_json(json_object: chunk_plan) end new( voice_id: voice_id, model: model, speed: speed, chunk_plan: chunk_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.
89 90 91 92 93 94 |
# File 'lib/vapi_server_sdk/types/fallback_rime_ai_voice.rb', line 89 def self.validate_raw(obj:) Vapi::FallbackRimeAiVoiceId.validate_raw(obj: obj.voice_id) obj.model&.is_a?(Vapi::FallbackRimeAiVoiceModel) != false || raise("Passed value for field obj.model is not the expected type, validation failed.") obj.speed&.is_a?(Float) != false || raise("Passed value for field obj.speed is not the expected type, validation failed.") obj.chunk_plan.nil? || Vapi::ChunkPlan.validate_raw(obj: obj.chunk_plan) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of FallbackRimeAiVoice to a JSON object
79 80 81 |
# File 'lib/vapi_server_sdk/types/fallback_rime_ai_voice.rb', line 79 def to_json(*_args) @_field_set&.to_json end |