lib/twilio-ruby/twiml/voice_response.rb in twilio-ruby-5.48.0 vs lib/twilio-ruby/twiml/voice_response.rb in twilio-ruby-5.49.0

- old
+ new

@@ -1157,9 +1157,31 @@ stream = Stream.new(name: name, connector_name: connector_name, url: url, track: track, status_callback: status_callback, status_callback_method: status_callback_method, **keyword_args) yield(stream) if block_given? append(stream) end + + ## + # Create a new <VirtualAgent> 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 + # keyword_args:: additional attributes + def virtual_agent(connector_name: nil, language: nil, sentiment_analysis: nil, status_callback: nil, **keyword_args) + append(VirtualAgent.new(connector_name: connector_name, language: language, sentiment_analysis: sentiment_analysis, status_callback: status_callback, **keyword_args)) + end + end + + ## + # <VirtualAgent> TwiML Noun + class VirtualAgent < TwiML + def initialize(**keyword_args) + super(**keyword_args) + @name = 'VirtualAgent' + + yield(self) if block_given? + end end ## # <Autopilot> TwiML Noun class Autopilot < TwiML \ No newline at end of file