This repository was archived by the owner on Aug 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 472
Add two more VirtualAgent examples. #877
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "title": "Change the Dialogflow ES language", | ||
| "type": "server" | ||
| } |
5 changes: 5 additions & 0 deletions
5
twiml/voice/connect/virtualagent-3/output/connect_virtualagent_3.twiml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <Response> | ||
| <Connect> | ||
| <VirtualAgent connectorName="project" language="fr"/> | ||
| </Connect> | ||
| </Response> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| const VoiceResponse = require('twilio').twiml.VoiceResponse; | ||
|
|
||
| const response = new VoiceResponse(); | ||
| const connect = response.connect(); | ||
| connect.virtualAgent({ | ||
| connectorName: 'project', | ||
| language: 'fr' | ||
| }); | ||
|
|
||
| console.log(response.toString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| using System; | ||
| using Twilio.TwiML; | ||
| using Twilio.TwiML.Voice; | ||
|
|
||
|
|
||
| class Example | ||
| { | ||
| static void Main() | ||
| { | ||
| var response = new VoiceResponse(); | ||
| var connect = new Connect(); | ||
| connect.VirtualAgent(connectorName: "project", language: "fr"); | ||
| response.Append(connect); | ||
|
|
||
| Console.WriteLine(response.ToString()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?php | ||
| require_once './vendor/autoload.php'; | ||
| use Twilio\TwiML\VoiceResponse; | ||
|
|
||
| $response = new VoiceResponse(); | ||
| $connect = $response->connect(); | ||
| $connect->virtualagent(['connectorName' => 'project', 'language' => 'fr']); | ||
|
|
||
| echo $response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| require 'twilio-ruby' | ||
|
|
||
| response = Twilio::TwiML::VoiceResponse.new | ||
| response.connect do |connect| | ||
| connect.virtual_agent(connector_name: 'project', language: 'fr') | ||
| end | ||
|
|
||
| puts response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from twilio.twiml.voice_response import Connect, VoiceResponse, VirtualAgent | ||
|
|
||
| response = VoiceResponse() | ||
| connect = Connect() | ||
| connect.virtual_agent(connector_name='project', language='fr') | ||
| response.append(connect) | ||
|
|
||
| print(response) |
19 changes: 19 additions & 0 deletions
19
twiml/voice/connect/virtualagent-3/virtualagent-3.7.x.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import com.twilio.twiml.voice.Connect; | ||
| import com.twilio.twiml.VoiceResponse; | ||
| import com.twilio.twiml.voice.VirtualAgent; | ||
| import com.twilio.twiml.TwiMLException; | ||
|
|
||
|
|
||
| public class Example { | ||
| public static void main(String[] args) { | ||
| VirtualAgent virtualagent = new VirtualAgent.Builder().connectorName("project").language("fr").build(); | ||
| Connect connect = new Connect.Builder().virtualAgent(virtualagent).build(); | ||
| VoiceResponse response = new VoiceResponse.Builder().connect(connect).build(); | ||
|
|
||
| try { | ||
| System.out.println(response.toXml()); | ||
| } catch (TwiMLException e) { | ||
| e.printStackTrace(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| const VoiceResponse = require('twilio').twiml.VoiceResponse; | ||
|
|
||
| const response = new VoiceResponse(); | ||
| const connect = response.connect({ | ||
| action: 'https://myactionurl.com/twiml' | ||
| }); | ||
| connect.virtualAgent({ | ||
| connectorName: 'project', | ||
| statusCallback: 'https://mycallbackurl.com' | ||
| }); | ||
|
|
||
| console.log(response.toString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| using System; | ||
| using Twilio.TwiML; | ||
| using Twilio.TwiML.Voice; | ||
|
|
||
|
|
||
| class Example | ||
| { | ||
| static void Main() | ||
| { | ||
| var response = new VoiceResponse(); | ||
| var connect = new Connect(action: new Uri("https://myactionurl.com/twiml")); | ||
| connect.VirtualAgent(connectorName: "project", statusCallback: "https://mycallbackurl.com"); | ||
| response.Append(connect); | ||
|
|
||
| Console.WriteLine(response.ToString()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?php | ||
| require_once './vendor/autoload.php'; | ||
| use Twilio\TwiML\VoiceResponse; | ||
|
|
||
| $response = new VoiceResponse(); | ||
| $connect = $response->connect(['action' => 'https://myactionurl.com/twiml']); | ||
| $connect->virtualagent(['connectorName' => 'project', 'statusCallback' => 'https://mycallbackurl.com']); | ||
|
|
||
| echo $response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| require 'twilio-ruby' | ||
|
|
||
| response = Twilio::TwiML::VoiceResponse.new | ||
| response.connect(action: 'https://myactionurl.com/twiml') do |connect| | ||
| connect.virtual_agent(connector_name: 'project', status_callback: 'https://mycallbackurl.com') | ||
| end | ||
|
|
||
| puts response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from twilio.twiml.voice_response import Connect, VoiceResponse, VirtualAgent | ||
|
|
||
| response = VoiceResponse() | ||
| connect = Connect(action='https://myactionurl.com/twiml') | ||
| connect.virtualagent( | ||
| connector_name='project', status_callback='https://mycallbackurl.com' | ||
| ) | ||
| response.append(connect) | ||
|
|
||
| print(response) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import com.twilio.twiml.voice.Connect; | ||
| import com.twilio.twiml.VoiceResponse; | ||
| import com.twilio.twiml.voice.VirtualAgent; | ||
| import com.twilio.twiml.TwiMLException; | ||
|
|
||
|
|
||
| public class Example { | ||
| public static void main(String[] args) { | ||
| VirtualAgent virtualagent = new VirtualAgent.Builder().connectorName("project").statusCallback("https://mycallbackurl.com").build(); | ||
| Connect connect = new Connect.Builder().action("https://myactionurl.com/twiml").virtualAgent(virtualagent).build(); | ||
| VoiceResponse response = new VoiceResponse.Builder().connect(connect).build(); | ||
|
|
||
| try { | ||
| System.out.println(response.toXml()); | ||
| } catch (TwiMLException e) { | ||
| e.printStackTrace(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "title": "Turn on Sentiment Analysis for a Dialogflow ES agent call", | ||
| "type": "server" | ||
| } |
5 changes: 5 additions & 0 deletions
5
twiml/voice/connect/virtualagent-4/output/connect_virtualagent_4.twiml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <Response> | ||
| <Connect> | ||
| <VirtualAgent connectorName="project" sentimentAnalysis="true"/> | ||
| </Connect> | ||
| </Response> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| const VoiceResponse = require('twilio').twiml.VoiceResponse; | ||
|
|
||
| const response = new VoiceResponse(); | ||
| const connect = response.connect(); | ||
| connect.virtualAgent({ | ||
| connectorName: 'project', | ||
| sentimentAnalysis: true | ||
| }); | ||
|
|
||
| console.log(response.toString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| using System; | ||
| using Twilio.TwiML; | ||
| using Twilio.TwiML.Voice; | ||
|
|
||
|
|
||
| class Example | ||
| { | ||
| static void Main() | ||
| { | ||
| var response = new VoiceResponse(); | ||
| var connect = new Connect(); | ||
| connect.VirtualAgent(connectorName: "project", sentimentAnalysis: true); | ||
| response.Append(connect); | ||
|
|
||
| Console.WriteLine(response.ToString()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?php | ||
| require_once './vendor/autoload.php'; | ||
| use Twilio\TwiML\VoiceResponse; | ||
|
|
||
| $response = new VoiceResponse(); | ||
| $connect = $response->connect(); | ||
| $connect->virtualagent(['connectorName' => 'project', 'sentimentAnalysis' => 'true']); | ||
|
|
||
| echo $response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| require 'twilio-ruby' | ||
|
|
||
| response = Twilio::TwiML::VoiceResponse.new | ||
| response.connect do |connect| | ||
| connect.virtual_agent(connector_name: 'project', sentiment_analysis: true) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yet there is in ruby |
||
| end | ||
|
|
||
| puts response | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from twilio.twiml.voice_response import Connect, VoiceResponse, VirtualAgent | ||
|
|
||
| response = VoiceResponse() | ||
| connect = Connect() | ||
| connect.virtual_agent(connector_name='project', sentiment_analysis=True) | ||
| response.append(connect) | ||
|
|
||
| print(response) |
19 changes: 19 additions & 0 deletions
19
twiml/voice/connect/virtualagent-4/virtualagent-4.7.x.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import com.twilio.twiml.voice.Connect; | ||
| import com.twilio.twiml.VoiceResponse; | ||
| import com.twilio.twiml.voice.VirtualAgent; | ||
| import com.twilio.twiml.TwiMLException; | ||
|
|
||
|
|
||
| public class Example { | ||
| public static void main(String[] args) { | ||
| VirtualAgent virtualagent = new VirtualAgent.Builder().connectorName("project").sentimentAnalysis(true).build(); | ||
| Connect connect = new Connect.Builder().virtualAgent(virtualagent).build(); | ||
| VoiceResponse response = new VoiceResponse.Builder().connect(connect).build(); | ||
|
|
||
| try { | ||
| System.out.println(response.toXml()); | ||
| } catch (TwiMLException e) { | ||
| e.printStackTrace(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting...confused as to why there is no underscore in py