Class: Twilio::TwiML::Connect
- Defined in:
- lib/twilio-ruby/twiml/voice_response.rb
Overview
Instance Attribute Summary
Attributes inherited from TwiML
Instance Method Summary collapse
-
#ai_session(ai_connector: nil, ai_session_configuration: nil, **keyword_args) ⇒ Object
- Create a new
element ai_connector - The unique name or installed add-on sid that identifies the installed addon resource for the AI Connector ai_session_configuration
The unique name or id of the AiSession Configuration resource.
- Create a new
-
#autopilot(name, **keyword_args) ⇒ Object
- Create a new
element name - Autopilot assistant sid or unique name keyword_args
additional attributes.
- Create a new
-
#conversation(service_instance_sid: nil, inbound_autocreation: nil, routing_assignment_timeout: nil, inbound_timeout: nil, url: nil, method: nil, record: nil, trim: nil, recording_status_callback: nil, recording_status_callback_method: nil, recording_status_callback_event: nil, status_callback: nil, status_callback_method: nil, status_callback_event: nil, **keyword_args) ⇒ Object
- Create a new
element service_instance_sid - Service instance Sid inbound_autocreation
- Inbound autocreation routing_assignment_timeout
- Routing assignment timeout inbound_timeout
- Inbound timeout url
- TwiML URL method
- TwiML URL method record
- Record trim
- Trim recording_status_callback
- Recording status callback URL recording_status_callback_method
- Recording status callback URL method recording_status_callback_event
- Recording status callback events status_callback
- Status callback URL status_callback_method
- Status callback URL method status_callback_event
- Events to call status callback URL keyword_args
additional attributes.
- Create a new
-
#conversation_relay(url: nil, language: nil, tts_language: nil, transcription_language: nil, tts_provider: nil, voice: nil, transcription_provider: nil, speech_model: nil, profanity_filter: nil, dtmf_detection: nil, welcome_greeting: nil, partial_prompts: nil, welcome_greeting_interruptible: nil, interruptible: nil, preemptible: nil, hints: nil, intelligence_service: nil, report_input_during_agent_speech: nil, elevenlabs_text_normalization: nil, interrupt_sensitivity: nil, debug: nil, backgroundNoiseReduction: nil, speechTimeout: nil, deepgramSmartFormat: nil, ignoreBackchannel: nil, events: nil, partial_prompt_on_hangup: nil, eager_eot_threshold: nil, asr_smart_format: nil, tts_text_normalization: nil, tts_language_text_normalization: nil, elevenlabs_language_text_normalization: nil, include_in_prompt: nil, customer_name: nil, application_reconnect: nil, echo_prompt_filtering: nil, turn_detection: nil, conversation_id: nil, conversation_configuration: nil, **keyword_args) {|conversation_relay| ... } ⇒ Object
- Create a new
element url - URL of the remote service where the session is connected to language
- Language to be used for both text-to-speech and transcription tts_language
- Language to be used for text-to-speech transcription_language
- Language to be used for transcription tts_provider
- Provider to be used for text-to-speech voice
- Voice to be used for text-to-speech transcription_provider
- Provider to be used for transcription speech_model
- Speech model to be used for transcription profanity_filter
- Whether profanities should be filtered out of the speech transcription dtmf_detection
- Whether DTMF tones should be detected and reported in speech transcription welcome_greeting
- The sentence to be played automatically when the session is connected partial_prompts
- Whether partial prompts should be reported to WebSocket server before the caller finishes speaking welcome_greeting_interruptible
- "Whether and how the input from a caller, such as speaking or DTMF can interrupt the welcome greeting interruptible
- Whether and how the input from a caller, such as speaking or DTMF can interrupt the play of text-to-speech preemptible
- Whether subsequent text-to-speech or play media can interrupt the on-going play of text-to-speech or media hints
- Phrases to help better accuracy in speech recognition of these pharases intelligence_service
- The Conversational Intelligence Service id or unique name to be used for the session report_input_during_agent_speech
- Whether prompts should be reported to WebSocket server when text-to-speech playing and interrupt is disabled elevenlabs_text_normalization
- When using ElevenLabs as TTS provider, this parameter allows you to enable or disable its text normalization feature interrupt_sensitivity
Set the sensitivity of the interrupt feature for speech.
- Create a new
-
#conversation_relay_session(connector: nil, session_configuration: nil, **keyword_args) ⇒ Object
- Create a new
element connector - The unique name or installed add-on sid that identifies the installed addon resource for the ConversationRelaySession Connector session_configuration
The unique name or id of the ConversationRelaySession Configuration resource.
- Create a new
-
#initialize(**keyword_args) {|_self| ... } ⇒ Connect
constructor
A new instance of Connect.
-
#room(name, participant_identity: nil, **keyword_args) ⇒ Object
- Create a new
element name - Room name participant_identity
- Participant identity when connecting to the Room keyword_args
additional attributes.
- Create a new
-
#stream(name: nil, connector_name: nil, url: nil, track: nil, status_callback: nil, status_callback_method: nil, audio_format: nil, sample_rate: nil, **keyword_args) {|stream| ... } ⇒ Object
- Create a new
element name - Friendly name given to the Stream connector_name
- Unique name for Stream Connector url
- URL of the remote service where the Stream is routed track
- Track to be streamed to remote service status_callback
- Status Callback URL status_callback_method
- Status Callback URL method audio_format
- Required Audio Format sample_rate
- Sample Rate for HD Codec keyword_args
additional attributes.
- Create a new
-
#virtual_agent(connector_name: nil, language: nil, sentiment_analysis: nil, status_callback: nil, status_callback_method: nil, **keyword_args) {|virtual_agent| ... } ⇒ Object
- Create a new
element connector_name - Defines the conversation profile Dialogflow needs to use language
- Language to be used by Dialogflow to transcribe speech sentiment_analysis
- Whether sentiment analysis needs to be enabled or not status_callback
- URL to post status callbacks from Twilio status_callback_method
- HTTP method to use when requesting the status callback URL keyword_args
additional attributes.
- Create a new
Methods inherited from TwiML
#add_child, #add_text, #append, #comment, to_lower_camel_case, #to_s, #xml
Constructor Details
#initialize(**keyword_args) {|_self| ... } ⇒ Connect
Returns a new instance of Connect.
2067 2068 2069 2070 2071 2072 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 2067 def initialize(**keyword_args) super(**keyword_args) @name = 'Connect' yield(self) if block_given? end |
Instance Method Details
#ai_session(ai_connector: nil, ai_session_configuration: nil, **keyword_args) ⇒ Object
Create a new
- ai_connector
The unique name or installed add-on sid that identifies the installed addon resource for the AI Connector
- ai_session_configuration
The unique name or id of the AiSession Configuration resource.
- keyword_args
additional attributes
2199 2200 2201 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 2199 def ai_session(ai_connector: nil, ai_session_configuration: nil, **keyword_args) append(AiSession.new(ai_connector: ai_connector, ai_session_configuration: ai_session_configuration, **keyword_args)) end |
#autopilot(name, **keyword_args) ⇒ Object
Create a new
- name
Autopilot assistant sid or unique name
- keyword_args
additional attributes
2087 2088 2089 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 2087 def autopilot(name, **keyword_args) append(Autopilot.new(name, **keyword_args)) end |
#conversation(service_instance_sid: nil, inbound_autocreation: nil, routing_assignment_timeout: nil, inbound_timeout: nil, url: nil, method: nil, record: nil, trim: nil, recording_status_callback: nil, recording_status_callback_method: nil, recording_status_callback_event: nil, status_callback: nil, status_callback_method: nil, status_callback_event: nil, **keyword_args) ⇒ Object
Create a new
- service_instance_sid
Service instance Sid
- inbound_autocreation
Inbound autocreation
- routing_assignment_timeout
Routing assignment timeout
- inbound_timeout
Inbound timeout
- url
TwiML URL
- method
TwiML URL method
- record
Record
- trim
Trim
- recording_status_callback
Recording status callback URL
- recording_status_callback_method
Recording status callback URL method
- recording_status_callback_event
Recording status callback events
- status_callback
Status callback URL
- status_callback_method
Status callback URL method
- status_callback_event
Events to call status callback URL
- keyword_args
additional attributes
2141 2142 2143 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 2141 def conversation(service_instance_sid: nil, inbound_autocreation: nil, routing_assignment_timeout: nil, inbound_timeout: nil, url: nil, method: nil, record: nil, trim: nil, recording_status_callback: nil, recording_status_callback_method: nil, recording_status_callback_event: nil, status_callback: nil, status_callback_method: nil, status_callback_event: nil, **keyword_args) append(Conversation.new(service_instance_sid: service_instance_sid, inbound_autocreation: inbound_autocreation, routing_assignment_timeout: routing_assignment_timeout, inbound_timeout: inbound_timeout, url: url, method: method, record: record, trim: trim, recording_status_callback: recording_status_callback, recording_status_callback_method: recording_status_callback_method, recording_status_callback_event: recording_status_callback_event, status_callback: status_callback, status_callback_method: status_callback_method, status_callback_event: status_callback_event, **keyword_args)) end |
#conversation_relay(url: nil, language: nil, tts_language: nil, transcription_language: nil, tts_provider: nil, voice: nil, transcription_provider: nil, speech_model: nil, profanity_filter: nil, dtmf_detection: nil, welcome_greeting: nil, partial_prompts: nil, welcome_greeting_interruptible: nil, interruptible: nil, preemptible: nil, hints: nil, intelligence_service: nil, report_input_during_agent_speech: nil, elevenlabs_text_normalization: nil, interrupt_sensitivity: nil, debug: nil, backgroundNoiseReduction: nil, speechTimeout: nil, deepgramSmartFormat: nil, ignoreBackchannel: nil, events: nil, partial_prompt_on_hangup: nil, eager_eot_threshold: nil, asr_smart_format: nil, tts_text_normalization: nil, tts_language_text_normalization: nil, elevenlabs_language_text_normalization: nil, include_in_prompt: nil, customer_name: nil, application_reconnect: nil, echo_prompt_filtering: nil, turn_detection: nil, conversation_id: nil, conversation_configuration: nil, **keyword_args) {|conversation_relay| ... } ⇒ Object
Create a new
- url
URL of the remote service where the session is connected to
- language
Language to be used for both text-to-speech and transcription
- tts_language
Language to be used for text-to-speech
- transcription_language
Language to be used for transcription
- tts_provider
Provider to be used for text-to-speech
- voice
Voice to be used for text-to-speech
- transcription_provider
Provider to be used for transcription
- speech_model
Speech model to be used for transcription
- profanity_filter
Whether profanities should be filtered out of the speech transcription
- dtmf_detection
Whether DTMF tones should be detected and reported in speech transcription
- welcome_greeting
The sentence to be played automatically when the session is connected
- partial_prompts
Whether partial prompts should be reported to WebSocket server before the caller finishes speaking
- welcome_greeting_interruptible
"Whether and how the input from a caller, such as speaking or DTMF can interrupt the welcome greeting
- interruptible
Whether and how the input from a caller, such as speaking or DTMF can interrupt the play of text-to-speech
- preemptible
Whether subsequent text-to-speech or play media can interrupt the on-going play of text-to-speech or media
- hints
Phrases to help better accuracy in speech recognition of these pharases
- intelligence_service
The Conversational Intelligence Service id or unique name to be used for the session
- report_input_during_agent_speech
Whether prompts should be reported to WebSocket server when text-to-speech playing and interrupt is disabled
- elevenlabs_text_normalization
When using ElevenLabs as TTS provider, this parameter allows you to enable or disable its text normalization feature
- interrupt_sensitivity
Set the sensitivity of the interrupt feature for speech. The value can be low, medium, or high
- debug
Multiple debug options to be used for troubleshooting
- backgroundNoiseReduction
This parameters enables background noise filtering on the audio stream before it reaches the STT engine, improving transcription accuracy in noisy environments
- speechTimeout
Set the duration of silence that indicates the end of speech
- deepgramSmartFormat
This parameter enables Deepgram's smart formatting feature, which automatically applies punctuation, capitalization, and formatting (e.g. numbers, dates, currency) to transcripts
- ignoreBackchannel
This parameter brief caller acknowledgments (e.g. "yeah", "uh-huh") are ignored and will not interrupt the agent while it is speaking.
- events
This parameter allows you to enable event subscriptions
- partial_prompt_on_hangup
Whether the in-progress partial transcript should be reported as a prompt when the call hangs up
- eager_eot_threshold
Eager end-of-turn confidence threshold, which fires before the end-of-turn threshold. The value can be between 0.3 and 0.9
- asr_smart_format
Whether smart formatting should be applied to transcripts. Takes precedence over deepgramSmartFormat
- tts_text_normalization
Text normalization for text-to-speech. The value can be auto, on, or off. Takes precedence over elevenlabsTextNormalization
- tts_language_text_normalization
Whether language-specific text normalization should be applied for text-to-speech
- elevenlabs_language_text_normalization
Legacy alias of ttsLanguageTextNormalization
- include_in_prompt
Extra fields to be included in prompt messages. The value can be turn-state or prompt-segments
- customer_name
Customer name sent to Conversations and Conversational Intelligence. Defaults to the caller ID
- application_reconnect
Whether the WebSocket connection to the application should be reconnected if it drops during the call. Defaults to false
- echo_prompt_filtering
Whether transcripts that echo the agent's own text-to-speech should be dropped. Defaults to false
- turn_detection
Whether turn detection should be used to decide when the caller has finished speaking. Defaults to false
- conversation_id
The ID of the Conversation
- conversation_configuration
The ID or the unique name of the Conversation configuration to be used
- keyword_args
additional attributes
2187 2188 2189 2190 2191 2192 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 2187 def conversation_relay(url: nil, language: nil, tts_language: nil, transcription_language: nil, tts_provider: nil, voice: nil, transcription_provider: nil, speech_model: nil, profanity_filter: nil, dtmf_detection: nil, welcome_greeting: nil, partial_prompts: nil, welcome_greeting_interruptible: nil, interruptible: nil, preemptible: nil, hints: nil, intelligence_service: nil, report_input_during_agent_speech: nil, elevenlabs_text_normalization: nil, interrupt_sensitivity: nil, debug: nil, backgroundNoiseReduction: nil, speechTimeout: nil, deepgramSmartFormat: nil, ignoreBackchannel: nil, events: nil, partial_prompt_on_hangup: nil, eager_eot_threshold: nil, asr_smart_format: nil, tts_text_normalization: nil, tts_language_text_normalization: nil, elevenlabs_language_text_normalization: nil, include_in_prompt: nil, customer_name: nil, application_reconnect: nil, echo_prompt_filtering: nil, turn_detection: nil, conversation_id: nil, conversation_configuration: nil, **keyword_args) conversation_relay = ConversationRelay.new(url: url, language: language, tts_language: tts_language, transcription_language: transcription_language, tts_provider: tts_provider, voice: voice, transcription_provider: transcription_provider, speech_model: speech_model, profanity_filter: profanity_filter, dtmf_detection: dtmf_detection, welcome_greeting: welcome_greeting, partial_prompts: partial_prompts, welcome_greeting_interruptible: welcome_greeting_interruptible, interruptible: interruptible, preemptible: preemptible, hints: hints, intelligence_service: intelligence_service, report_input_during_agent_speech: report_input_during_agent_speech, elevenlabs_text_normalization: elevenlabs_text_normalization, interrupt_sensitivity: interrupt_sensitivity, debug: debug, backgroundNoiseReduction: backgroundNoiseReduction, speechTimeout: speechTimeout, deepgramSmartFormat: deepgramSmartFormat, ignoreBackchannel: ignoreBackchannel, events: events, partial_prompt_on_hangup: partial_prompt_on_hangup, eager_eot_threshold: eager_eot_threshold, asr_smart_format: asr_smart_format, tts_text_normalization: tts_text_normalization, tts_language_text_normalization: tts_language_text_normalization, elevenlabs_language_text_normalization: elevenlabs_language_text_normalization, include_in_prompt: include_in_prompt, customer_name: customer_name, application_reconnect: application_reconnect, echo_prompt_filtering: echo_prompt_filtering, turn_detection: turn_detection, conversation_id: conversation_id, conversation_configuration: conversation_configuration, **keyword_args) yield(conversation_relay) if block_given? append(conversation_relay) end |
#conversation_relay_session(connector: nil, session_configuration: nil, **keyword_args) ⇒ Object
Create a new
- connector
The unique name or installed add-on sid that identifies the installed addon resource for the ConversationRelaySession Connector
- session_configuration
The unique name or id of the ConversationRelaySession Configuration resource.
- keyword_args
additional attributes
2208 2209 2210 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 2208 def conversation_relay_session(connector: nil, session_configuration: nil, **keyword_args) append(ConversationRelaySession.new(connector: connector, session_configuration: session_configuration, **keyword_args)) end |
#room(name, participant_identity: nil, **keyword_args) ⇒ Object
Create a new
- name
Room name
- participant_identity
Participant identity when connecting to the Room
- keyword_args
additional attributes
2079 2080 2081 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 2079 def room(name, participant_identity: nil, **keyword_args) append(Room.new(name, participant_identity: participant_identity, **keyword_args)) end |
#stream(name: nil, connector_name: nil, url: nil, track: nil, status_callback: nil, status_callback_method: nil, audio_format: nil, sample_rate: nil, **keyword_args) {|stream| ... } ⇒ Object
Create a new
- name
Friendly name given to the Stream
- connector_name
Unique name for Stream Connector
- url
URL of the remote service where the Stream is routed
- track
Track to be streamed to remote service
- status_callback
Status Callback URL
- status_callback_method
Status Callback URL method
- audio_format
Required Audio Format
- sample_rate
Sample Rate for HD Codec
- keyword_args
additional attributes
2102 2103 2104 2105 2106 2107 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 2102 def stream(name: nil, connector_name: nil, url: nil, track: nil, status_callback: nil, status_callback_method: nil, audio_format: nil, sample_rate: nil, **keyword_args) stream = Stream.new(name: name, connector_name: connector_name, url: url, track: track, status_callback: status_callback, status_callback_method: status_callback_method, audio_format: audio_format, sample_rate: sample_rate, **keyword_args) yield(stream) if block_given? append(stream) end |
#virtual_agent(connector_name: nil, language: nil, sentiment_analysis: nil, status_callback: nil, status_callback_method: nil, **keyword_args) {|virtual_agent| ... } ⇒ Object
Create a new
- connector_name
Defines the conversation profile Dialogflow needs to use
- language
Language to be used by Dialogflow to transcribe speech
- sentiment_analysis
Whether sentiment analysis needs to be enabled or not
- status_callback
URL to post status callbacks from Twilio
- status_callback_method
HTTP method to use when requesting the status callback URL
- keyword_args
additional attributes
2117 2118 2119 2120 2121 2122 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 2117 def virtual_agent(connector_name: nil, language: nil, sentiment_analysis: nil, status_callback: nil, status_callback_method: nil, **keyword_args) virtual_agent = VirtualAgent.new(connector_name: connector_name, language: language, sentiment_analysis: sentiment_analysis, status_callback: status_callback, status_callback_method: status_callback_method, **keyword_args) yield(virtual_agent) if block_given? append(virtual_agent) end |