Class: Vapi::FallbackTavusVoice
- Inherits:
-
Object
- Object
- Vapi::FallbackTavusVoice
- Defined in:
- lib/vapi_server_sdk/types/fallback_tavus_voice.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#caching_enabled ⇒ Boolean
readonly
This is the flag to toggle voice caching for the assistant.
-
#callback_url ⇒ String
readonly
This is the url that will receive webhooks with updates regarding the conversation state.
-
#chunk_plan ⇒ Vapi::ChunkPlan
readonly
This is the plan for chunking the model output before it is sent to the voice provider.
-
#conversation_name ⇒ String
readonly
This is the name for the conversation.
-
#conversational_context ⇒ String
readonly
This is the context that will be appended to any context provided in the persona, if one is provided.
-
#custom_greeting ⇒ String
readonly
This is the custom greeting that the replica will give once a participant joines the conversation.
-
#persona_id ⇒ String
readonly
This is the unique identifier for the persona that the replica will use in the conversation.
-
#properties ⇒ Vapi::TavusConversationProperties
readonly
These are optional properties used to customize the conversation.
-
#voice_id ⇒ Vapi::FallbackTavusVoiceVoiceId
readonly
This is the provider-specific ID that will be used.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::FallbackTavusVoice
Deserialize a JSON object to an instance of FallbackTavusVoice.
-
.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:, caching_enabled: OMIT, persona_id: OMIT, callback_url: OMIT, conversation_name: OMIT, conversational_context: OMIT, custom_greeting: OMIT, properties: OMIT, chunk_plan: OMIT, additional_properties: nil) ⇒ Vapi::FallbackTavusVoice constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of FallbackTavusVoice to a JSON object.
Constructor Details
#initialize(voice_id:, caching_enabled: OMIT, persona_id: OMIT, callback_url: OMIT, conversation_name: OMIT, conversational_context: OMIT, custom_greeting: OMIT, properties: OMIT, chunk_plan: OMIT, additional_properties: nil) ⇒ Vapi::FallbackTavusVoice
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 58 def initialize(voice_id:, caching_enabled: OMIT, persona_id: OMIT, callback_url: OMIT, conversation_name: OMIT, conversational_context: OMIT, custom_greeting: OMIT, properties: OMIT, chunk_plan: OMIT, additional_properties: nil) @caching_enabled = caching_enabled if caching_enabled != OMIT @voice_id = voice_id @persona_id = persona_id if persona_id != OMIT @callback_url = callback_url if callback_url != OMIT @conversation_name = conversation_name if conversation_name != OMIT @conversational_context = conversational_context if conversational_context != OMIT @custom_greeting = custom_greeting if custom_greeting != OMIT @properties = properties if properties != OMIT @chunk_plan = chunk_plan if chunk_plan != OMIT @additional_properties = additional_properties @_field_set = { "cachingEnabled": caching_enabled, "voiceId": voice_id, "personaId": persona_id, "callbackUrl": callback_url, "conversationName": conversation_name, "conversationalContext": conversational_context, "customGreeting": custom_greeting, "properties": properties, "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.
35 36 37 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 35 def additional_properties @additional_properties end |
#caching_enabled ⇒ Boolean (readonly)
Returns This is the flag to toggle voice caching for the assistant.
12 13 14 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 12 def caching_enabled @caching_enabled end |
#callback_url ⇒ String (readonly)
Returns This is the url that will receive webhooks with updates regarding the conversation state.
20 21 22 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 20 def callback_url @callback_url end |
#chunk_plan ⇒ Vapi::ChunkPlan (readonly)
Returns This is the plan for chunking the model output before it is sent to the voice provider.
33 34 35 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 33 def chunk_plan @chunk_plan end |
#conversation_name ⇒ String (readonly)
Returns This is the name for the conversation.
22 23 24 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 22 def conversation_name @conversation_name end |
#conversational_context ⇒ String (readonly)
Returns This is the context that will be appended to any context provided in the persona, if one is provided.
25 26 27 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 25 def conversational_context @conversational_context end |
#custom_greeting ⇒ String (readonly)
Returns This is the custom greeting that the replica will give once a participant joines the conversation.
28 29 30 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 28 def custom_greeting @custom_greeting end |
#persona_id ⇒ String (readonly)
Returns This is the unique identifier for the persona that the replica will use in the conversation.
17 18 19 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 17 def persona_id @persona_id end |
#properties ⇒ Vapi::TavusConversationProperties (readonly)
Returns These are optional properties used to customize the conversation.
30 31 32 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 30 def properties @properties end |
#voice_id ⇒ Vapi::FallbackTavusVoiceVoiceId (readonly)
Returns This is the provider-specific ID that will be used.
14 15 16 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 14 def voice_id @voice_id end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::FallbackTavusVoice
Deserialize a JSON object to an instance of FallbackTavusVoice
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 89 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) caching_enabled = parsed_json["cachingEnabled"] if parsed_json["voiceId"].nil? voice_id = nil else voice_id = parsed_json["voiceId"].to_json voice_id = Vapi::FallbackTavusVoiceVoiceId.from_json(json_object: voice_id) end persona_id = parsed_json["personaId"] callback_url = parsed_json["callbackUrl"] conversation_name = parsed_json["conversationName"] conversational_context = parsed_json["conversationalContext"] custom_greeting = parsed_json["customGreeting"] if parsed_json["properties"].nil? properties = nil else properties = parsed_json["properties"].to_json properties = Vapi::TavusConversationProperties.from_json(json_object: properties) end 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( caching_enabled: caching_enabled, voice_id: voice_id, persona_id: persona_id, callback_url: callback_url, conversation_name: conversation_name, conversational_context: conversational_context, custom_greeting: custom_greeting, properties: properties, 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.
143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 143 def self.validate_raw(obj:) obj.caching_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.caching_enabled is not the expected type, validation failed.") Vapi::FallbackTavusVoiceVoiceId.validate_raw(obj: obj.voice_id) obj.persona_id&.is_a?(String) != false || raise("Passed value for field obj.persona_id is not the expected type, validation failed.") obj.callback_url&.is_a?(String) != false || raise("Passed value for field obj.callback_url is not the expected type, validation failed.") obj.conversation_name&.is_a?(String) != false || raise("Passed value for field obj.conversation_name is not the expected type, validation failed.") obj.conversational_context&.is_a?(String) != false || raise("Passed value for field obj.conversational_context is not the expected type, validation failed.") obj.custom_greeting&.is_a?(String) != false || raise("Passed value for field obj.custom_greeting is not the expected type, validation failed.") obj.properties.nil? || Vapi::TavusConversationProperties.validate_raw(obj: obj.properties) obj.chunk_plan.nil? || Vapi::ChunkPlan.validate_raw(obj: obj.chunk_plan) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of FallbackTavusVoice to a JSON object
133 134 135 |
# File 'lib/vapi_server_sdk/types/fallback_tavus_voice.rb', line 133 def to_json(*_args) @_field_set&.to_json end |